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

A messy, context-dependent question ('and how much does it cost?') is unsearchable on its own. Query rewriting resolves the context and produces a clear, standalone query the index can match.

Query rewriting: clean the messy questioninteractive
metformin?
and how much does it cost?
sent to search:and how much does it cost?
"it" = ? unsearchable

On its own the follow-up is unsearchable: the index has no idea what “it” refers to.

Query expansion / multi-query

From: A Field Guide to RAG

One wording can miss documents that use different words. Multi-query fans the question into several phrasings, searches all of them in parallel, and pools the results, catching passages a single phrasing would have missed.

Multi-query: ask it several ways, pool the resultsinteractive
question:car insurance claim
originalcar insurance claim
rephraseauto policy claim
rephrasevehicle accident reimbursement
pooled results

You start with a single wording, which may not match documents that use different words.

HyDE: search from a made-up answer

From: A Field Guide to RAG

A question sits far from the passages that answer it on the embedding map. HyDE drafts a rough made-up answer, which lands beside the real answer passages because it is shaped like one, and searches from there. The guess is discarded; the real passages it found are read.

HyDE: search from a made-up answer, not the questioninteractive
the map (embedding space)real answer passagesquestionfar: weak match

The question is worded nothing like the passages that answer it, so it sits far away on the map and pulls back weak matches.

Visualizers — Sachin Gupta