karthik.dev
Back to projects
AI

Multi-Agent Research Assistant

Autonomous research pipeline using specialized agents for search, synthesis, and citation

TypeScriptNode.jsOpenAI APITavily Search APIMulti-Agent SystemsREST APIs

Overview

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

Problem

Deep research on any topic requires multiple iterations of searching, reading, cross-referencing, and synthesizing — work that's time-consuming for humans and poorly handled by single LLM calls that lack real-time web access.

Solution

A four-agent pipeline with a shared research context object: Planner decomposes the topic → Search fetches live sources → Synthesis extracts claims and evidence → Writer assembles a structured, cited report. 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 each sub-query, retrieving ranked, real-time web results
  3. 3Synthesis Agent reads all search results and extracts key claims, evidence, and source URLs
  4. 4Writer Agent structures extracted knowledge into a sectioned report with inline citations
  5. 5Shared ResearchContext object typed in TypeScript, validated at each agent handoff
  6. 6Orchestrator manages agent sequence and handles retries on structured output validation failures

Technical Challenges

  • Source quality varies significantly — Synthesis Agent must distinguish authoritative sources from low-quality content using domain signals and recency.
  • Agent pipelines can drift — each agent must receive a typed context contract to prevent downstream hallucination from context ambiguity.
  • 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 the orchestrator + specialist-agent pattern applied to information retrieval rather than task automation.