Visualizers

Learn by moving things

Interactive explainers for the ideas behind retrieval, embeddings, and agents. A formula tells you what is true; dragging a vector shows you why. Each one also appears inside the article it belongs to, and runs entirely in your browser, so drag, poke, and break it.

Portrait of Sachin Gupta rendered in binary

The naive RAG pipeline

From: A Field Guide to RAG →

Step through the four stages every RAG system runs: take the question, retrieve the relevant passages, put them in the prompt, and answer from them. A company-HR example makes each stage concrete.

0 / 4 stages
1 · Question
…
2 · Retrieve
…
3 · Augment
…
4 · Generate
…
Retrieve the relevant passages, put them in the prompt, answer from them. The model never memorized the vacation policy; it read it at question time.

Corrective RAG (CRAG): grade, then recover

From: RAG That Thinks →

An evaluator grades the retrieved documents. When they look weak or only half cover the question, the system does not plough ahead; it refines the query and retrieves again before answering, instead of returning a confidently wrong answer.

0 / 6
1 · Question
…
2 · Retrieve
…
3 · Grade
…
4 · Retrieve again
…
5 · Grade
…
6 · Answer
…
Naive RAG would stop after step 2 with half an answer. The grader and the loop catch the gap and retrieve again before answering.

Iterative / multi-hop RAG

From: RAG That Thinks →

Some questions can only be searched for one fact at a time, because each answer is the key to the next question. Watch a three-hop chain: the company that built the iPhone, its founder, then the founder's successor.

Multi-hop: each answer feeds the next questioninteractive
Q: Who succeeded the founder of the company that built the iPhone?
hop 1What company built the iPhone?retrieveApple
hop 2Who founded Apple?retrieveSteve Jobs
hop 3Who succeeded Steve Jobs as CEO?retrieveTim Cook
answer:...

Hop 1: retrieve “What company built the iPhone?”, get “Apple”, then feed that into the next question.

Visualizers — Sachin Gupta