A LangChain-powered multi-agent research pipeline that automatically searches the web, reads and extracts content from relevant pages, drafts a structured report, and critiques the final output — all orchestrated through cooperating AI agents.
Live Demo: multi-agent-system-byhimanshi.streamlit.app
This project demonstrates how multiple specialized LLM agents, built with LangChain, can collaborate to complete a complex task end-to-end — turning a simple topic or question into a polished, fact-checked research report.
Instead of relying on a single prompt to do everything, the workload is split across dedicated agents, each responsible for one stage of the pipeline:
- Search Agent — searches the web for recent, relevant content on the given topic
- Reader Agent — visits the top results and scrapes/extracts the actual page content
- Writer Chain — synthesizes the gathered information into a structured report
- Critic Chain — reviews the draft, checks it for gaps or issues, and provides feedback for refinement
The system can be run either as an interactive Streamlit web app or from the command line.
- 🔍 Automated web research using an LLM-driven search agent
- 📄 Automatic content extraction from web pages
- ✍️ AI-generated, structured research reports
- 🧐 Built-in critique step for quality review of the final output
- 🌐 Simple, interactive Streamlit UI
- 🖥️ CLI pipeline mode for running the full flow from the terminal
User Query
│
▼
┌─────────────────┐
│ Search Agent │ → finds relevant URLs on the web
└────────┬─────────┘
▼
┌─────────────────┐
│ Reader Agent │ → scrapes & extracts content from those URLs
└────────┬─────────┘
▼
┌─────────────────┐
│ Writer Chain │ → drafts a structured report from the content
└────────┬─────────┘
▼
┌─────────────────┐
│ Critic Chain │ → reviews the report and gives feedback
└────────┬─────────┘
▼
Final Report
Each agent/chain is built using LangChain, with tool calling used to give the Search and Reader agents access to external capabilities (web search and web scraping).
Multi-Agent-System/
├── app.py # Streamlit web app entry point
├── pipeline.py # CLI-based orchestration of the full pipeline
├── agents.py # Defines the agents and chains (search, reader, writer, critic)
├── tools.py # Custom LangChain tools (web search & web scraping)
├── requirements.txt # Python dependencies
└── .devcontainer/ # Dev container configuration
app.py— Launches the Streamlit interface where a user can enter a topic and watch the pipeline run in the browser.pipeline.py— Runs the same pipeline from the command line with progress printed to the console.agents.py— Builds the LangChain agents/chains:build_search_agent()— agent equipped with the web search toolbuild_reader_agent()— agent equipped with the web scraping toolwriter_chain— prompt chain that drafts the reportcritic_chain— prompt chain that critiques the report
tools.py— Implements the custom tools used by the agents:- a web search tool for finding relevant pages
- a web scraping tool for extracting readable text from a page
requirements.txt— All Python dependencies required to run the project.
| Layer | Technology |
|---|---|
| Agent framework | LangChain |
| Web interface | Streamlit |
| Language model | LLM API (e.g. OpenAI) |
| Web search | Search API tool (e.g. Tavily) |
| Web scraping | HTML parsing (e.g. BeautifulSoup) |
| Language | Python |
💡 Check
requirements.txtfor the exact set of dependencies and versions used.
- Python 3.9+
- An API key for your chosen LLM provider (e.g. OpenAI)
- An API key for your chosen search provider (e.g. Tavily), if applicable
git clone https://github.com/Himanshi252005/Multi-Agent-System.git
cd Multi-Agent-Systempython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtCreate a .env file in the project root and add your API keys:
OPENAI_API_KEY=your_openai_api_key_here
TAVILY_API_KEY=your_tavily_api_key_here
⚠️ Never commit your.envfile — make sure it's included in.gitignore.
Streamlit web app:
streamlit run app.pyOr run the CLI pipeline:
python pipeline.py- Launch the Streamlit app (or CLI pipeline).
- Enter a topic or question you'd like researched.
- Watch as the system:
- Searches the web for relevant sources
- Reads and extracts content from top results
- Drafts a structured report
- Critiques and refines the output
- Review the final generated report directly in the app.
This project is deployed on Streamlit Community Cloud and can be accessed here:
👉 multi-agent-system-byhimanshi.streamlit.app
To deploy your own version:
- Push your fork to GitHub.
- Go to Streamlit Cloud and connect your repository.
- Set
app.pyas the entry point. - Add your API keys under the app's Secrets settings.
- Add support for multiple LLM providers
- Export generated reports as PDF/Markdown files
- Add memory so the system can handle follow-up queries
- Add caching to avoid redundant searches
- Improve error handling for failed scrapes/timeouts
Contributions, issues, and feature requests are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source. Feel free to add a license file (e.g. MIT) to clarify usage terms for others.
Himanshi GitHub: @Himanshi252005
⭐ If you found this project interesting, consider giving it a star on GitHub!