Multi-agent AI research system — four specialized agents collaborate to search, scrape, write, and critique a polished research report on any topic.
Built with LangChain, Mistral AI, and Streamlit.
╔══════════════════════════════════════════╗
║ 01 · SEARCH AGENT ║
║ Tavily web search → URLs & snippets ║
╚══════════════════════════════════════════╝
│
▼
╔══════════════════════════════════════════╗
║ 02 · READER AGENT ║
║ BeautifulSoup deep scrape → content ║
╚══════════════════════════════════════════╝
│
▼
╔══════════════════════════════════════════╗
║ 03 · WRITER CHAIN ║
║ Mistral LLM → structured report draft ║
╚══════════════════════════════════════════╝
│
▼
╔══════════════════════════════════════════╗
║ 04 · CRITIC CHAIN ║
║ Mistral LLM → score /10 + feedback ║
╚══════════════════════════════════════════╝
| Step | Agent / Chain | What it does |
|---|---|---|
| 01 Search | build_search_agent() |
Queries Tavily for recent web results (titles, URLs, snippets) on the research topic. |
| 02 Reader | build_reader_agent() |
Picks the most relevant URL from search results and scrapes the full page content via BeautifulSoup. |
| 03 Writer | writer_chain |
Drafts a structured report with introduction, key findings, conclusion, and sources. |
| 04 Critic | critic_chain |
Reviews the report, assigns a score out of 10, lists strengths, areas to improve, and a one-line verdict. |
.
├── app.py # Streamlit web UI
├── pipeline.py # CLI runner (rich terminal output)
├── agents.py # Agent & chain definitions
├── tools.py # web_search + scrape_url LangChain tools
├── pyproject.toml # Project metadata & dependencies
├── requirements.txt # Pip-compatible dependency list
├── .env # API keys (gitignored)
└── .streamlit/
├── config.toml # Streamlit theme/config
└── secrets.toml # Streamlit secrets
git clone <repo-url> && cd deep-research-agentpip install -r requirements.txtOr with uv:
uv syncCreate a .env file in the project root:
MISTRAL_API_KEY=your-mistral-api-key
TAVILY_API_KEY=your-tavily-api-keystreamlit run app.pyOpen http://localhost:8501, enter a research topic, and click Run Research Pipeline. Watch each agent step execute live and get the final report with critic feedback.
python pipeline.pyEnter a topic at the prompt — the pipeline runs all four steps and prints results to the terminal with rich formatting.
| Setting | Where | Default |
|---|---|---|
| LLM model | agents.py |
mistral-small-2603 |
| LLM temperature | agents.py |
0 |
| Search results | tools.py |
max_results=5 |
| Scrape char limit | tools.py |
3000 chars |
| Streamlit theme | .streamlit/config.toml |
Dark theme |
To switch the LLM provider, replace ChatMistralAI in agents.py with any LangChain chat model (OpenAI, Anthropic, Groq, etc.).
- LLM:
langchain,langchain-mistralai - Search:
langchain-tavily - Scraping:
beautifulsoup4,requests - UI:
streamlit - Utils:
python-dotenv,tiktoken,rich