A language model only knows what was in its training data, and it cannot see your private or recent documents. RAG solves this by looking things up first.
How it works:
Your documents are split into chunks and turned into embeddings (number vectors that capture meaning), stored in a search index or vector database.
When a user asks a question, the system finds the most relevant chunks.
Those chunks are placed in the prompt, with an instruction such as "answer using only this context and say if the answer is not there".
The model writes the answer, and you can show the sources.
Why RAG rather than training: it uses fresh data without retraining, it is cheaper, it lets you cite sources, and you can control access to documents.
Quality depends on good chunking, good retrieval and clean documents. Test it with real questions, and check that it says "I don't know" when the information is missing.
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
A language model only knows what was in its training data, and it cannot see your private or recent documents. RAG solves this by looking things up first.
How it works:
Why RAG rather than training: it uses fresh data without retraining, it is cheaper, it lets you cite sources, and you can control access to documents.
Quality depends on good chunking, good retrieval and clean documents. Test it with real questions, and check that it says "I don't know" when the information is missing.