< CollectionsStack
All the RAGs.
Every way to build retrieval-augmented generation, one method a section: from the plain pipeline through HyDE, RAG-Fusion, CRAG, RAPTOR and GraphRAG, to the projects that build whole systems.
22 sections · 35 problems · 7 projects
0 of 42 done
Start Next: 01 Build a Document Chunker
Section 01
The plain pipeline
0 of 5
Chunk, embed, retrieve the nearest, answer from what came back (Lewis et al., 2020).
Section 02
Hybrid search
0 of 3
BM25 finds the exact term, embeddings the paraphrase; fuse the two rankings.
Section 03
Reranking
0 of 2
Retrieve wide, then let a model that reads the question order the shortlist.
Section 04
Rewrite the query
0 of 1
Search with what the user meant, not what they typed.
Section 05
HyDE
0 of 1
Embed a hypothetical answer instead of the question: it lands near real answers (Gao et al., 2022).
Section 06
RAG-Fusion
0 of 1
Ask the question several ways, search each, and fuse the rankings by reciprocal rank.
Section 07
Filters and self-query
0 of 2
Narrow by metadata first; let the model write the filter, and check it against the schema.
Section 08
Small-to-big
0 of 1
Match on a sentence, return the section around it.
Section 09
Semantic chunking
0 of 1
Cut where the meaning changes, not every n tokens.
Section 10
Contextual retrieval
0 of 1
Write each chunk's context onto it before indexing (Anthropic, 2024).
Section 11
Late interaction
0 of 1
A vector per token, scored by MaxSim (Khattab and Zaharia, ColBERT, 2020).
Section 12
Multi-hop
0 of 1
A question that needs two documents needs two searches.
Section 13
Self-RAG
0 of 2
Retrieve only when it helps, and check each claim against its passage (Asai et al., 2023).
Section 14
Corrective RAG
0 of 1
Grade what came back: keep it, refine it, or throw it away and search the web (Yan et al., 2024).
Section 15
Agentic RAG
0 of 1
Give retrieval to the model as a tool and let it search until it has enough.
Section 16
RAPTOR
0 of 1
Cluster and summarise chunks into a tree, and search every level at once (Sarthi et al., 2024).
Section 17
GraphRAG
0 of 1
Build an entity graph, summarise its communities, and answer the global question map-reduce (Edge et al., 2024).
Section 18
Long context instead
0 of 3
When it fits, or nearly fits, read it all, and put the answer where the model looks.
Section 19
Grounding
0 of 3
Cite a source for every claim, settle disagreements, and say so when nothing was found.
Section 20
A hostile document
0 of 1
A retrieved page that gives orders is data, not instructions.
Section 21
Measure it
0 of 2
Score the retrieval against labels, and the answer against its context without them.
Section 22
Build it
0 of 7
Whole RAG systems on real models, built with the libraries a team uses: faiss, BM25, networkx.