Skip to content
All projects

Multi-Agent Research

A research and report generator built on LangGraph: a supervisor agent routes work between search, analysis and writer agents, streams progress to a Next.js UI over SSE, and stops on step and cost budgets.

Solo full-stack — agent graph, API, UI and VPS deployment

Multi-Agent Research screenshot

Problem

A single prompt gives a shallow answer to a research question. Splitting the work into search, analysis and writing steps gives better reports, but a model choosing its own next step can loop forever and burn credits.

Approach

Built a LangGraph StateGraph where a supervisor picks the next agent with structured output and every agent returns to it. The supervisor is fenced in by plain code: a step budget, an estimated cost cap in ringgit, a hard cap of two search passes, and a heuristic route when the model call fails or returns an invalid choice. A FastAPI backend runs jobs and streams each step to the Next.js UI over server-sent events, and a SQLite checkpointer keeps graph state per thread.

Outcome

Deployed on a VPS behind nginx with basic auth, because every run spends real LLM and search credits. The repo is public with 55 Python tests covering the graph, supervisor routing, tools and API.

Highlights

  • Supervisor routing with guard rails in code: step budget, ringgit cost cap, two-pass search cap, and a heuristic fallback when the model fails
  • Live pipeline view: FastAPI streams each agent step to the UI over server-sent events
  • Checkpointed graph state with LangGraph's SQLite saver
  • Tavily search with a DuckDuckGo fallback, and PDF export of the finished report
  • Dockerised and deployed to a VPS with nginx and basic auth