An end-to-end autonomous research and analysis system powered by collaborative LangChain agents. The system coordinates specialized AI agents to search the live web, deep-scrape primary resources, synthesize structured research papers, and rigorously critique and score the final report.
flowchart TD
User([👤 User / Researcher]) -->|Enters Topic / Selects Preset| UI[🖥️ Streamlit Web GUI]
subgraph Multi_Agent_Pipeline [🤖 Collaborative Multi-Agent Pipeline]
direction TB
S_Agent["🔍 Step 1: Search Agent (Tavily)<br/>• Queries web for recent, high-authority sources<br/>• Extracts titles, URLs, and snippets"]
R_Agent["📖 Step 2: Reader Agent (Web Scraper)<br/>• Analyzes search results<br/>• Scrapes full article content via BeautifulSoup"]
W_Agent["✍️ Step 3: Writer Chain (Synthesis)<br/>• Synthesizes multi-source context<br/>• Structures Introduction, Findings, Conclusion, Sources"]
C_Agent["⚖️ Step 4: Critic Chain (Audit & Scoring)<br/>• Evaluates factual depth, clarity, and quality<br/>• Issues X/10 Score, Strengths, Improvements, Verdict"]
S_Agent -->|URLs & Snippets| R_Agent
R_Agent -->|Deep Cleaned Content| W_Agent
W_Agent -->|Full Research Draft| C_Agent
end
UI -->|Triggers Pipeline| S_Agent
C_Agent -->|Complete Research State| UI
subgraph Output_Hub [📑 Interactive Dashboard Hub]
direction LR
Tab1[📄 Research Report<br/>Markdown & .txt Export]
Tab2[📊 Critic Evaluation<br/>Scorecard & Pros/Cons]
Tab3[🔍 Agent Telemetry<br/>Raw Sources & Scraped Text]
end
UI --> Output_Hub
| Agent | Technology | Role & Objective |
|---|---|---|
| 🔍 Search Agent | Tavily AI API + ChatOpenAI |
Queries live search indices for the most recent, reputable sources on the given subject. |
| 📖 Reader Agent | requests + BeautifulSoup |
Selects the most relevant URL and deep-scrapes the webpage, eliminating noise (scripts, styles, ads) to extract clean full text. |
| ✍️ Writer Chain | LangChain Core Prompts + ChatOpenAI |
Synthesizes search snippets and deep article content into an academic, structured research report with citations. |
| ⚖️ Critic Chain | LangChain Core Prompts + ChatOpenAI |
Rigorously stress-tests the report against quality standards, assigning a score out of 10, outlining strengths, improvements, and an executive verdict. |
- ⚡ Real-Time Pipeline Visualizer: Live step-by-step progress tracking with expandable agent telemetry during generation.
- 💡 Dynamic Topic Presets: Clickable pre-configured research topics with real-time recent development bullet points.
- 🎯 Dynamic Pointer: Active topic pointer automatically highlights whichever topic is currently selected or researched.
- 📥 One-Click Export: Download the comprehensive research report in either Markdown (
.md) or Plain Text (.txt) format. - 📜 Session History: Switch between previously conducted research queries in the current session without re-running the pipeline.
- 💻 CLI & GUI Modes: Fully usable both as a modern web application and as a terminal CLI script.
Multi-Agent-Research-System/
├── app.py # Main Streamlit Graphical User Interface
├── pipeline.py # Multi-agent workflow orchestrator (supports callbacks & CLI)
├── agents.py # Agent definitions, LLM setup (OpenAI), and chain builders
├── tools.py # Custom agent tools (Tavily search & BeautifulSoup scraper)
├── requirements.txt # Project dependencies
├── .env.example # Environment variable template (keys)
└── README.md # Documentation and architecture guide
git clone https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git
cd YOUR_REPO_NAME# Windows
python -m venv .venv
.\.venv\Scripts\activate
# macOS / Linux
python3 -m venv .venv
source .venv/bin/activatepip install -r requirements.txtCreate a .env file in the root folder with your keys:
OPENAI_API_KEY=your_openai_api_key_here
TAVILY_API_KEY=your_tavily_api_key_here
# Optional: override default OpenAI model (default: gpt-4o-mini)
OPENAI_MODEL=gpt-4o-ministreamlit run app.pyYour browser will automatically open at http://localhost:8501.
python pipeline.py- Push this repository to GitHub (make sure
.envis listed in your.gitignore). - Visit share.streamlit.io and connect your GitHub account.
- Select this repository and set the main file to
app.py. - Open Advanced settings... > Secrets and paste your credentials:
OPENAI_API_KEY = "your_actual_openai_api_key" TAVILY_API_KEY = "your_actual_tavily_api_key"
- Click Deploy! Your multi-agent system will be live at a public URL.
This project is open-source and available under the MIT License.