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

Cache-augmented generation (CAG)

From: Beyond the Vector →

When the whole knowledge base fits in the context window, preload it once, compute the model's key-value cache over it, and reuse that cache for every query. No retrieval step, no vector database.

CAG: preload once, reuse the cacheinteractive
handbooksmall, stablecompute onceKV cachecorpus preloadedno retrieval step, no vector database

Preload the whole small corpus once and compute the model's key-value cache over it. This happens a single time.

Cutting a document every N words ignores meaning: sentences get split across chunk boundaries and a heading is glued to the first sentence. Trivial to implement, but the cuts fall wherever the counter lands.

Fixed-size: cut every N words, ignore meaninginteractive
document: Section 3: Returns. A defective laptop may be returned within 30 days. After 30 days, no returns are accepted.
Section 3: Returns. A defective laptop may be returned within 30 days. After 30 days, no returns are accepted.

One clean document, before any cutting.

Structure-aware chunking

From: How RAG Reads a Corpus →

Cutting on the document's own seams (headings, paragraphs, sentences) keeps each chunk a whole, coherent unit, so a fact is never split across a boundary and the heading stands on its own.

Structure-aware: cut on the seams, keep whole thoughtsinteractive
document: Section 3: Returns. A defective laptop may be returned within 30 days. After 30 days, no returns are accepted.
Section 3: Returns. A defective laptop may be returned within 30 days. After 30 days, no returns are accepted.

The same document, before any cutting.

Visualizers — Sachin Gupta