karthik.dev
Back to projects
AI

Multi-Agent Research Assistant

Autonomous research pipeline — Planner, Search, Synthesis, and Writer agents with citations

TypeScriptNode.jsOpenAI APITavily Search APIMulti-Agent SystemsREST APIs

Overview

An autonomous research pipeline where a Planner Agent decomposes a research question, a Search Agent fetches real-time web results via Tavily, a Synthesis Agent extracts relevant information, and a Writer Agent produces a structured report with citations.

Problem

Deep research requires multiple iterations of searching, reading, cross-referencing, and synthesizing — poorly handled by single LLM calls that lack real-time web access.

Solution

A four-agent pipeline with a shared research context object: Planner → Search → Synthesis → Writer. Each agent receives only the context slice it needs.

Architecture

  1. 1Planner Agent decomposes the research question into 3-5 targeted sub-queries
  2. 2Search Agent calls Tavily API for real-time web results
  3. 3Synthesis Agent extracts key claims, evidence, and source URLs
  4. 4Writer Agent structures knowledge into a sectioned report with citations
  5. 5Shared TypeScript ResearchContext validated at each agent handoff
  6. 6Orchestrator manages agent sequence and retries on validation failures

Technical Challenges

  • Source quality varies — Synthesis must distinguish authoritative sources using domain signals and recency.
  • Agent pipelines can drift — typed context contracts prevent downstream hallucination.
  • Cost management: Planner runs on a small model; only Synthesis and Writer use full GPT-4.

Results

  • Produces citation-backed research reports on arbitrary topics in under 2 minutes.
  • Demonstrates orchestrator + specialist-agent pattern applied to information retrieval.