Skip to content

Repository files navigation

Multi-Agent Research Assistant

Ask a research question; four agents split it up, search the web, run analysis code, and hand back a cited Markdown report — with a live Streamlit feed showing each agent working.

The interesting problem here isn't calling an LLM — it's orchestration: how work fans out, how agents share state without stepping on each other, and how citations survive the trip from a search result to the final report.

Architecture

User Query → Planner → [Researcher + Analyst] (parallel) → Writer → Memory → Report
Agent Job
Planner Breaks the query into 3–5 sub-questions and assigns them
Researcher Tavily web search, citation extraction, flags conflicting sources
Analyst Runs Python for the quantitative sub-questions, generates charts
Writer Synthesizes the report with citations and per-claim confidence

Built on LangGraph — the Researcher and Analyst legs genuinely run in parallel, converging on shared state before the Writer starts.

Decisions worth calling out:

  • The Analyst's code runs in a sandboxed subprocess, not exec() in the app process. Generated analysis code gets its own interpreter and a timeout instead of access to the host environment.
  • Citations are state, not strings. Sources travel through the graph as structured objects, so the Writer can't cite something the Researcher never found.
  • ChromaDB memory persists across sessions — earlier research is retrievable instead of being re-searched.
  • Each agent's model is configurable in config.py; the default is gpt-4o-mini everywhere because most of the quality comes from the decomposition, not the model size.

Quick start

pip install -r requirements.txt

cp .env.example .env    # add OPENAI_API_KEY and TAVILY_API_KEY
streamlit run app.py

Tavily's free tier (1,000 searches/month) is plenty for normal use.

Structure

├── app.py             # Streamlit frontend with live agent feed
├── orchestrator.py    # LangGraph workflow — fan-out, join, state
├── models.py          # Pydantic models + shared state definitions
├── config.py          # Env + per-agent model config
├── agents/            # Planner, Researcher, Analyst, Writer
├── tools/             # Tavily search, sandboxed code executor
└── memory/            # ChromaDB vector store

Stack

LangGraph · OpenAI (gpt-4o-mini) · Tavily · ChromaDB · Matplotlib · Streamlit

About

4 AI agents (Planner, Researcher, Analyst, Writer) collaborate over LangGraph to research any topic and produce cited reports — Tavily web search, sandboxed Python execution, ChromaDB memory, live Streamlit UI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages