xavier-ramirez.com
← Writing

Production · 11 Aug 2026 · 9 min read

How Google’s AI Overview works

You ask a question and get a tidy, cited summary. It looks like magic — but underneath it’s a retrieval pipeline you can take apart. Let’s take it apart, starting with a working one you can drive.

Demo controls
Retrieval
Grounded100%
What's the newest iPhone?
7:54 PM

The newest iPhone is the iPhone 17 lineup, announced in September 2025.

What's in the current lineup

Four models: iPhone 17, iPhone 17 Air, iPhone 17 Pro and 17 Pro Max, with the new Air replacing the Plus.

Next up: the iPhone 18 is expected around September 2026, but Apple hasn't announced it yet.

↳ With Retrieval On it fetches today’s answer (iPhone 17) and cites it — hover a citation or a source and they highlight each other. Flip it Off and the same frozen model drops to last year’s answer (iPhone 16), with nothing to cite.

Why fetch at all?

The web changes every minute — new headlines, prices, results, product launches. But a language model is frozen at its training cutoff: it can’t know what happened after. And you can’t just teach it the news — retraining a frontier model takes weeks and millions, and it’s stale again the next day.

Why retrieval, not retraining

You can’t bake today’s news into the weights

A trained model’s weights are frozen. Teaching it a fresh fact by retraining costs weeks and millions — and it’s stale again tomorrow. So the fact doesn’t go into the model at all: it rides in the prompt. That’s retrieval — the “R” in RAG.

Retrieve (RAG)
~120 ms
  • $0 — no training run
  • 0 weights changed
  • Always current
Retrain the model
~3 weeks
  • ~$12.4M compute
  • 405B weights rewritten
  • Stale again tomorrow

So the fresh fact never goes into the model. It’s fetched at question time and dropped into the prompt — Retrieval-Augmented Generation (RAG) — and the answer is written from what was just pulled.

The pipeline, one stage at a time

Getting from your question to that cited answer takes five moves. Step through them — each stage lights up in the diagram.

The pipeline · one question → one cited answer
RAG
Retrieval
Generation
01Query fan-out

Your one question becomes several. The system rewrites it into sub-queries, so it searches the way a curious person would — not just the literal words you typed.

Run it yourself · open source
open-ai-overview — a transparent AI Overview you can run

The same pipeline, live: a small Python backend (bring-your-own-key) does real query fan-out, live retrieval, grounded citations and a groundedness eval — every step visible. Reproduces the ideas, not Google’s index.

View on GitHub →

More in this series

Now take that same machinery into production — where the “web” is your own private corpus and every answer has to be auditable. That’s RAG in a regulated shop like insurance. Each post takes one part of the pipeline there:

Browse all Production posts →