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

Sentence-window retrieval

From: How RAG Reads a Corpus

Index individual sentences so the match is sharp, but when one matches, return it plus a window of the sentences around it, so the model reads the context the bare sentence lacked.

Sentence-window: match one sentence, return its neighboursinteractive
The company issues each employee a laptop.
Equipment must be returned when you leave.
A defective device can be returned within 30 days.matched
Returns are processed by the IT desk.
Personal software is not permitted on it.

Each sentence is indexed on its own, so the match is sharp: only the sentence about the 30-day return matches.

Parent-document (small-to-big)

From: How RAG Reads a Corpus

Index small child chunks so matching is precise, but when a child matches, hand the model its larger parent chunk or whole section. You search small and read big.

Parent-document: search small, read biginteractive
parent chunk: “Equipment and Returns” section
laptop issued
return on leaving
30-day defective returnmatch
IT desk processes

Small child chunks are indexed and matched precisely: the “30-day defective return” child is the hit.

Index a short summary of each document so matching is fast and topical, but when a summary matches, retrieve the full source document behind it and read from that.

Summary indexing: match a summary, fetch the full docinteractive
summary HR handbook: leave, benefits, conduct
summary IT policy: equipment, returns, security
full document
summary Finance: expenses, reimbursement

Only a short summary of each document is indexed, so matching is fast and topical: the IT policy summary wins.

Visualizers — Sachin Gupta