AI design question · senior · 45 min
Design a long-running research agent
agents, context-management, multi-agent
Prompt
Your company wants an AI research agent that can run for hours: given a broad question, it searches the web and internal documents, reads dozens of sources, and writes a synthesized report. Design the system, with particular attention to what happens as the task runs long.
Interviewer's answers to clarifying questionsopen after you have asked your own
Typical task length? 30 minutes to 4 hours of wall-clock time, tens to low hundreds of tool calls (search, fetch, internal doc read).
Context growth? Sessions that started at a few thousand tokens have grown past 100K tokens as more search results and intermediate notes accumulate.
Failure observed? Tasks that worked reliably last month now fail or drift off-topic, despite no token-limit errors being hit.
Architecture considered? Either a single agent with a large context window, or a lead agent that spawns parallel subagents per sub-topic.
Cost ceiling? $10 per completed report is the target; current runs sometimes exceed $40.
Output requirement? Every claim in the final report must be traceable to a specific retrieved source.
Follow-upsafter your high-level design
A report comes back confidently citing a source that, on inspection, doesn't actually say what's claimed. How do you catch that class of error systematically, not just this one case?
Someone proposes "just switch to a model with a bigger context window" to fix the degraded-task problem. Why might that not fix it?
You decompose into a lead agent plus parallel subagents. Two subagents silently duplicate the same investigation. How do you detect and prevent that?
Leadership wants reports in 10 minutes instead of 4 hours. What architectural change does that force, and what does it cost in quality or token spend?
Answer first: out loud, on paper, or with the interview prompt above. Then compare with the rubric.