Topic 7 of 9 · Level 3: Connected knowledge
RAG
Retrieval-Augmented Generation is context engineering at larger scale. A hybrid of methods is commonly effective—often including BM25, trigram, and k-nearest-neighbour retrieval—but this is overkill for many workflows where context-engineering basics are enough.
The right pipeline depends on the dataset
RAG is a branch of context engineering. There is no single right pipeline because the useful approach depends on a dataset’s size, types, and structure.
The most effective setup is often a mix of search, traversal, and reranking methods. BM25, trigram matching, and k-nearest-neighbour retrieval are the algorithms most consistently mentioned in this context.
Ingestion matters most
The most important portion of a RAG pipeline is often ingestion. At ingestion time, you can:
- transform data;
- reject unsuitable data;
- append metadata;
- classify it; and
- route it.
In my experience, those actions enhance recall far beyond what any mix of retrieval algorithms can produce.
Use it for the workload that needs it
RAG is most valuable for analysis tasks involving huge, messy datasets. Most personal and small-team workflows will never approach the scale at which they truly need it, but it remains useful to understand as a tier above basic context engineering.