Multi-Agent AI Research System
A team of AI agents that researches any topic on the web, writes a structured report and reviews its own work.
The agents, tools, pipeline and feedback loop are my work, with AI help in places; the Streamlit interface was built with AI help.
- Status
- Live
- Stack
- LangChain, create_agent, LCEL, Groq, Tavily, BeautifulSoup, Pydantic, Streamlit, uv
- steps: search agent, reader agent, writer and critic
- 4
- critic score below which the report is rewritten once with its feedback
- 7/10
- critic score on the sample report (Claude Fable 5.2), so no rewrite was needed
- 8/10
Screens
How it fits together
- Topic
- Search agent (Tavily)
- Reader agent
- Writer chain
- Critic, 1 to 10
- 7+: final report
- Below 7: rewrite
A search agent finds sources with Tavily, a reader agent pulls the key facts from the best pages with BeautifulSoup, a writer turns them into a Markdown report and a critic scores it from 1 to 10 with Pydantic structured output. A report that scores below 7 is rewritten once with the critic's feedback. Built with LangChain (create_agent and LCEL chains) on Groq's gpt-oss models, with a Streamlit interface.
The problem
Researching a topic by hand means searching, choosing the right pages, taking notes, writing it up and then checking the write-up. This project splits those jobs between agents, and adds a reviewer that can send a weak report back.
How it was built
- Search agent: LangChain create_agent with a Tavily web_search tool. The model decides what to search, and how often, and returns the five best sources.
- Reader agent: picks the two most useful pages and reads them with a scrape_url tool built on requests and BeautifulSoup, skipping sites that can't be scraped.
- Writer: a fixed LCEL chain (prompt, model, parser) that turns the notes into a Markdown report with an introduction, key findings, analysis, conclusion and sources.
- Critic: an LCEL chain with with_structured_output and a Pydantic schema (score from 1 to 10, strengths, improvements, verdict). Below 7, the writer rewrites the report once with that feedback and the critic reviews it again.
- The rule I followed: if the model needs to decide, use an agent; if the task is fixed, use a chain.
- Groq's free tier limits tokens per minute, so page text is capped and the pipeline reads the wait time from rate-limit errors, waits and retries, up to five times.
- Streamlit interface, built with AI help: live progress for each step, tabs for the report, review, notes and sources, and a download button. Deployed on Streamlit Community Cloud with the API keys in its secrets.
Where it is now
Live on Streamlit Community Cloud. In the sample run on "Claude Fable 5.2" the critic scored the report 8/10, so no rewrite was needed.
Ask about Multi-Agent AI Research System
Answers come from this case study and its code on GitHub.
