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

Naive chunking cuts first and embeds each scrap blind to the rest. Late chunking flips the order: embed the whole document first, so every chunk's vector is informed by the full page, then cut and pool. The chunk keeps the context naive chunking throws away.

Late chunking: read the whole page, then cutinteractive
naive chunkingorder of operations:
1. cut into chunks→2. then embed each chunk, blind
the vector for the chunk "the rate rose to 4 percent" ends up:
context lostwhich rate? which year? the scrap was embedded alone

Naive chunking cuts first and embeds each scrap on its own, so the chunk's vector never learns the context that surrounded it.

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.

Visualizers — Sachin Gupta