RAG, measured

The question

What people type is often a poor search. A follow-up leans on the conversation, a message holds two questions, a question names an idea its answer never mentions. One short model call can prepare the search first.

One call before the search

Conversationthe last few turnsPlanone small model callSearchesquestion, docs, hintsSearchlesson 4Conversationthe last few turnsPlanone small model callSearchesquestion, docs, hintsSearchlesson 4
The planner reads the conversation and writes the searches: a standalone question, the documents to look in, and where the answer is printed. It never answers.

What the planning step can do

OptionWhat it doesWhat was countedWithout → with
RewriteMakes a follow-up stand aloneFollow-ups: score out of 10.27 → 0.36 (people's rewrites: 0.30; every earlier question pasted: 0.18)
SplitOne search per question in a messageMessages holding two questions, of 60: both right pages found1 → 22
RouteSearches only the reports it namesQuestions with the right page in the first 10, in 10047 → 57
HintsSays where the answer is printedThe same, with routing on (lesson 0)57 → 75
Skip small talkAnswers “thanks!” without searchingMessages answered without a searchSmall talk: 0 → 90 of 90; real questions: 0 → 4 of 150, by mistake
Ask backAsks one question when the message is too vagueMessages answered with a questionVague: 0 → 19 of 20; real questions: 0 → 2 of 300, by mistake
Each line is measured without the option, then with it. Scores out of 1 rank how well the right pages came first (nDCG@10); “in 100” counts questions whose right page was in the first 10.

Rewrite a follow-up

A real conversation from a test of government web pages. Its last message, “What is the difference?”, finds nothing on its own. Edit the follow-up and see the search the planner writes.

The conversation so far

  1. UserDid the Soviet orbit made three years earlier map a different region?
  2. AssistantI have no specific information about the Soviet orbit you mentioned or the regions it mapped.
  3. UserWhat is an Earth satellite orbit?
  4. AssistantAn Earth satellite orbit refers to the path taken by a satellite as it revolves around the Earth. The catalog of Earth satellite orbits includes various types, such as the High Earth orbit (Molniya orbit), Medium Earth Orbit (MEO), and Low Earth Orbit (LEO), among others.
Use my own Gemini key

Sent with this one request only. Never stored or logged.

Free tier: Google may use what you send to improve its products. Don't paste anything private.

Saved example: the planner's real search from the run. Edit the follow-up and press the button.

Four versions of the same follow-up

How well each version found this conversation's right pages, out of 1.

VersionScore out of 1
As typed: “What is the difference?”0.00
Every earlier message pasted together0.79
Rewritten by a person0.50
Rewritten by the planner1.00
MTRAG, IBM's multi-turn test, government pages; one question from the run of 2 October 2026.

What rewriting follow-ups bought

0.27 → 0.36

Rewriting follow-ups before the search raised their score from 0.27 to 0.36 out of 1, above the rewrites people wrote by hand (0.30).

MTRAG, government pages: 86 follow-up questions, nDCG@10, planner on Gemini Flash-Lite. Questions asked first in a conversation did not suffer (0.47 against 0.46).

A model on a laptop (Qwen3-8B) matched the paid one at rewriting follow-ups (0.36), fell behind at picking reports among 84 (65 against 75 in 100), and never asked a question back (0 of 20 vague messages, against 19).

One question to ask your team

Do we search the message as the user typed it, or do we prepare the search first?
For engineers

The settings behind the lesson.

  • The planner is one LLM call that returns JSON {searches: [{query, documents, hints}]}, at most 3 searches, with the last 6 turns of 600 characters each. A reply that is not usable JSON falls back to searching the message as typed.
  • The live demo sends the lab's own prompt to gemini-3.5-flash-lite at temperature 0, without document names (the MTRAG setting), on its own daily counter.
  • MTRAG govt: 100 of 201 queries (seed 0), 14 first turns and 86 follow-ups, hybrid search at BM25 weight 0.1. Hints hurt on these pages (0.340 against 0.372), the opposite of FinanceBench, so the app searches the query alone and with hints, then merges.
  • Cost: one extra call per question, 1.2 s on average with Gemini Flash-Lite at about 430 prompt tokens, 2.6 s with 84 report names listed (about 1,450).