Retrieval-augmented generation (RAG) is the architecture pattern that lets LLMs speak reliably about your own company knowledge: before answering, the system searches matching passages from your own sources — documents, wikis, tickets, databases — and hands them to the model as context. The model phrases, the retrieval supplies the facts.
RAG thus solves the three core problems of pure LLM use: outdated training knowledge, missing internal knowledge and hallucinations — and makes answers verifiable via citations, without sensitive data flowing into model training.
How a RAG pipeline works
Preparation: documents are split into sections (chunking), translated into vectors by an embedding model and indexed in a vector database. Query: the user question is embedded likewise, the semantically most similar passages are found — often combined with classic keyword search (hybrid search) and re-ranking of hits.
Generation: the best passages go into the prompt together with the question; the LLM answers exclusively on this basis and cites the sources. Quality stands and falls with retrieval — chunking strategy, index freshness and clean source curation decide more about success than model choice.
What matters in enterprise use
- Pass through permissions: the system may only find what the asking user would be allowed to see.
- Mandatory citations: every answer with evidence — otherwise the hallucination question stays open.
- Index maintenance: outdated and contradictory documents spoil any answer quality.
- Mind the injection risk: indexed documents too can contain manipulative instructions.