A multi-agent pipeline for intelligent, automated web research.
A 4-agent research pipeline (search β read β write β critique) wrapped in a FastAPI backend that streams live progress over SSE, with a React + Tailwind glassmorphism frontend that visualizes the pipeline as it runs. Powered by Groq and Llama 3!
research-pipeline/
βββ backend/ FastAPI app + your original LangChain agents/chains
β βββ agents.py (your agent/chain definitions β small bug fixes only)
β βββ tools.py (your web_search / scrape_url tools)
β βββ pipeline.py (your original CLI pipeline, unchanged in spirit)
β βββ pipeline_stream.py (generator version of the pipeline β yields an event per step)
β βββ main.py (FastAPI app, exposes GET /api/research as an SSE stream)
β βββ requirements.txt
βββ frontend/ Vite + React + Tailwind UI
βββ src/components/ (AgentNode, PipelineFlow, ReportPanel, CriticPanel, etc.)
βββ src/App.jsx (wires the UI to the SSE stream)
cd backend
python -m venv .venv
source .venv/bin/activate # .venv\Scripts\activate on Windows
pip install -r requirements.txt
cp .env.example .env # then fill in your real keysYour .env needs:
GROQ_API_KEY=...
TAVILY_API_KEY=...
Run the API:
uvicorn main:app --reload --port 8000Health check: GET http://localhost:8000/api/health β {"status": "ok"}
The original CLI pipeline still works unchanged: python pipeline.py.
cd frontend
npm install
cp .env.example .env # defaults to http://localhost:8000, change if needed
npm run devOpen the printed local URL (usually http://localhost:5173). Type a topic,
hit Run research, and watch the four agent nodes light up live as the
backend streams each step.
GET /api/research?topic=... is a Server-Sent Events stream. The blocking
LangChain .invoke() calls run in a background thread so the FastAPI event
loop stays responsive; each completed step gets pushed onto a queue and
streamed to the browser as a small JSON event:
{"step": "search", "status": "complete", "data": "..."}The frontend listens with the native EventSource API β no extra library
needed for the streaming itself.
agents.pyhadload_dotenvwithout calling it (load_dotenv()), so the.envfile was never actually being read. Fixed.tools.pyhad a module-levelprint(web_search.invoke(...)), which fired a real Tavily search every time the module was imported (including on every backend auto-reload). Removed.- CORS is currently locked to
localhost:5173inmain.pyβ updateallow_originsthere before deploying anywhere else.