Skip to content

Latest commit

Β 

History

69 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AutoResearcher

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)

1. Backend setup

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 keys

Your .env needs:

GROQ_API_KEY=...
TAVILY_API_KEY=...

Run the API:

uvicorn main:app --reload --port 8000

Health check: GET http://localhost:8000/api/health β†’ {"status": "ok"}

The original CLI pipeline still works unchanged: python pipeline.py.

2. Frontend setup

cd frontend
npm install
cp .env.example .env             # defaults to http://localhost:8000, change if needed
npm run dev

Open 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.

How the streaming works

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.

Notes / things fixed while wrapping this

  • agents.py had load_dotenv without calling it (load_dotenv()), so the .env file was never actually being read. Fixed.
  • tools.py had a module-level print(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:5173 in main.py β€” update allow_origins there before deploying anywhere else.

About

πŸ” AI-powered multi-agent research platform that automates web research through Search, Reader, Writer, and Critic agents with real-time streaming.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages