RAG combines document retrieval with model-generated answers. A reliable system needs traceable chunks, measured retrieval, and a clear way to say when the documents do not contain the answer.
A company chatbot should be able to answer questions from its own handbook without asking a general model to memorize the whole document. Retrieval-augmented generation, or RAG, does this by finding relevant passages and giving them to a model as context.
A useful mental model is an open-book exam: the model still has to interpret the material, but the system fetches a small set of pages for it to use. RAG does not retrain the model, and retrieval does not guarantee a correct answer.
First, an indexing flow prepares the library. It extracts text from files, splits it into chunks, stores those chunks with source metadata, and creates the representations used for search. Keep information such as document name, section, page, and access rules so a later answer can point back to its evidence.
Second, a question-answering flow searches for relevant chunks, passes them to the model, and produces an answer. Treat these as separate systems when debugging. If a good passage never appears in the retrieved results, changing the answer prompt will not fix retrieval.
Dense vector search can help when a question uses different words from the document. Lexical search is often useful for exact names, codes, product IDs, and numbers. A hybrid search combines the two, but it adds tuning and complexity. Start with a baseline and add hybrid retrieval or reranking only when a measured failure shows why it is needed.
Evaluation should also be split. Make a small set of realistic questions with the passage that should answer each one. Check whether retrieval returns those passages. Then assess whether the generated answer is correct and supported by the retrieved text. Retrieval metrics such as Recall@k can help with the first part; answer review needs its own rubric.
If the retrieved material does not support an answer, the assistant should say it cannot find enough evidence. A confident guess may look helpful and still be wrong. Show citations or document links so a person can inspect the source.
This is especially important when documents have access controls or change over time. The retrieval layer must apply the same authorization rules as the underlying files, and the index must be refreshed when source documents change.
Build the simplest version first: a few documents, preserved metadata, a fixed set of test questions, and a clear “not found” response. Add more advanced retrieval only when you can point to the failures it is meant to solve.
Sources: Qdrant hybrid search, Qdrant retrieval evaluation.