docs/content/v2.25/explore/going-beyond-sql/gen-ai-apps.md
As Generative AI (Gen-AI) technologies continue to advance, their potential applications are becoming increasingly widespread. Databases have long been the backbone of structured data storage and querying for organizations, and integrating them with Gen-AI capabilities can unlock new possibilities for data-driven decision making, automation, and user experiences.
While databases are efficient for storing and querying data, it can be challenging for non-technical users to interact with them directly. This is where chatbots come into play, providing a natural language interface for users to access and manipulate data stored in databases. Because YugabyteDB is fully compatible with PostgreSQL, it can be quickly adapted to provide interaction using Retrieval Augmented Generation (RAG)-based technologies.
This section uses the following terms:
One approach to building chatbots for database interaction is the Retrieval-Augmented Generation (RAG) framework. RAG combines two powerful components: a retrieval system that can fetch relevant information from a knowledge base (in this case, the database schema and data), and a language generation model that can produce natural language responses based on the retrieved information.
The RAG approach is particularly well-suited for building chatbots that interact with YugabyteDB for several reasons.
YugabyteDB stores data in a structured format, making it easier for the retrieval component to find relevant information based on the user's query. In addition to the data itself, the database schema (tables, columns, relationships) provides a rich knowledge base for the retrieval component to understand the context and semantics of the data.
The primary purpose of the LLM is to convert a question in a natural language to a SQL statement. It does so as follows:
{{<warning>}}Typically the data stored in the database is not sent to external systems due to privacy concerns, but some information about the data could be sent.{{</warning>}}
Several tutorials on the different ways of setting up Gen-AI-based interfaces for your database are available:
There are hundreds of LLMs to choose from. The following are a few that we have tried out.
| Type | LLM |
|---|---|
| External | GPT-4 from OpenAI |
| External | Claude-3 from Anthropic |
| External | Vertex AI from Google |
| Local | Solar |
| Local | Mistral AI |
| {.sno-1} |