The design problem
Build an agent that answers research-and-development questions such that a reviewer can check every claim. The verifiability requirement is the whole constraint; without it this is an ordinary retrieval-augmented system.
The naive build has five moving parts: a scholarly search API, a PDF parser, a domain database (clinical trials, patents, chemical or protein records), a model to read and write, and the glue holding them together. Each part is a deployment surface, a failure mode and a version to keep current.
The design worth studying collapses that into two paths and one gate.
The router: one question
The router asks a single question of each incoming request:
Would a person need to read the papers to answer this?
No — the retrieval path. A plain-language question goes in; ranked papers come out with their metadata (authors, abstract, citation count, identifier, link to an open-access copy). Seconds per call, cents or fractions of cents per call. Cheap enough to sit inside an agent's inner loop and be called repeatedly without a budget conversation.
Yes — the deep-work path. The request is briefed the way you would brief a research assistant: it plans, reads the papers and the user's own files, analyses, and returns a cited answer, optionally with generated artifacts. Minutes per call, orders of magnitude more expensive.
That single question is doing a lot of work. It is a cost router, a latency router and a capability router at once, and getting it right is most of the remaining design. Everything downstream is comparatively mechanical.
Why the routing is the hard part
The router has to decide, before any reading happens, whether reading will be necessary — which is close to deciding how hard the question is before answering it. Three failure directions:
Under-routing (sending a read-requiring question down the retrieval path) produces a confident answer assembled from abstracts. Abstracts systematically overstate; a claim that needs the methods section will be wrong in a way that looks fine.
Over-routing (sending a lookup down the deep path) is pure cost and latency. At a 10x price ratio this is the failure that quietly consumes the budget.
Oscillation between the two, where a failed cheap attempt escalates and a failed deep attempt retries cheaply, burns both.
The practical mitigation is to make the router's decision an explicit, logged, reviewable field rather than an emergent property of a prompt — and to measure under-routing specifically, because it is the one that produces wrong answers rather than expensive ones.
The citation gate
This is the part the builder should own rather than delegate, and it is the part that satisfies the original constraint.
Every claim must resolve to a source before it reaches the user. A claim that does not resolve goes back for another pass — it does not reach the reviewer.
Two things make this a gate rather than a formatting step:
Resolution is checked, not asserted. A citation that exists is not a citation that supports the claim. The gate has to confirm the source exists, is reachable, and contains the asserted content — the third being the expensive and frequently skipped part.
Failure is reinjection, not annotation. An unsupported claim is fed back into the loop as the next thing to fix. Marking it "unsourced" and shipping it transfers the work to the reviewer, which defeats the purpose: the reviewer's time is the scarce resource the whole system exists to protect.
The gate is also where you decide what "a claim" is. Sentence-level is the usual granularity and the usual mistake — a sentence can contain a supported fact and an unsupported inference. Clause-level is more honest and more expensive.
Three axes to interrogate any build of this
Traceability. For each claim in the output, can you show where it came from? Not "is there a bibliography" — can you point at the span of the source that licenses this specific assertion?
Cost. Retrieval for volume, deep work only when something genuinely needs reading. If every request takes the deep path, the router is not working, whatever it reports.
Latency. Stream the plan rather than showing a spinner. A minutes-long task that displays nothing is indistinguishable from a hung one, and users kill it and retry, doubling the cost.
The tradeoff the collapse hides
"Five parts become two calls" is the design's selling point and its main risk. Consolidating onto one provider's endpoints does not remove the complexity; it relocates it to a place you cannot inspect or swap.
What you inherit: their retrieval ranking and its biases, their citation resolution and its false positives, their coverage boundaries, their rate limits, their outages, their pricing changes. What you lose: the ability to replace one weak component, to evaluate the retrieval step in isolation, and to run anything on your own infrastructure.
The honest framing is a build-versus-buy decision at the integration layer, with the usual shape: buying is right while the vendor's quality exceeds what you would build and your volume is below where their pricing hurts. It stops being right at the point where retrieval quality becomes your product differentiator — and in a verifiable-research product, retrieval quality is close to being the product.
A mitigation worth designing in from the start: keep the citation gate independent of the retrieval vendor. If the gate validates against sources rather than against the vendor's own claim that it cited something, the gate survives a vendor change and keeps the vendor honest in the meantime.
Failure modes
| Failure | Mechanism | Mitigation |
|---|---|---|
| Confident answer built from abstracts | Under-routing a read-requiring question | Log and measure the router's decision; audit a sample of cheap-path answers against full texts |
| Budget consumed on lookups | Over-routing to the deep path | Price-aware routing with an explicit per-request cost ceiling |
| Citation exists but does not support the claim | Gate checks existence, not content | Verify the claim against the cited span, not the reference list |
| Unsupported claims shipped with a caveat | Gate annotates instead of reinjecting | Make a failed gate a loop iteration, not a label |
| Reviewer becomes the verifier | Everything above, combined | Measure reviewer corrections per output as the system's real quality metric |
| Apparent hang on long tasks | No progress visible | Stream the plan and intermediate state |
| Retry storms on long tasks | Users kill and restart invisible work | Idempotent job submission plus visible progress |
| Vendor coverage gap invisible in output | Consolidated API silently lacks a source type | Test coverage explicitly for each source class you depend on |
Review checklist
Write down the router's question explicitly, and log its decision per request as a first-class field.
Measure under-routing: sample cheap-path answers and check them against full texts.
State the cost ratio between the two paths, and the share of traffic each takes. If the deep path takes most traffic, the router is decorative.
Confirm the citation gate validates claim-to-span, not claim-to-reference-list.
Confirm a failed gate reinjects rather than annotates.
Decide and document the granularity of "a claim" — sentence or clause — and accept the cost of the honest answer.
Keep the gate independent of the retrieval provider, so it survives a swap.
Verify each source class you claim to cover with an actual query, not by reading marketing copy.
Stream plan and progress on anything over a few seconds; make job submission idempotent.
Track reviewer corrections per output over time. That number, not retrieval recall, says whether the system works.
A note on verifying vendor claims
Worth stating plainly, because it is the recurring lesson in this area: when a design is presented on top of a named commercial API, check the published documentation before adopting the specifics. Coverage lists, endpoint names, per-call prices and streaming behaviour described in a write-up frequently do not match what the provider's own introduction and pricing pages say — and a per-call price off by an order of magnitude inverts the routing economics the design rests on.
The architecture above survives that check. The vendor specifics are the part to verify yourself.