Veltos.Tech

AI and ML

RAG

Also known as: retrieval-augmented generation, RAG pipeline, knowledge base chatbot

Definition

RAG is a pattern where a language model first retrieves relevant fragments from your own knowledge base and answers from them, which delivers current data and a source citation without any fine-tuning of the model itself.

The pipeline has two halves. In the preparation phase documents such as policies, manuals, service descriptions and support history are split into chunks, each chunk is converted into an embedding and stored in a vector store. In the answering phase the user question is embedded as well, the closest chunks are retrieved, often re-ranked by a more precise model, and inserted into the prompt with an instruction along the lines of "answer only from these materials and say so when they do not cover it". The model then writes the answer and cites the documents it used.

The comparison with fine-tuning explains why RAG became the standard answer to "a bot over our documents". Fine-tuning transfers style and format well but facts poorly, costs more, needs data in a specific shape and goes stale with the documents: update a policy and you retrain. RAG updates by reindexing, answers from the current version, lets a human verify through the citation, and supports access control so an employee only sees what they are entitled to. For an internal knowledge base, support desk or catalogue assistant those properties are decisive.

RAG quality is decided by retrieval rather than by the model, and that is the main practical discovery for most teams. If the right chunk is not found, the strongest model will answer wrongly or decline. So the points that matter are chunking (too small loses context, too large fills the prompt with noise), whether results are re-ranked, whether synonyms and industry jargon are handled, and whether vector search is combined with ordinary full-text search. And one mandatory element: a set of test questions with reference answers, run against every change to the pipeline.

Related terms

Related services

Read more

Need this done, not just defined?

We do this work, not only write about it. Describe the task and we will scope it and send a staged estimate.