📚

Retrieval-Augmented Generation (RAG)

Giving an LLM a library card instead of asking it to memorize everything.

Part 1

The Patron Who Doesn't Need to Memorize the Library

why a good librarian, not a photographic memory, is what actually lets someone answer questions accurately from an enormous, ever-changing collection.

Part 2

What the Librarian Actually Does

the two genuinely distinct steps behind every RAG system: finding the right material, and then actually writing an answer from it.

Part 3

The Patron Who Had to Memorize Everything

what relying purely on a model's memorized training looks like, and exactly where that approach genuinely falls short.

Part 4

Organizing the Stacks

why documents have to be broken into smaller, well-sized pieces before retrieval can work well at all, and how getting that sizing wrong quietly breaks everything downstream.

Part 5

The Card Catalog

how embeddings let a system find content based on what it actually means, not just which exact words happen to appear in it.

Part 6

Filed by Meaning, Not Just Title

how a vector database stores millions of embeddings and finds the closest matches to a query fast enough to be actually useful.

Part 7

Finding the Right Shelf Fast

the actual indexing techniques behind approximate nearest neighbor search, and why the specific algorithm choice involves a genuine, tunable tradeoff.

Part 8

Handing the Patron the Right Books, Not the Whole Library

how many retrieved chunks actually belong in a model's context window, and why more retrieved content isn't automatically better.

Part 9

The Librarian's Judgment Call

why raw similarity scores alone don't always identify the genuinely most useful material, and what a librarian's actual judgment adds on top of a catalog search.

Part 10

When the Catalog Points to the Wrong Shelf

the specific, well-documented ways retrieval can fail, and why diagnosing exactly which failure occurred matters enormously for fixing it.

Part 11

A Second Librarian Double-Checking the First

how a reranking model applies a slower, more careful pass over an initial retrieval to catch mistakes the first, faster search missed.

Part 12

Citing Sources Properly

how to make a model actually ground its answer in retrieved content, and cite it verifiably, rather than quietly drifting back to unverified pretrained knowledge.

Part 13

Updating the Collection Without Rebuilding the Library

how a RAG system keeps its knowledge source current through incremental updates, rather than a slow, disruptive full rebuild every time something changes.

Part 14

Books in Different Formats, Same Subject

how RAG systems handle retrieval across tables, images, and structured data, not just plain, uniform prose.

Part 15

The Reference Desk vs. the Research Room

why some questions need one quick lookup and others need a genuine, multi-step research process — and why RAG systems need both modes.

Part 16

When Two Books Contradict Each Other

how a RAG system should handle retrieved sources that genuinely disagree, rather than confidently picking one and ignoring the conflict.

Part 17

The Librarian Who Says 'We Don't Have That'

why a good RAG system needs to gracefully admit when its knowledge source genuinely doesn't contain an answer, rather than fabricating one anyway.

Part 18

Measuring How Good the Library Service Actually Is

how to evaluate a RAG system rigorously across both retrieval quality and generation quality, rather than relying on a vague sense that it 'seems fine.'

Part 19

The Whole Library System, Not Just One Branch

what it actually takes to run a RAG system reliably in production, across many users, many documents, and real, ongoing operational demands.

Part 20

The Whole Library, Reassembled

reassembling the whole system, from a patron who no longer needs to memorize anything to a fully operational, evaluated, production-grade library service.