Why RAG#
LLM knowledge has a cutoff date and can’t cover private documents. Retrieval-augmented generation (RAG) first retrieves relevant content from a knowledge base, then has the model answer based on it — sharply reducing hallucinations.
Workflow#
- Offline indexing: chunk documents, embed them, store in a vector DB
- Online retrieval: embed the question and fetch the most similar chunks
- Generation: stitch retrieved chunks into the prompt and let the LLM answer
Key points#
- Chunking: size and overlap affect retrieval quality
- Hybrid search: vector + keyword (BM25) complement each other
- Reranking: fine-tune relevance of final answers
- Evaluation: measure continuously with RAGAS and similar tools
Summary#
RAG turns LLMs from “generic talk” into “evidence-based answers”. It’s one of the most common patterns for enterprise LLM adoption.

