Critic-Generator Research Agent
Two-agent loop where critic refines search queries and generator synthesizes — disentangled per AgentDisCo pattern
Difficulty: weekend | Stack: Python, LangGraph, Anthropic Claude API, Tavily Search API, SQLite
Who this is for
Researchers and analysts who need coherent long-form synthesis from web search without context-window drift
Build steps
- Define two agent nodes in LangGraph: CriticAgent (receives outline + search history, outputs refined queries + gap analysis) and GeneratorAgent (receives queries, retrieves via Tavily, returns chunks + partial synthesis)
- Wire adversarial loop: Generator runs retrieval → Critic scores relevance and rewrites queries → repeat N rounds or until Critic confidence threshold met
- Store each round’s queries, retrieved chunks, and critic scores in SQLite so the loop is inspectable and restartable
- Add a final Synthesizer pass that merges all approved chunks into structured markdown report
- Build minimal CLI:
research 'topic' --rounds 3 --output report.md
Risks
- Critic and Generator using same base model may converge on same blind spots — use different temperature or system prompts to force divergence
- Tavily costs spike fast with many rounds; cap rounds and chunk deduplication is essential
- LangGraph state graph gets complex quickly — keep critic/generator state schemas flat or serialization bugs appear
Business Angle
Hosted critic-generator research agent that delivers structured synthesis reports from web search — no hallucination spiral, no context drift
Customer: Solo consultant or independent analyst (think: one-person strategy firm, freelance market researcher, PhD student doing lit review) who bills clients for research deliverables and spends 4–8 hours per report chasing sources and synthesizing
Pricing: saas-mrr — $800 MRR in 4 months (16 customers at $49/mo)
Full business breakdown →