17 / 20
answers judged correct, in both runs
17 / 17
answerable questions carrying citations after one instruction change, up from 10
3 / 3
unanswerable questions refused
The problem
Some questions need more than one lookup, such as which of two provinces is closer to Bangkok. A single retrieve-then-answer pass handles these badly, and when it fails I want to see which step went wrong.
Replay a real run
Five questions from the second evaluation run, played back step by step from the saved results: the questions the agents wrote for search, the passages they collected, the answer with its citations, and the judge's verdict. Two of the five are misses, because those are the runs that show the most.
Or ask your own question: "Ask it yourself" runs the agents live on Cloud Run, with every Gemini call going through my LLM gateway (rate limits, PII redaction, prompt-injection checks, cost log, traces), and plays the run back the same way. A live run has no reference answer, so it has no verdict.
- Question
จังหวัดพระนครศรีอยุธยากับจังหวัดกาญจนบุรี จังหวัดไหนอยู่ใกล้กรุงเทพมหานครมากกว่า
Which is closer to Bangkok, Ayutthaya or Kanchanaburi?
Step 1 of 8: Question
10 model calls, 8,192 tokens, 28.5 s on this run. Recorded on 11 October 2026 in evaluation run 2 with Gemini 2.5 Flash, played back from the saved results: nothing here calls a model. Passages are from Thai Wikipedia (CC BY-SA 4.0).
What I built
- A coordinator that splits a question into one sub-question per place.
- A researcher that searches the articles with the hybrid retriever from Thai RAG and writes findings with citations.
- A fact checker, a separate agent that sees only the draft and the collected passages, and verifies the draft before it is returned.
- Sub-agents used as tools instead of hand-offs, so the coordinator can call the researcher several times before it writes the draft. All agents share one list of sources in the session state, so the fact checker reads exactly the passages the researcher found.
- A tracing plugin that records every model and tool call as a call tree, and 54 tests that use scripted models and need no API key.
How I measured it
- 20 questions with reference answers taken from the articles: 8 single-fact, 8 comparisons that need two lookups, 3 unanswerable and 1 partly answerable.
- Per question: were the right articles found, is the answer correct and faithful (judged by Gemini), were comparisons split across enough lookups, did the fact checker run, plus model calls and time.
- Every run costs Gemini calls, so the command prints an estimate and refuses to start without an explicit flag.
| Run 1 | Run 2 | |
|---|---|---|
| Answers judged correct | 17 / 20 | 17 / 20 |
| Answerable questions with a citation | 10 / 17 | 17 / 17 |
| Fact checker ran on answerable questions | 15 / 17 | 17 / 17 |
| Unanswerable questions refused | 3 / 3 | 3 / 3 |
| Model calls / seconds per question | 7.7 / 19.6 | 8.1 / 22.0 |
| Tokens | 117,029 | 132,331 |
Results by question type
Run 2, the current instruction. Every expected article was retrieved for all 17 answerable questions, so the misses are not about finding the right article.
| Type | Questions | Judged correct | Fact checker ran | Model calls | Seconds |
|---|---|---|---|---|---|
| Single fact | 8 | 7 | 8 of 8 | 7.1 | 19.8 |
| Comparison | 8 | 7 | 8 of 8 | 10.1 | 27.4 |
| Not in the corpus | 3 | 3 (refused) | 0 of 3, nothing to check | 3.7 | 7.2 |
| Half answerable | 1 | 0 | 1 of 1 | 13.0 | 40.3 |
| All | 20 | 17 | 17 of 20 | 8.1 | 22.0 |
Where it fails
The same three questions were missed in both runs. I read each one instead of tuning until the number went up.
| Question | What the agent answered | Cause |
|---|---|---|
| Nakhon Ratchasima to Bangkok (reference 259 km) | 256 km by road, 264 km by rail, both from the passages | Reference problem: the article gives 259 km in one section and about 256 km in another |
| Udon Thani or Nong Khai, which is farther | Udon Thani 564 km, Nong Khai not found | Real retrieval failure: the article says 615 km, but none of the 3 queries reached that passage |
| Nan or Yala, which is larger (Yala is not in the corpus) | Nan 11,472.07 km², Yala not found | Borderline: the intended behaviour, likely failed on the judge's exact-number rule (article: 11,472.076) |
What I found
- Run 1 showed two process problems: only 10 of 17 answers cited a source, and the fact checker was skipped on two answerable questions. I tightened one coordinator instruction and ran again. Citations and fact-check use became complete at the cost of about 13% more tokens, and accuracy did not move, so I am not claiming the change made answers more correct.
- Only one of the three misses is a real error of the system, and it is in retrieval: keyword search ranks the 615 km passage 2nd for a query worded "ห่างจากกรุงเทพมหานครกี่กิโลเมตร" but 27th, or not at all, for the "ระยะทาง..." wordings the researcher chose.
- Faithfulness is left out of the headline. Run 1's 0.70 included a bug of mine, a citation parser that read only single references. Run 2 scored 15 of 17 judged answers, but the two numbers are not comparable.
Next steps and limits
- Fix the Nong Khai miss in retrieval or in how the researcher words its queries, not in the coordinator.
- One run per setup, so a one-question difference is within noise.
- The same model family answers and judges, and Wikipedia text can contradict itself between sections.