Glossary
What is RAG (retrieval-augmented generation)?
RAG is a technique in which an AI system looks up relevant text passages in your own documents and passes them to a language model. The model bases its answer on those passages and can refer to the source.
RAG (retrieval-augmented generation) explained
With RAG, documents are first split into chunks and converted into embeddings: series of numbers that capture the meaning of a piece of text. These go into a vector database. When someone asks a question, the system finds the chunks that are most similar in meaning and passes them to the language model along with the question.
RAG works well for questions about policies, manuals, contracts or knowledge bases. It works poorly for questions that require calculation, such as totals or averages, because the model then has to calculate from a few passages instead of all the rows.
With RAG, mind permissions: if someone may not read a document, an answer should not be based on it either. And check the source references, because a model can draw the wrong conclusion even from good passages.
Example
Acme Groothandel could use RAG for staff questions about the employee handbook, such as "how many days of annual leave do I get after five years?". The system then finds the right passage and the answer refers to the relevant chapter.
RAG (retrieval-augmented generation) in ENABLE
RAG and AI chat on documents are not part of ENABLE. ENABLE uses AI for text-to-SQL in the SQL Explorer: the model writes a query on the data warehouse and the database supplies the figures.
FAQ
Frequently asked questions
What is the difference between RAG and text-to-SQL?
RAG looks up text passages in documents and has a language model build an answer from them. Text-to-SQL has a model write a database query, after which the database does the calculation. RAG suits text; text-to-SQL suits figures.
What is a vector database?
A vector database stores embeddings, series of numbers that capture the meaning of text, and quickly finds the chunks that resemble a question. It is the search engine behind most RAG systems.
Does RAG prevent hallucinations?
RAG reduces hallucinations because the model relies on real sources, but it does not eliminate them. Always check the source references.
Further reading
- ResourcesRAG or text-to-SQL: which AI should you choose?RAG and text-to-SQL are two ways to make AI work with your own data. RAG (retrieval-augmented generation) searches your documents for relevant text passages and lets the model formulate an answer from them; text-to-SQL lets the model write a query on a database, so that the database does the calculating. Use RAG for questions about documents and knowledge, and text-to-SQL for questions about figures.Read more
- SolutionAI on your own data: ask questions of business dataQuestion your data warehouse in plain language. The AI sees the structure, not your rows.Read more
- SolutionSecure AI for business: private AI on your dataWhat private, secure AI really means, and how ENABLE limits what the AI sees of your data.Read more
- ResourcesText-to-SQL explained: AI on your databaseText-to-SQL is a technique in which an AI model converts a question in plain language into an SQL query, which is then run on a database. The language model writes the query; the database supplies the figures. How well that works depends mainly on the quality of your metadata and on the safeguards around execution, such as read-only access, timeouts and row limits.Read more
Use AI on your own data. Securely, and without the headache.
In an online demo we show how ENABLE makes your data securely available and how you build on it: describing an app in the AI Builder, plain-language questions, dashboards and APIs. And how we set it up and manage it for you.