Personal project by Ulf Fäldt Reifenberg · December 2026 · not affiliated with the EU or any company · not legal advice

One retrieval, or a loop?

Does an agentic retrieval loop built with LangGraph answer questions about the EU AI Act more accurately than a single retrieval, and what does it cost in model calls and tokens?

Loading…

Headline result

45 questions: 33 answerable (15 from one passage, 18 that need a second passage that the first one points to) and 12 that the Act does not answer. Counts, with 95% bootstrap intervals over questions in brackets. Temperature 0, one run per cell.

single: BM25 top 5 passages, one model call. loop: LangGraph graph, up to 3 retrievals, a grading call after each, then the same answer call. single, k=8: BM25 top 8 passages, one call, chosen because it sends about as many input tokens as the 8B loop (1,256 against 1,317 per question), as a control for "more context". The 70B loop sent more (1,724), so for 70B this control has about 27% fewer tokens than the loop.

Trace explorer

Pick a question to see what each setup retrieved, what the grader decided, and how the answer was graded. Passages are the first 200 characters only; the full text is at EUR-Lex.

Paired differences

Same questions, same model: loop minus the comparison arm, in percentage points, with 95% paired bootstrap intervals (10,000 resamples). "Loop wins / loses" counts questions where only one of the two was right. An interval that includes 0 means this test cannot tell them apart.

What it costs

Means per question, bootstrap 95% interval in brackets. Neurons are Cloudflare's billing unit, metered by this project from token counts and published per-model rates. Seconds are model-call time only, replayed from the original uncached call, and include network round trips from one machine; they are rough.

Setup

What this does and does not show

About. Personal project by Ulf Fäldt Reifenberg, built in December 2026 for an application to an AI Engineer contract, with coding agents doing the implementation. Not affiliated with the EU or any company. Not legal advice. The EU AI Act text belongs to the Official Journal of the European Union; this page quotes only short snippets and links to the source.