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

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.

Adaptive RAG: retrieve only when it helps

From: RAG That Thinks

A router in front of retrieval decides whether a query even needs external knowledge. Simple questions go straight to the model; questions about private or fresh data get retrieved. It sizes the effort to the question.

Adaptive: a router decides whether to retrieveinteractive
queryrouterskip: answer directlyretrieve, then answer
What is 2 + 2?

Skip retrieval. the model already knows this; retrieval would only add noise and latency.

Visualizers — Sachin Gupta