Skip to content

About

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.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

🧠 Autonomous Multi-Agent Research System

Python Version Framework GUI LLM Search Engine

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.


📐 System Architecture

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
Loading

🤖 Specialized Agent Roles

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.

✨ Key Features

  • ⚡ 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.

📁 Repository Structure

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

🚀 Quick Start (Local Setup)

1. Clone the Repository

git clone https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git
cd YOUR_REPO_NAME

2. Create and Activate a Virtual Environment

# Windows
python -m venv .venv
.\.venv\Scripts\activate

# macOS / Linux
python3 -m venv .venv
source .venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Configure API Keys

Create 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-mini

🖥️ Running the Application

Option A: Web Graphical User Interface (Recommended)

streamlit run app.py

Your browser will automatically open at http://localhost:8501.

Option B: Terminal CLI Mode

python pipeline.py

☁️ Deployment (Streamlit Community Cloud)

  1. Push this repository to GitHub (make sure .env is listed in your .gitignore).
  2. Visit share.streamlit.io and connect your GitHub account.
  3. Select this repository and set the main file to app.py.
  4. Open Advanced settings... > Secrets and paste your credentials:
    OPENAI_API_KEY = "your_actual_openai_api_key"
    TAVILY_API_KEY = "your_actual_tavily_api_key"
  5. Click Deploy! Your multi-agent system will be live at a public URL.

📜 License

This project is open-source and available under the MIT License.

About

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.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages