Design a Deep Research Agent

0%

Editorial Solution

Agent requirements

Why an Agent and Not a Pipeline?

Agent Objective

Autonomy and Constraints

Scale and Session Characteristics

Cost and Budget Management

Tool & action design

Tool Inventory

Tool Selection Strategy

Memory & state design

The Research Graph

Working Memory

Source Credibility Scoring

Contradiction Tracker

State Persistence

Agent architecture

Option 1: Hierarchical Multi-Agent Architecture

Option 2: Single Agent with Plan-Search-Synthesize Loop

Recommended Architecture: Hybrid

Context Window Management

Parallelization

Execution flows

Flow 1: Question Decomposition

Flow 2: Sub-Question Research

Flow 3: Source Credibility Assessment

Flow 4: Contradiction Resolution

Flow 5: Report Generation

Core reasoning design

Question Decomposition Strategies

When to Stop Researching

Source Credibility Assessment

Handling Contradictions

Synthesis Strategies

Safety & permission model

API Rate Limiting

Respecting Robots.txt and Terms of Service

Citation and Plagiarism Prevention

Handling Misinformation and Biased Sources

Cost Controls for Long-Running Sessions

Data Privacy

Observability & monitoring

Session-Level Metrics

Step-Level Metrics

Quality Metrics

Alerting

Logging and Tracing

Failure modes & recovery

The Rabbit Hole Problem

Source Bias (Filter Bubble)

API Rate Limits Stopping Research Mid-Session

Context Window Overflow During Synthesis

Circular Citations

Evaluation & future

Evaluation Dimensions

Comparison to Human Researcher Output

Automated Evaluation Pipeline

Future Directions

Table of Contents

Agent requirements

Why an Agent and Not a Pipeline?

Agent Objective

Autonomy and Constraints

Scale and Session Characteristics

Cost and Budget Management

Tool & action design

Tool Inventory

Tool Selection Strategy

Memory & state design

The Research Graph

Working Memory

Source Credibility Scoring

Contradiction Tracker

State Persistence

Agent architecture

Option 1: Hierarchical Multi-Agent Architecture

Option 2: Single Agent with Plan-Search-Synthesize Loop

Recommended Architecture: Hybrid

Context Window Management

Parallelization

Execution flows

Flow 1: Question Decomposition

Flow 2: Sub-Question Research

Flow 3: Source Credibility Assessment

Flow 4: Contradiction Resolution

Flow 5: Report Generation

Core reasoning design

Question Decomposition Strategies

When to Stop Researching

Source Credibility Assessment

Handling Contradictions

Synthesis Strategies

Safety & permission model

API Rate Limiting

Respecting Robots.txt and Terms of Service

Citation and Plagiarism Prevention

Handling Misinformation and Biased Sources

Cost Controls for Long-Running Sessions

Data Privacy

Observability & monitoring

Session-Level Metrics

Step-Level Metrics

Quality Metrics

Alerting

Logging and Tracing

Failure modes & recovery

The Rabbit Hole Problem

Source Bias (Filter Bubble)

API Rate Limits Stopping Research Mid-Session

Context Window Overflow During Synthesis

Circular Citations

Evaluation & future

Evaluation Dimensions

Comparison to Human Researcher Output

Automated Evaluation Pipeline

Future Directions

Before building anything, nail down what "deep research" actually means as an agent task. This is not a simple search-and-summarize problem. The agent takes a complex research question, breaks it into sub-questions, hunts for evidence across multiple source types, resolves contradictions, and produces a structured report with citations. A human researcher doing this work spends 2-8 hours. The agent must do the same, autonomously, without losing coherence or going down rabbit holes.

Why an Agent and Not a Pipeline?

A pipeline would be: take the question, run a search, summarize the results. That works for simple factual questions ("When was CRISPR discovered?"). It collapses for complex research questions ("What are the current approaches to protein folding prediction and how do they compare in accuracy, computational cost, and applicability to different protein families?"). Here is why:

  • Dynamic decomposition: The sub-questions depend on what you find. After learning there are three main approaches to protein folding, you need to research each one separately. A pipeline cannot make that decision mid-execution.
  • Iterative depth: Some sub-questions need deeper investigation. If two sources contradict each other on accuracy benchmarks, you need to find a third source to adjudicate. A pipeline does one pass.
  • Cross-referencing: Findings from one sub-question inform how you investigate another. If a paper claims 95% accuracy but another paper could not reproduce it, that changes how you assess all claims from that research group. Only an agent with memory can connect those dots.
  • Adaptive stopping: A pipeline runs to completion. An agent recognizes when it has enough evidence and when diminishing returns mean it should move on.

The fundamental distinction is that research is a reasoning loop, not a data flow. The agent must decide what to do next based on what it has learned so far.

Level Expectations

Junior: describe the agent as a search wrapper.

Senior: recognize that the core challenge is the reasoning loop: deciding what to search next based on what was already found, not the search itself.

Agent Objective

Given a complex research question, produce a structured research report that synthesizes findings from web sources and academic databases, includes proper citations, assesses source credibility, and explicitly addresses conflicting evidence.

Core task: Decompose a research question into sub-questions, investigate each through targeted search and reading, synthesize findings into a coherent report with citations and credibility assessments.

Success criteria:

  • Every factual claim in the report traces to a cited source
  • Conflicting evidence is identified and presented with credibility analysis, not silently ignored
  • The report covers all major sub-topics identified during decomposition
  • Research sessions complete within the time budget (configurable, typically 2-8 hours)
  • Source diversity: no more than 40% of citations from a single domain or author group

Key capabilities:

  • Decompose complex questions into a tree or DAG of sub-questions
  • Search the web (Google, Bing) and academic databases (Semantic Scholar, arXiv, Google Scholar)
  • Download, parse, and extract information from PDFs and web pages
  • Track source credibility using signals like citation count, publication venue, recency, and author reputation
  • Detect and resolve contradictions between sources
  • Synthesize findings into a structured report organized thematically or chronologically
  • Manage long-running sessions (hours, not seconds) with persistent state

Autonomy and Constraints

This agent is highly autonomous during a research session. Once the user provides the research question and any constraints (scope, depth, time budget), the agent runs independently. It does not ask the user for guidance mid-session because the whole point is to save the researcher hours of manual work.

Autonomy boundaries:

  • Can do freely: Search the web and academic databases, read public documents, take notes, form sub-questions, synthesize findings, generate reports
  • Cannot do: Access paywalled content without credentials, modify any external systems, present findings as original research (must always cite), exceed the configured time or cost budget
  • Escalation trigger: When the agent cannot find sufficient evidence for a critical sub-question after exhausting its search strategies, it flags that gap in the report rather than fabricating an answer

Why highly autonomous? A human researcher does not check in every 10 minutes for permission to read the next paper. They work independently and deliver a finished product. The agent should mirror this workflow. The risk of autonomy (going down rabbit holes, accumulating costs) is managed through budget constraints and observability, not through human-in-the-loop approval at every step.

Scale and Session Characteristics

Unlike a Q&A agent that handles thousands of short queries per day, the deep research agent handles a small number of long-running sessions. Typical profile:

  • Sessions per day: 10-100 (not thousands)
  • Session duration: 30 minutes to 8 hours
  • Sources consulted per session: 20-200 web pages and papers
  • Sub-questions generated: 5-50 per research question
  • Output: A structured report of 2,000-10,000 words with 15-80 citations

This profile has different infrastructure implications than a high-QPS agent. You do not need sub-second latency per tool call. You need reliability over long durations: the agent must not crash or lose state 4 hours into an 8-hour session.

Cost and Budget Management

Each research session incurs costs from LLM calls (reasoning, decomposition, synthesis), search API calls, and PDF processing. A typical session might look like:

  • LLM calls: 50-200 calls for reasoning, extraction, and synthesis. At $0.01-0.05 per call (depending on model), that is $0.50-$10 per session.
  • Search API calls: 10-50 searches at $0.005-0.01 per search = $0.05-$0.50.
  • Total per session: $1-$15, depending on depth and model choice.

The agent must track costs in real time and stop gracefully when approaching the budget limit, prioritizing synthesis of what it has already found over starting new sub-questions.

Key Insight

The deep research agent inverts the typical agent cost model. Most agents optimize for cost-per-query. Here, you optimize for quality-per-session. A $10 session that saves a researcher 6 hours of work is excellent ROI.

Tools are how the agent interacts with information sources. Unlike a RAG agent with a fixed pipeline, the deep research agent selects tools dynamically based on what it needs to learn next. Each tool has a clear purpose, schema, and failure mode.

Tool Inventory

1. Web Search

Searches the general web for information on a topic.

 
Input: { query: string, num_results: number, date_range?: { after: string, before: string } }
Output: { results: [{ title: string, url: string, snippet: string, date?: string }] }

When to use: Broad topic exploration, finding recent developments, locating non-academic sources (blog posts, news articles, industry reports). The date_range filter is critical for research questions about current state ("What is the latest...") versus historical analysis.

API choices: Google Custom Search API ($5 per 1,000 queries), Bing Web Search API ($3 per 1,000 queries), or SerpAPI ($50/month for 5,000 queries). For a research agent doing 10-50 searches per session, costs are modest.

2. Academic Search

Searches scholarly databases for peer-reviewed research.

 
1Input: { query: string, sources: ["semantic_scholar", "arxiv", "google_scholar"],
2filters?: { year_min?: number, min_citations?: number, fields_of_study?: string[] } }
3Output: { papers: [{ title: string, authors: string[], year: number, abstract: string,
4citation_count: number, venue: string, doi?: string, pdf_url?: string }] }

When to use: Any research question that benefits from peer-reviewed evidence. The filters matter because a 2024 paper with 50 citations carries different weight than a 2024 preprint with zero citations. Semantic Scholar API is free and returns rich metadata including citation counts and influential citation flags. arXiv API is free but limited to preprints. Google Scholar has no official API, so use SerpAPI's Google Scholar endpoint.

Why multiple sources? Each academic database has different coverage. Semantic Scholar indexes 200M+ papers with strong CS and biomedical coverage. arXiv has preprints that have not yet appeared in Semantic Scholar. Google Scholar has the broadest coverage but lowest metadata quality.

3. PDF Downloader and Parser

Downloads and extracts text from PDF documents (academic papers, reports).

 
Input: { url: string, extract_sections?: boolean }
Output: { text: string, sections?: [{ heading: string, content: string }],
metadata: { pages: number, extracted_tables?: number } }

When to use: After academic search returns a paper the agent needs to read in detail. Not every paper needs full reading. The agent should read the abstract first (from search results), decide if the paper is relevant, then download the full PDF only for high-value sources.

Implementation: Use PyMuPDF (fitz) or pdfplumber for text extraction. For papers with complex layouts (two-column, equations), GROBID provides structured extraction of sections, references, and tables. The trade-off is that GROBID requires a separate service but produces much cleaner output.

4. Web Page Reader

Fetches and extracts clean text content from web pages.

 
Input: { url: string, extract_main_content: boolean }
Output: { title: string, text: string, publish_date?: string, author?: string }

When to use: After web search identifies a relevant page that the agent needs to read in full. The extract_main_content flag strips navigation, ads, and boilerplate to return just the article body.

Implementation: Use a headless browser (Playwright) for JavaScript-rendered pages, or a readability library (mozilla/readability, trafilatura) for static pages. Most research-relevant pages (news articles, blog posts, documentation) work with static extraction.

5. Note-Taking / Scratchpad

Stores findings, observations, and connections as the agent researches.

 
Input: { action: "add" | "update" | "query", sub_question_id: string,
content?: string, tags?: string[] }
Output: { note_id: string, related_notes?: [{ note_id: string, relevance: float }] }

Why is this a tool and not just memory? Because the agent needs to actively decide what to write down. Not every piece of information is worth recording. The scratchpad forces the agent to extract and summarize key findings, which improves synthesis quality later. It also enables the agent to query its own notes ("What have I found about X so far?") without re-reading all sources.

Common Pitfall

Do not skip the note-taking tool because it seems like overhead. Without it, the agent must re-read all sources during synthesis. For a 100-source session, that means either blowing the context window or losing information.

6. Citation Manager

Tracks all sources with metadata for report generation.

 
1Input: { action: "add" | "get" | "format", source?: { url: string, title: string,
2authors?: string[], year?: number, venue?: string, accessed_date: string },
3format?: "apa" | "chicago" | "ieee" }
4Output: { citation_id: string, formatted?: string, all_citations?: object[] }

When to use: Every time the agent finds a source it might cite. Adding sources early (even before confirming they will be cited) is better than trying to reconstruct citation metadata during report generation.

7. Report Generator

Produces the final structured research report.

 
1Input: { research_question: string, findings: object, outline: string[],
2citation_ids: string[], format: "markdown" | "pdf" }
3Output: { report: string, word_count: number, citation_count: number,
4uncited_claims: string[] }

The uncited_claims field is a safety check. If the synthesis step produced claims that do not map to any cited source, the agent must either find a source or remove the claim before delivering the report.

Tool Selection Strategy

Unlike a RAG agent where every query follows the same pipeline, the deep research agent decides which tools to use at each step. The decision follows this logic:

  • Exploring a new sub-question: Start with web search and academic search in parallel to get a broad view.
  • Deepening understanding: Use PDF downloader for key papers, web page reader for detailed articles.
  • Cross-referencing a claim: Use academic search with specific author or paper filters to find corroborating or contradicting evidence.
  • Tracking progress: Use note-taking after each search-and-read cycle to consolidate findings.
  • Finalizing: Use citation manager to compile sources, then report generator to produce output.

The LLM decides which tools to call based on the current state of research. This is where the "agent" in "research agent" earns its name.

Interview Tip

Design each tool to be idempotent and stateless. The agent may retry a failed tool call or call the same tool with slightly different parameters. Stateless tools make this safe.

Memory is the backbone of a deep research agent. Unlike a Q&A agent that handles independent queries, this agent builds knowledge over hours. Losing memory mid-session means losing hours of work. The memory design must support accumulation, cross-referencing, and synthesis.

The Research Graph

The core data structure is a research graph that connects questions, sources, findings, and relationships:

 
1ResearchGraph:
2nodes:
3- QuestionNode: { id, text, parent_id?, status: "open" | "researched" | "synthesized" }
4- SourceNode: { id, url, title, type: "paper" | "web" | "report",
5credibility_score: float, metadata: object }
6- FindingNode: { id, claim: string, source_ids: string[],
7confidence: float, tags: string[] }
8edges:
9- DECOMPOSES_INTO: QuestionNode -> QuestionNode
10- SOURCED_FROM: FindingNode -> SourceNode
11- ANSWERS: FindingNode -> QuestionNode
12- CONTRADICTS: FindingNode -> FindingNode
13- SUPPORTS: FindingNode -> FindingNode

Why a graph and not a flat list? Because research findings are interconnected. A finding from Paper A contradicts a finding from Paper B. Both answer sub-question 3. Sub-question 3 was generated because the answer to sub-question 1 revealed an unexpected complexity. These relationships are first-class information that the synthesis step needs.

Example: Researching "Is intermittent fasting effective for weight loss?" The agent decomposes into sub-questions about clinical trial evidence, metabolic mechanisms, and long-term adherence. It finds Finding F1 ("IF produces 3-8% weight loss in 12-week trials" from a meta-analysis) and Finding F2 ("IF shows no significant advantage over continuous calorie restriction" from a randomized controlled trial). F1 and F2 do not contradict each other, but they nuance each other. The graph captures this with a SUPPORTS edge plus a note that F2 qualifies F1's claim.

Working Memory

Working memory holds the agent's current focus: which sub-question it is investigating, what it has found so far for that sub-question, and what it plans to do next.

 
1WorkingMemory:
2current_sub_question: QuestionNode
3search_history: [{ query: string, tool: string, result_count: number }]
4relevant_findings: FindingNode[]
5next_actions: [{ action: string, reasoning: string }]
6token_budget_remaining: number

The working memory is what gets passed to the LLM at each reasoning step. It is a compressed view of the research state that fits within the context window. The full research graph lives in persistent storage; working memory is a window into it.

Why separate working memory from the research graph? The research graph grows continuously and can become far too large for the context window. Working memory is curated: only the information relevant to the current reasoning step is included. When the agent switches to a new sub-question, working memory is rebuilt from the graph, pulling in relevant findings from other sub-questions that might inform the current investigation.

Source Credibility Scoring

Every source gets a credibility score computed from multiple signals:

 
1CredibilityScore:
2citation_count_signal: 0.0-1.0 (normalized by field and year)
3venue_quality_signal: 0.0-1.0 (journal impact factor or domain authority)
4recency_signal: 0.0-1.0 (newer is better, with domain-specific decay)
5author_reputation: 0.0-1.0 (h-index or domain authority score)
6corroboration_signal: 0.0-1.0 (how many other sources support this claim)
7final_score: weighted average of signals

The weights depend on the research domain. For medical research, venue quality and citation count dominate. For technology trends, recency dominates. The agent should infer appropriate weights from the research question, or use sensible defaults (equal weights as a starting point).

Why not just use citation count? A paper from 2010 with 500 citations may be outdated. A blog post from a domain expert may have zero citations but contain cutting-edge insights. A preprint on arXiv may have groundbreaking results but zero peer review. Single-signal credibility is brittle. Multi-signal scoring captures the nuances that a human researcher intuitively weighs.

Contradiction Tracker

When findings conflict, the agent must track the contradiction explicitly rather than silently picking a side:

 
1Contradiction:
2finding_a: FindingNode
3finding_b: FindingNode
4nature: "direct_conflict" | "scope_difference" | "methodology_difference"
5resolution_strategy: "present_both" | "adjudicate" | "needs_more_evidence"
6resolution_evidence?: FindingNode[]

Nature classification matters: "Paper A says X works, Paper B says X does not work" is a direct conflict. "Paper A says X works for population Y, Paper B says X does not work for population Z" is a scope difference (both can be correct). "Paper A's RCT found X, Paper B's observational study found not-X" is a methodology difference (the RCT typically carries more weight). The agent must classify the contradiction before deciding how to handle it.

State Persistence

A research session lasting 4-8 hours must survive process restarts, network interruptions, and transient failures. The state persistence strategy:

  • Checkpoint frequency: After every sub-question is completed (all sources read, findings recorded, notes taken). Typical interval: every 5-15 minutes.
  • Checkpoint content: The full research graph, working memory, and session metadata (elapsed time, cost so far, sub-questions remaining).
  • Storage: A durable store like PostgreSQL or a cloud object store (S3). Not in-memory only, and not just the LLM conversation history.
  • Recovery: On restart, load the latest checkpoint, rebuild working memory from the research graph, and resume from the last completed sub-question.

Why not just rely on LLM conversation history? Conversation history is a log of what happened, not a structured representation of what was learned. Recovering from a conversation log requires replaying and re-interpreting every turn. The research graph is a queryable, structured knowledge store that supports direct resumption.

Common Pitfall

Checkpoint to durable storage, not just in-memory state. A process crash 4 hours into an 8-hour session should lose at most 15 minutes of work (the last checkpoint interval), not 4 hours.

Interview Tip

Design the research graph as the single source of truth for the session. Everything else (working memory, the final report, contradiction analysis) is derived from the graph.

Question decomposition tree: a complex research question branches into sub-questions, each with source nodes, converging into a synthesis node

The architecture must support long-running, multi-phase research with dynamic decision-making. Two primary patterns apply: hierarchical multi-agent and single-agent with planning. Each has clear trade-offs.

Option 1: Hierarchical Multi-Agent Architecture

Three specialized agents, each with a distinct role:

 
1Planner Agent
2Role: Decomposes the research question, prioritizes sub-questions,
3monitors progress, decides when to stop
4Tools: None (reasoning only, reads the research graph)
5LLM: Frontier model (GPT-4o, Claude Opus) for complex reasoning
6
7Researcher Agent
8Role: Investigates a single sub-question
9Tools: Web search, academic search, PDF reader, web reader, note-taking
10LLM: Mid-tier model (GPT-4o-mini, Claude Sonnet) for cost efficiency
11
12Synthesizer Agent
13Role: Combines findings into a coherent report
14Tools: Citation manager, report generator, note-taking (for querying)
15LLM: Frontier model for high-quality writing

How they interact: The Planner examines the research question and produces an ordered list of sub-questions. It hands each sub-question to a Researcher instance. The Researcher investigates by searching, reading, and taking notes. When all sub-questions are investigated (or the budget is exhausted), the Planner hands the research graph to the Synthesizer, which produces the report.

Advantages: Each agent is specialized and simpler to prompt. The Researcher does not need to understand the big picture; it just investigates its assigned sub-question. The Planner does not need tool-calling capabilities. This separation of concerns makes each agent easier to test and debug independently.

Disadvantages: Communication overhead. The Planner must serialize its plans into a format the Researcher can consume. If the Researcher discovers something that changes the research plan (a new sub-question emerges), it must signal the Planner, which adds coordination complexity. Handoffs between agents can lose context.

Option 2: Single Agent with Plan-Search-Synthesize Loop

One agent with all capabilities, running in a loop:

 
1while not done:
21. PLAN: Review current state, decide next action
32. ACT: Execute the chosen action (search, read, note)
43. OBSERVE: Process results, update research graph
54. REFLECT: Assess progress, decide if sub-question is answered
65. SYNTHESIZE (if all sub-questions answered): Generate report

Advantages: No coordination overhead. The agent has full context of the research state at every step. When it discovers something surprising during step 2, it can immediately adjust its plan in step 1 of the next iteration. This is more natural for the kind of fluid reasoning that research requires.

Disadvantages: A single prompt must handle planning, searching, reading, note-taking, and synthesis. The prompt becomes complex and the agent may confuse roles. Longer conversation history as everything happens in one thread. Harder to parallelize (the hierarchical approach can run multiple Researchers concurrently).

Use the hierarchical structure for organization but give the Researcher agent enough autonomy to adjust its own plan:

 
1Planner Agent
2|
3+-- decomposes into sub-questions
4|
5+-- Researcher Agent (per sub-question)
6| |
7| +-- plan-search-read-note loop
8| +-- can spawn child sub-questions (reported back to Planner)
9| +-- signals completion or "needs more guidance"
10|
11+-- Planner re-evaluates after each Researcher completes
12|
13+-- Synthesizer Agent (once research phase ends)
14|
15+-- reads research graph
16+-- generates report with citations
17+-- flags uncited claims for review

The Researcher reports back to the Planner when it finishes or when it discovers something that changes the research scope. The Planner can then adjust the plan (add new sub-questions, reprioritize, or declare research complete). This balances specialization with adaptability.

Context Window Management

A research session generates far more content than any context window can hold. The management strategy:

  • Planner context: Research question + decomposition tree + per-sub-question status summaries. Roughly 2,000-5,000 tokens. Small and stable.
  • Researcher context: Current sub-question + search history + recent findings + relevant notes from other sub-questions. Roughly 8,000-15,000 tokens. Refreshed when switching sub-questions.
  • Synthesizer context: Research question + all sub-question summaries + contradiction tracker + citation list. Roughly 10,000-30,000 tokens. For long reports, synthesize section by section rather than all at once.

The key principle: never put the entire research graph in the context window. Always query it for specific information.

Parallelization

Some sub-questions are independent and can be researched concurrently. The Planner identifies parallelizable sub-questions from the decomposition:

  • Independent: "What are the environmental impacts of lithium mining?" and "What are the recycling rates for lithium batteries?" can be researched in parallel.
  • Dependent: "What alternative battery chemistries exist?" depends on understanding current lithium battery limitations first.

Running 3-5 Researcher agents in parallel can cut session time by 60-70%. The trade-off is higher concurrent API costs and more complex coordination (the Planner must merge results and check for cross-sub-question contradictions).

Interview Tip

Use a cheaper mid-tier model for Researcher agents and reserve the frontier model for the Planner and Synthesizer. The Researcher makes many routine search-read-note decisions where a cheaper model suffices, saving 60-70% on LLM costs.

Key Insight

The hybrid architecture mirrors how research teams work: a lead researcher (Planner) defines the questions, junior researchers (Researcher agents) investigate them, and a writer (Synthesizer) produces the report. Each role has different skills and autonomy levels.

Research session timeline: a 2-hour session progresses through decomposition, sub-question research, synthesis, and report generation

The agent executes several distinct flows during a research session. Each flow has clear entry conditions, steps, and exit conditions.

Flow 1: Question Decomposition

Entry: User submits a research question. The Planner has the full question and any user-specified constraints (scope, time budget, depth).

 
11. Classify question complexity:
2- Simple (1-2 sub-questions): "What is quantum annealing?"
3- Moderate (3-7 sub-questions): "Compare quantum annealing vs gate-based quantum computing"
4- Complex (8-20+ sub-questions): "Assess quantum computing's viability for drug discovery"
52. Generate initial decomposition (tree or DAG):
6- Each sub-question has: text, priority, estimated research time, dependencies
73. Identify parallelizable groups:
8- Independent sub-questions that share no dependencies
94. Allocate budget per sub-question:
10- Higher priority = larger share of time and cost budget
115. Output: Ordered sub-question list with dependencies and budgets

Tree vs DAG decomposition: A tree decomposition assumes each sub-question is independent. A DAG (directed acyclic graph) allows sub-questions to share dependencies. Example: "Compare A vs B vs C" decomposes into "Research A," "Research B," "Research C," and "Compare A, B, C." The comparison depends on all three research tasks. A tree would not capture this dependency; a DAG does.

When to re-decompose: If a Researcher discovers that a sub-question is much broader than expected (e.g., "Research protein folding methods" reveals 5 distinct approaches where 2 were expected), the Planner may re-decompose, adding new sub-questions and redistributing the budget.

Flow 2: Sub-Question Research

Entry: Researcher receives a sub-question with its budget allocation.

 
11. Formulate search queries:
2- Generate 2-4 diverse queries from the sub-question
3- Include both general and specific phrasings
42. Execute parallel searches:
5- Web search (2-3 queries)
6- Academic search (1-2 queries)
73. Triage results:
8- Read titles and snippets/abstracts
9- Score relevance (0-1 based on how directly the result addresses the sub-question)
10- Rank and select top 5-10 sources for full reading
114. Deep read selected sources:
12- Download PDFs or fetch web pages
13- Extract key findings, claims, and data points
14- Record source metadata in citation manager
155. Take notes:
16- Summarize findings per source
17- Tag findings by theme
18- Note confidence level (well-supported claim vs single-source claim)
196. Check for contradictions:
20- Compare findings across sources
21- Flag any disagreements for the contradiction tracker
227. Assess completeness:
23- Does the evidence sufficiently answer the sub-question?
24- If not, formulate new search queries (back to step 1)
25- If yes, mark sub-question as "researched"

The completeness check is critical: Without it, the agent either stops too early (insufficient evidence) or never stops (always finding one more source to read). The heuristic: a sub-question is sufficiently researched when (a) at least 3 independent sources agree on the main findings, (b) the agent has not found new information in the last 2 search iterations, or (c) the budget for this sub-question is exhausted.

Level Expectations

Junior: focus on how to search.

Senior: focus on when to stop searching. Defining clear stopping criteria is what prevents a research session from running forever.

Flow 3: Source Credibility Assessment

Entry: The agent has retrieved a source and needs to decide how much to trust it.

 
11. Extract metadata signals:
2- Publication venue (journal, conference, preprint server, blog)
3- Citation count (for academic papers)
4- Author credentials (affiliations, h-index, past publications)
5- Publication date
62. Assess source type:
7- Peer-reviewed journal article: high base credibility
8- Conference paper: high base credibility
9- Preprint (arXiv, bioRxiv): moderate (not yet peer-reviewed)
10- News article: moderate (journalistic standards but not peer-reviewed)
11- Blog post: low base credibility (but domain expert blogs can be high)
12- Wikipedia: low for citations but useful for background context
133. Check corroboration:
14- Do other sources in the research graph support or contradict this source?
15- A finding supported by 3 independent sources is more credible than one from a single source
164. Compute composite credibility score:
17- Weighted combination of all signals
18- Store with the source node in the research graph
195. Flag low-credibility sources:
20- Sources scoring below 0.3 are noted but not used for primary claims
21- Sources scoring 0.3-0.6 are used with caveats
22- Sources scoring above 0.6 are used as primary evidence

Flow 4: Contradiction Resolution

Entry: The contradiction tracker has flagged two or more findings that conflict.

 
11. Classify the contradiction:
2- Direct conflict: same claim, opposite conclusions
3- Scope difference: different populations, time periods, or conditions
4- Methodology difference: different study designs
52. Gather additional evidence:
6- Search specifically for meta-analyses or review papers that address the conflict
7- Look for more recent studies that may have resolved the debate
83. Apply resolution strategy:
9- Scope difference: present both as valid within their scope
10- Methodology difference: weight by methodology strength (RCT > cohort > case study)
11- Direct conflict with credibility gap: note the stronger source's position as primary
12- Direct conflict without clear winner: present both positions with evidence
134. Update the research graph:
14- Mark the contradiction as resolved or "presented as open question"
15- Link the resolution evidence

Flow 5: Report Generation

Entry: The Planner declares the research phase complete (all sub-questions researched or budget exhausted).

 
11. Choose report structure:
2- Thematic: organized by topic/theme (best for broad questions)
3- Chronological: organized by time (best for historical or trend questions)
4- Comparative: organized by alternatives being compared
52. Generate outline:
6- Map sub-questions to report sections
7- Identify the narrative arc (introduction, key findings, analysis, conclusion)
83. Synthesize each section:
9- Pull relevant findings from the research graph
10- Write prose that connects findings into a coherent narrative
11- Inline citations for every factual claim
124. Handle contradictions:
13- Dedicate a subsection or callout to conflicting evidence
14- Present both sides with credibility analysis
155. Generate bibliography:
16- Format all cited sources using the citation manager
17- Verify every inline citation maps to a bibliography entry
186. Quality check:
19- Run uncited claim detection
20- Check citation coverage (every section should have citations)
21- Verify report length is within expected range
Interview Tip

The report generation flow should be iterative, not single-pass. Generate a draft, check for gaps, fill them with targeted searches if budget allows, then finalize.

Source credibility pipeline: each source is scored across venue quality, recency, citation count, and cross-reference verification
Contradiction resolution: the agent compares source credibility scores and presents both perspectives with context

The reasoning layer is what separates a research agent from a search engine. Search engines find documents. Research agents find answers. The reasoning layer decides what to search for, evaluates what it finds, and synthesizes findings into knowledge.

Question Decomposition Strategies

The first reasoning task: break a complex question into manageable sub-questions. Two strategies apply, and the choice matters.

Tree decomposition: Each sub-question is independent. "Compare A and B" becomes "What is A?" and "What is B?" and "How do A and B compare?" Simple to implement and easy to parallelize. Fails when sub-questions have shared context. If understanding A changes how you investigate B, a tree misses that dependency.

DAG decomposition: Sub-questions can have dependencies. "Compare A and B" becomes "What is A?" (independent), "What is B?" (independent), "What are the evaluation criteria?" (independent), and "Compare A and B on these criteria" (depends on all three). More complex to implement but captures the real structure of research questions.

When to use which: For survey-style questions ("What are the current approaches to X?"), a tree works fine because each approach can be researched independently. For analytical questions ("Why does X outperform Y?"), use a DAG because the comparison depends on understanding both X and Y first.

Decomposition depth: Limit initial decomposition to 2 levels. A question produces 3-7 sub-questions, each of which may produce 1-3 sub-sub-questions during research. Deeper decomposition before any research is speculative; the agent does not know enough to decompose further. Let the Researcher agents discover additional depth as they investigate.

When to Stop Researching

The hardest reasoning decision: when is enough evidence enough? Four signals guide this:

  • Saturation: The last 2-3 searches returned no new information. The agent is seeing the same findings from different sources. This is diminishing returns.
  • Convergence: Multiple independent sources agree on the key findings. The evidence base is stable.
  • Budget exhaustion: The time or cost budget for this sub-question is spent. Deliver what you have.
  • Coverage threshold: The agent has found evidence addressing at least 80% of the aspects it identified during decomposition.

The agent should weight these signals. Saturation plus convergence is a strong stop signal even if budget remains. Budget exhaustion forces a stop even without saturation. The Planner uses these signals to decide whether to allocate remaining budget to other sub-questions or move to synthesis.

The rabbit hole problem: Without stopping heuristics, the agent will keep researching indefinitely. Each paper cites 20 more papers. Each search returns new angles. The agent must resist the temptation to follow every thread. The budget allocation per sub-question is the primary defense: when the budget runs out, the agent wraps up regardless of how many interesting threads remain.

Source Credibility Assessment

Credibility is not binary. The agent must reason about degree of trust using multiple signals:

  • Citation count (academic papers): A paper with 500 citations has been vetted by the research community. But normalize by field and age. A 2024 machine learning paper with 50 citations is more impressive than a 2010 biology paper with 50 citations.
  • Publication venue: Nature, Science, top conferences (NeurIPS, ACL) carry higher credibility than predatory journals. For web sources, established outlets (NYT, BBC, domain-specific authorities) carry more weight than anonymous blogs.
  • Recency: In fast-moving fields, a 2024 source may invalidate a 2020 source. In established fields (history, mathematics), older sources may be canonical.
  • Author reputation: Researchers with high h-index or known expertise carry more weight. For web sources, named authors with verifiable credentials carry more weight than anonymous content.
  • Corroboration: Does this finding appear in multiple independent sources? A claim supported by one source is a hypothesis. A claim supported by five independent sources is well-established.

The corroboration trap: Five sources that all cite the same original study are not five independent confirmations. They are one study with four echoes. The agent must trace citation chains to distinguish genuine corroboration from circular citation.

Handling Contradictions

When sources disagree, the agent has three strategies:

Present both sides: For genuine debates where experts disagree, present both positions with their evidence and credibility assessments. Do not pick a winner. Let the reader decide. Example: "Study A (N=500, RCT) found X effective. Study B (N=200, cohort) found no effect. The RCT provides stronger evidence, but the smaller cohort study may reflect real-world conditions better."

Adjudicate by evidence strength: When one position has clearly stronger evidence (more studies, better methodology, more recent data), state the stronger position as primary and note the weaker contrary evidence. This is appropriate when the evidence imbalance is clear.

Flag as unresolved: When the evidence is balanced and the question is genuinely open, say so explicitly. "Current evidence is inconclusive. Two large-scale studies reached opposite conclusions, and no meta-analysis has resolved the disagreement."

The worst thing the agent can do is silently pick one side without acknowledging the other. A human researcher would note the disagreement. The agent must do the same.

Synthesis Strategies

Converting raw findings into a coherent narrative requires choosing a strategy:

Thematic synthesis: Group findings by topic. Best for broad research questions. "Current approaches to renewable energy" would be organized by energy type (solar, wind, nuclear, etc.) with cross-cutting themes (cost, scalability, environmental impact) addressed within each section or in a dedicated comparison section.

Chronological synthesis: Organize by time. Best for evolution or trend questions. "How has machine learning progressed from 2020 to 2025?" traces the development arc, with each time period covering the key advances and their significance.

Argumentative synthesis: Present a thesis supported by evidence. Best for evaluative questions. "Is remote work more productive than office work?" would present the evidence for and against, analyze its quality, and reach a nuanced conclusion.

The agent should choose the synthesis strategy based on the question type. The Planner can determine this during decomposition and pass it to the Synthesizer as a parameter.

Key Insight

The circular citation trap is one of the most subtle failure modes. Five blog posts all citing the same original study look like strong corroboration until you trace the citations. Always check whether 'independent' sources share a common original source.

A research agent that crawls the web and reads documents must operate within clear safety boundaries. Unlike a Q&A agent confined to an internal knowledge base, the deep research agent touches external systems and produces content that may be widely shared.

API Rate Limiting

Every external API has rate limits, and exceeding them can get your API key banned, not just throttled. The rate limiting strategy must be proactive, not reactive:

  • Google Custom Search API: 100 queries/day free, then $5 per 1,000. Hard limit: 10,000/day. The agent must track daily usage across all sessions.
  • Semantic Scholar API: 100 requests per 5 minutes for unauthenticated, 1,000 per 5 minutes with an API key. Per-session, this means spacing academic searches by at least 300ms.
  • arXiv API: 1 request per 3 seconds (they will block aggressive crawlers). The agent must include a 3-second delay between arXiv calls.
  • LLM APIs: Rate limits vary by tier. GPT-4o typically allows 500-10,000 RPM depending on your plan. Monitor token usage per session to stay within budget.

Implementation: Use a global rate limiter (token bucket algorithm) shared across all agent instances. Each tool call checks the rate limiter before executing. If the limit is reached, the tool returns a "rate limited" status and the agent uses cached results, tries an alternative API, or waits.

Respecting Robots.txt and Terms of Service

The web page reader must check robots.txt before fetching any page. This is not optional. Sites that disallow crawling must be skipped, and the agent should note the gap in its research notes ("Source X was not accessible due to robots.txt restrictions").

Terms of Service compliance: Some academic databases and websites prohibit automated access even when robots.txt allows it. The agent should use official APIs (Semantic Scholar, arXiv) rather than scraping search result pages. For web content, prefer API access (when available) over raw HTML scraping.

Citation and Plagiarism Prevention

The agent must never present source text as its own writing. Every claim must be either (a) a direct quote with citation, (b) a paraphrase with citation, or (c) original synthesis that explicitly references the cited evidence.

Implementation safeguards:

  • The report generator runs a plagiarism check that compares each paragraph against the source texts using character-level n-gram overlap. If overlap exceeds 30% with any single source, flag for paraphrasing.
  • Every factual claim in the report must map to at least one citation. The uncited claims detector catches violations.
  • Direct quotes must be marked with quotation marks and the exact source page or section.

Handling Misinformation and Biased Sources

The web contains misinformation, propaganda, and heavily biased content. The agent needs defenses:

  • Source diversity requirement: No more than 40% of citations from a single domain. This prevents the agent from building a report based entirely on one perspective.
  • Known misinformation domains: Maintain a blocklist of domains known for unreliable content. This list needs periodic updates.
  • Bias detection heuristics: Flag sources that use emotional language, make claims without evidence, or are funded by parties with a conflict of interest. These sources can still be cited but should be noted with caveats.
  • Cross-referencing as defense: The credibility scoring system naturally downweights claims that only appear in low-credibility sources. If a claim appears only on biased sites and never in peer-reviewed literature or reputable media, it should be flagged as unreliable.

Cost Controls for Long-Running Sessions

An 8-hour session without cost controls could spend hundreds of dollars on LLM calls. The cost management system:

  • Per-session budget: Set before the session starts. Default: $15. The agent tracks cumulative cost after every tool call and LLM invocation.
  • Warning threshold: At 75% of budget, the Planner stops opening new sub-questions and focuses on completing in-progress ones and moving to synthesis.
  • Hard stop: At 95% of budget, the agent stops all research and begins immediate synthesis with available findings.
  • Cost breakdown in report: The final report includes a metadata section showing total cost, LLM calls, search queries, and sources consulted. Transparency builds trust.

Data Privacy

The agent may encounter personally identifiable information (PII) in web pages or documents. The agent must not include PII in the report unless the information is already public and relevant to the research question. For example, citing a named researcher's published work is fine. Including someone's personal email found on a leaked document is not.

Key Insight

Rate limiting is not just politeness. Getting your API key banned mid-session means losing hours of research progress. A proactive rate limiter is reliability infrastructure, not just compliance.

A research session runs for hours and involves hundreds of tool calls and reasoning steps. Without observability, you cannot tell if the agent is doing good research or spinning its wheels. Every metric should answer a specific question about agent quality.

Session-Level Metrics

These metrics evaluate the overall quality of a research session:

Sources consulted per sub-question: How broad was the agent's search? Target: 5-15 sources per sub-question. Below 5 suggests shallow research. Above 15 may indicate the agent is not filtering effectively.

Research depth (sub-questions generated): How thoroughly did the agent decompose the question? Track both initial decomposition and researcher-discovered sub-questions. A complex question with only 2 sub-questions was under-decomposed. A simple question with 20 sub-questions was over-decomposed.

Citation coverage: What percentage of factual claims in the report are cited? Target: 95%+. Below 90% indicates the synthesis step is introducing unsupported claims.

Contradiction rate: What fraction of findings had contradictions? A rate of 10-20% is normal for complex topics. Below 5% may indicate the agent is only finding one perspective (filter bubble). Above 30% may indicate the topic is highly contested or the agent is pulling from unreliable sources.

Source diversity score: How concentrated are citations across domains? Measured using the Herfindahl-Hirschman Index (HHI) across citation domains. Lower HHI means more diverse sources.

Time and cost per session: Total wall-clock time, total LLM token cost, total API call cost. These establish baselines for budget setting.

Step-Level Metrics

These metrics evaluate individual reasoning and tool steps:

Search effectiveness: For each search query, how many of the top-10 results were actually read, and how many of those contributed findings to the research graph? A search where 0 out of 10 results were relevant indicates a poor query formulation.

Relevance filter accuracy: Of the sources the agent decided not to read (filtered out at the triage step), how many were actually relevant? This requires periodic sampling and human review.

Note quality: Are the agent's notes capturing the key information? Measure by checking whether the notes contain sufficient information to reproduce the final report's claims without re-reading the original sources.

Quality Metrics

These require human evaluation or automated proxy measures:

Report quality dimensions:

 
1Accuracy: Do claims match the cited sources? (automated: NLI check)
2Completeness: Does the report cover all major aspects? (human review)
3Coherence: Does the report read as a unified narrative? (human review)
4Balance: Are multiple perspectives represented? (automated: source diversity)
5Usefulness: Would a researcher find this report valuable? (human review)

Comparison to human researcher: For calibration, have human researchers answer the same questions and compare output quality. This is expensive but provides the ground truth for evaluating whether the agent is actually useful.

Alerting

Not every metric needs an alert. Focus on actionable signals:

  • Session stalled: No new findings added to the research graph for 15+ minutes. The agent may be stuck in a loop.
  • Cost spike: Per-minute cost exceeds 3x the session average. The agent may be making excessive LLM calls.
  • Citation coverage drop: A completed report has <90% citation coverage. Quality problem.
  • Source concentration: More than 50% of citations from a single domain. Bias risk.
  • Zero-result searches: 3+ consecutive searches return no relevant results. The agent's query formulation may need adjustment.
Common Pitfall

A low contradiction rate (below 5%) on a complex topic is a red flag, not a sign of quality. It usually means the agent is only finding one perspective. Alert on suspiciously low contradiction rates just as you would alert on high ones.

Logging and Tracing

Every step in the session should be logged with enough context for post-hoc analysis:

 
1LogEntry:
2session_id: string
3timestamp: ISO-8601
4step_type: "plan" | "search" | "read" | "note" | "synthesize"
5sub_question_id: string
6input: object (tool input or reasoning prompt)
7output: object (tool output or reasoning result)
8cost: { tokens_in: number, tokens_out: number, api_cost: float }
9duration_ms: number

This enables a full audit trail: given a claim in the report, you can trace back through the logs to see which sources supported it, which searches found those sources, and which reasoning steps led to those searches.

Interview Tip

The most valuable observability feature is the session replay: a chronological view of every decision the agent made, with costs and outcomes. This is how you debug research quality and improve the agent over time.

Long-running agent sessions have failure modes that short-lived agents never encounter. Understanding these failures is essential for building a reliable system.

The Rabbit Hole Problem

The agent researches a tangential topic in excessive depth, consuming budget without contributing to the main question. Example: researching "effects of climate change on agriculture" leads to a sub-question about soil carbon sequestration, which leads to microbial ecology, which leads to metagenomic sequencing techniques. Fascinating, but irrelevant to the original question.

Detection: Monitor the semantic similarity between the current sub-question and the original research question. If similarity drops below a threshold (e.g., 0.3 cosine similarity between the current sub-question embedding and the original question embedding), the agent has wandered.

Recovery: The Planner periodically checks whether in-progress sub-questions are still relevant. If a Researcher has drifted, the Planner terminates that investigation, saves whatever useful findings exist, and redirects the budget to remaining on-topic sub-questions.

Prevention: Each sub-question has a maximum depth (number of derived sub-sub-questions) and a maximum budget. Hard limits prevent any single thread from consuming disproportionate resources.

Source Bias (Filter Bubble)

The agent only finds one perspective because its search queries are too narrow or its source selection is biased toward one type of source.

Detection: Source diversity metrics (HHI score) and contradiction rate. A very low contradiction rate on a topic known to be controversial is a warning sign.

Recovery: When source diversity is low, the agent should explicitly search for opposing viewpoints. Queries like "criticism of X" or "arguments against X" or "X controversy" help break the filter bubble. The agent can also search in different databases (if it has been using only web search, try academic search, and vice versa).

Prevention: The Planner includes "counter-evidence search" as a standard step for every sub-question. After finding initial evidence, the agent explicitly searches for contradicting evidence before marking a sub-question as complete.

API Rate Limits Stopping Research Mid-Session

The agent hits a rate limit 3 hours into a session. If it simply stops, 3 hours of work are partially wasted.

Detection: Rate limit errors from API calls (HTTP 429 or provider-specific error codes).

Recovery strategy (tiered):

  • Tier 1 (immediate): Switch to a backup API. If Semantic Scholar is rate-limited, use arXiv or Google Scholar.
  • Tier 2 (short-term): Pause that tool and continue with other tools. If search is rate-limited, the agent can still read already-discovered pages and synthesize existing findings.
  • Tier 3 (medium-term): If the rate limit has a known reset time, schedule a resume. Checkpoint the state and continue after the cooldown.
  • Tier 4 (last resort): Synthesize with what you have. A partial report is better than no report.

Context Window Overflow During Synthesis

The research graph is too large to fit in the synthesis context window, even with summarization.

Detection: Token count estimation before the synthesis LLM call. If the input exceeds the model's context limit, do not attempt the call.

Recovery: Hierarchical synthesis. First synthesize each sub-question's findings into a 500-word summary. Then synthesize the summaries into the final report. For very large research sessions, add a third level: synthesize related sub-question summaries into theme summaries first.

Prevention: The Researcher agents should produce concise notes during research, not dump raw source text into the graph. If notes are well-written, synthesis can work from notes rather than raw findings.

Circular Citations

The agent discovers that multiple "independent" sources are actually citing the same original study, inflating the apparent evidence base.

Detection: Build a citation graph from the references in each source. If multiple sources share the same references and do not add independent data, they are echoes, not corroboration.

Recovery: Collapse the echo chamber into a single evidence source. The credibility score should reflect the original study's quality, not the number of sources that cited it. Note in the report that the finding rests on a single original study despite appearing in multiple secondary sources.

Key Insight

The rabbit hole problem is the most common failure mode in practice. Budget caps are necessary but not sufficient. The Planner must actively monitor relevance drift and terminate wandering investigations before they consume significant resources.

Diminishing returns: the agent stops researching when consecutive sources add no new information

Evaluating a research agent is fundamentally harder than evaluating a Q&A agent. A Q&A agent has a single correct answer per question. A research agent produces a complex document that must be assessed on multiple dimensions.

Evaluation Dimensions

Citation accuracy: Does each citation correctly support the claim it is attached to? Automated check: use an NLI (natural language inference) model to verify that the cited source entails the claim. This catches misattributed citations and citations that do not actually support the stated claim.

Coverage completeness: Does the report address all major aspects of the research question? This requires human evaluation or a rubric-based LLM evaluation where an evaluator LLM checks the report against a list of expected topics.

Factual accuracy: Are the claims in the report actually true? This is the hardest to evaluate at scale. For calibration, use questions where the answers are well-established and compare the agent's claims against known facts.

Synthesis quality: Does the report add value beyond listing individual findings? Good synthesis connects findings, identifies themes, and draws conclusions. Poor synthesis is a list of summaries.

Contradiction handling: Are conflicting sources identified and presented fairly? Check whether the report mentions known controversies in the field and whether it presents multiple perspectives.

Comparison to Human Researcher Output

The gold standard evaluation: give the same research question to both the agent and a human researcher. Compare outputs on all dimensions above. This is expensive (human researchers cost $50-200 per question) but provides irreplaceable calibration data.

Expected differences: The agent will typically have broader coverage (it can read more sources faster) but shallower analysis (a human researcher brings domain intuition and critical thinking). The agent will have better citation discipline (every claim cited) but may miss nuanced implications that a domain expert would catch.

When the agent should outperform: Breadth of coverage, speed, citation completeness, and consistency across sessions. When the human should outperform: depth of analysis, novel insights, judgment calls on contradictory evidence, and understanding of real-world context.

Automated Evaluation Pipeline

For continuous improvement, run a nightly evaluation pipeline:

  • Test questions: A curated set of 20-50 research questions across domains, with expert-created rubrics specifying expected topics, expected sources, and known controversies.
  • Metrics computed: Citation accuracy (NLI-based), coverage score (rubric match), source diversity (HHI), contradiction detection rate, and cost per session.
  • Regression detection: Alert when any metric drops more than 10% from the 7-day moving average.

Future Directions

Multi-modal research: Extend the agent to analyze images, charts, and tables in papers. Many scientific findings are presented in figures that the current text-only agent cannot process. Adding vision capabilities (GPT-4o, Claude with vision) would let the agent extract data from charts and understand diagrams.

Collaborative research: Multiple users contribute to the same research session. One user starts a research question, another adds constraints or redirects the investigation. This requires real-time collaboration features (shared research graph, conflict resolution for simultaneous edits).

Domain-specific fine-tuning: A research agent specialized in biomedical literature versus one specialized in computer science would use different credibility signals, different decomposition strategies, and different synthesis conventions. Domain specialization through fine-tuning or domain-specific prompting could significantly improve quality.

Live knowledge integration: Instead of searching for existing knowledge, the agent could integrate with live data sources (clinical trial registries, patent databases, regulatory filings) to provide real-time research that is always current.

Iterative refinement with user feedback: After delivering the initial report, the user provides feedback ("go deeper on section 3" or "you missed the regulatory angle"). The agent resumes the session, focused on the feedback, and produces a revised report. This transforms research from a one-shot process into an iterative dialogue.

Interview Tip

Start evaluation with human comparison on 10 questions across different domains. This initial calibration reveals the agent's strengths and weaknesses more clearly than any automated metric.

Try this problem yourself

Reading a solution is not the same as producing one under interview pressure. Design it on the whiteboard and get scored feedback.


Markdown supported

0%

Editorial Solution

Agent requirements

Why an Agent and Not a Pipeline?

Agent Objective

Autonomy and Constraints

Scale and Session Characteristics

Cost and Budget Management

Tool & action design

Tool Inventory

Tool Selection Strategy

Memory & state design

The Research Graph

Working Memory

Source Credibility Scoring

Contradiction Tracker

State Persistence

Agent architecture

Option 1: Hierarchical Multi-Agent Architecture

Option 2: Single Agent with Plan-Search-Synthesize Loop

Recommended Architecture: Hybrid

Context Window Management

Parallelization

Execution flows

Flow 1: Question Decomposition

Flow 2: Sub-Question Research

Flow 3: Source Credibility Assessment

Flow 4: Contradiction Resolution

Flow 5: Report Generation

Core reasoning design

Question Decomposition Strategies

When to Stop Researching

Source Credibility Assessment

Handling Contradictions

Synthesis Strategies

Safety & permission model

API Rate Limiting

Respecting Robots.txt and Terms of Service

Citation and Plagiarism Prevention

Handling Misinformation and Biased Sources

Cost Controls for Long-Running Sessions

Data Privacy

Observability & monitoring

Session-Level Metrics

Step-Level Metrics

Quality Metrics

Alerting

Logging and Tracing

Failure modes & recovery

The Rabbit Hole Problem

Source Bias (Filter Bubble)

API Rate Limits Stopping Research Mid-Session

Context Window Overflow During Synthesis

Circular Citations

Evaluation & future

Evaluation Dimensions

Comparison to Human Researcher Output

Automated Evaluation Pipeline

Future Directions

Table of Contents

Agent requirements

Why an Agent and Not a Pipeline?

Agent Objective

Autonomy and Constraints

Scale and Session Characteristics

Cost and Budget Management

Tool & action design

Tool Inventory

Tool Selection Strategy

Memory & state design

The Research Graph

Working Memory

Source Credibility Scoring

Contradiction Tracker

State Persistence

Agent architecture

Option 1: Hierarchical Multi-Agent Architecture

Option 2: Single Agent with Plan-Search-Synthesize Loop

Recommended Architecture: Hybrid

Context Window Management

Parallelization

Execution flows

Flow 1: Question Decomposition

Flow 2: Sub-Question Research

Flow 3: Source Credibility Assessment

Flow 4: Contradiction Resolution

Flow 5: Report Generation

Core reasoning design

Question Decomposition Strategies

When to Stop Researching

Source Credibility Assessment

Handling Contradictions

Synthesis Strategies

Safety & permission model

API Rate Limiting

Respecting Robots.txt and Terms of Service

Citation and Plagiarism Prevention

Handling Misinformation and Biased Sources

Cost Controls for Long-Running Sessions

Data Privacy

Observability & monitoring

Session-Level Metrics

Step-Level Metrics

Quality Metrics

Alerting

Logging and Tracing

Failure modes & recovery

The Rabbit Hole Problem

Source Bias (Filter Bubble)

API Rate Limits Stopping Research Mid-Session

Context Window Overflow During Synthesis

Circular Citations

Evaluation & future

Evaluation Dimensions

Comparison to Human Researcher Output

Automated Evaluation Pipeline

Future Directions