Retrieval-Augmented Generation
Answering questions with an LLM by first retrieving relevant passages from a knowledge store and giving them to the model as context.
Reviewed by adrian
on
Retrieval-augmented generation (RAG) lets a language model answer from a specific body of knowledge. The question first retrieves matching passages, usually by vector search over embeddings, and the model answers from them, with citations. A knowledge graph can add the relations around the hits as further context. This topic collects how RAG works and how it is built.
Based on
-
Building the knowledge graph site with Claude Code
(
raw/2026/2026-11-11/building-the-knowledge-graph-site-with-claude-code.md) [chat]
Covered in
- Measuring the Search of My Knowledge Base Five local embedding models against 26 test questions: why the search now runs on BGE-M3 instead of multilingual-e5-small, with a new minimum score.
Part of
- AI / Language Models What I use language models for: agents, local models, RAG and small programs in which a model handles one task.
Basis for
- How an LLM Wiki Works How an LLM wiki works, shown on this knowledge base: Markdown in its own Git repository, a Python tool with MCP for agents, and a website that only displays it.
See also
- Knowledge Graph Knowledge as a network of nodes and named relationships rather than a chronological list. The structure shows what connects to what.