Give a model the right pages before it answers
RAG (retrieval-augmented generation) finds relevant text and hands it to the model along with your question, so the answer can rest on your documents rather than memory alone.
"Basic", "agentic", "graph", "LLM wiki": they all answer the same question in different ways. Which text does the model read, and who decides? This page has a real search engine you can break, so you can see the differences instead of memorizing them.
Five steps. Tap each one.
First: do you need RAG at all?
Anthropic's guidance: if your knowledge base is under about 200,000 tokens (roughly 500 pages), you may be able to skip retrieval and put all of it in the prompt, using prompt caching to keep it fast and affordable. Source ↗
Search a tiny company handbook, and watch it fail
This is real retrieval running in your browser. BM25 and Reciprocal Rank Fusion are computed live over 15 chunks from a made-up company, "Northwind". Pick a question, then switch methods. Rows marked Needed are the chunks a full answer requires.
See the prompt the model would receive
What's real and what's a stand-in: BM25 and the rank fusion are the real algorithms. "Vector" uses a small hand-built table of word meanings, because real embedding models are too large to ship in one page. It imitates the idea of embeddings, but it's a teaching toy, not a measure of how real models perform. No LLM runs here, and the corpus is fictional.
Eight approaches, and what each is for
They aren't strict rungs on a ladder, and most are combinable. Tap a block.
| Approach | When the work happens | Who picks what to read | Best at | Main cost |
|---|
Trace how each type would handle a hard question
Uses the same Northwind handbook. These traces are illustrative walkthroughs of how each design is meant to behave, not live LLM runs. Real results depend on your data and models.
Which approach should you start with?
A few questions. The advice is deliberately conservative: start simple, measure, and add complexity only when a failure calls for it. This is our own rule of thumb, not an official standard.
Step-by-step tutorials
Start with A. The Python in A, B, and C uses only the standard library, and we ran it before publishing. D and E follow each project's own docs. Ticked steps are saved in this browser.
Where RAG projects actually go wrong
Which approach fits?
Sources
Numbers are the figures those authors reported on their own data. Your results will differ. Checked November 2026.