Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”¬ ResearchMind β€” Multi-Agent AI Research System

Four specialized AI agents that collaborate to search, read, write, and critique β€” producing polished research reports on any topic.


πŸ“– Overview

ResearchMind is a production-ready multi-agent AI pipeline that automates the entire research workflow. You provide a topic; four autonomous agents handle the rest:

Agent Role
πŸ” Search Agent Queries the web via Tavily for recent, reliable information
πŸ“„ Reader Agent Picks the best URL and scrapes deep content from it
✍️ Writer Chain Synthesizes all gathered research into a structured report
🧐 Critic Chain Reviews the report and provides a score + constructive feedback

The project ships with a polished Streamlit web UI that visualizes every pipeline step in real time, plus a headless CLI entrypoint (pipeline.py).


πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   User (UI / CLI)                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚ topic
                         β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚   Search Agent       β”‚  ← Tavily Web Search
              β”‚  (LangChain Agent)   β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚ search_results
                         β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚   Reader Agent       β”‚  ← BeautifulSoup Scraper
              β”‚  (LangChain Agent)   β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚ scraped_content
                         β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚   Writer Chain       β”‚  ← GPT-4o-mini (LLM)
              β”‚  (LCEL Chain)        β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚ report
                         β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚   Critic Chain       β”‚  ← GPT-4o-mini (LLM)
              β”‚  (LCEL Chain)        β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚ feedback
                         β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚   Final Output       β”‚
              β”‚  (Report + Review)   β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

✨ Features

  • πŸ€– Multi-agent orchestration β€” independent agents with distinct responsibilities
  • 🌐 Real-time web search via Tavily (not just static knowledge)
  • πŸ•ΈοΈ Intelligent web scraping with BeautifulSoup content extraction
  • πŸ“ Structured report generation (Introduction β†’ Key Findings β†’ Conclusion β†’ Sources)
  • πŸ§ͺ Automated quality critique with scoring (X/10) and improvement suggestions
  • πŸ’» Dual interface β€” Beautiful Streamlit UI and CLI mode
  • ⬇️ Download reports as .md files directly from the UI
  • 🎨 Dark-mode premium UI with animated pipeline status cards

πŸš€ Getting Started

Prerequisites

1. Clone the repository

git clone https://github.com/<your-username>/multi-research-agent.git
cd multi-research-agent

2. Create and activate a virtual environment

python -m venv venv
source venv/bin/activate      # Linux / macOS
# venv\Scripts\activate       # Windows

3. Install dependencies

pip install -r requirements.txt

4. Configure environment variables

cp .env.example .env

Open .env and fill in your API keys:

OPENAI_API_KEY=sk-...
TAVILY_API_KEY=tvly-...

⚠️ Never commit your .env file. It is already listed in .gitignore.

5. Run the Streamlit app

streamlit run app.py

Open your browser at http://localhost:8501.

6. (Alternative) Run via CLI

python pipeline.py

You will be prompted to enter a research topic, and the full pipeline will run in your terminal.


πŸ“ Project Structure

multi-research-agent/
β”œβ”€β”€ app.py              # Streamlit web application (main UI)
β”œβ”€β”€ pipeline.py         # Headless CLI entrypoint
β”œβ”€β”€ agents.py           # Agent & chain definitions (Search, Reader, Writer, Critic)
β”œβ”€β”€ tools.py            # LangChain tools (web_search, scrape_url)
β”œβ”€β”€ requirements.txt    # Python dependencies
β”œβ”€β”€ .env.example        # Environment variable template (safe to commit)
β”œβ”€β”€ .env                # Your actual secrets (NEVER commit this)
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
└── README.md

πŸ”§ Configuration

Variable Description Required
OPENAI_API_KEY Your OpenAI API key βœ… Yes
TAVILY_API_KEY Your Tavily Search API key βœ… Yes

You can modify the model used in agents.py:

llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
# Change to "gpt-4o" for higher quality, or "gpt-3.5-turbo" for lower cost

🧩 How the Agents Work

πŸ” Search Agent

Uses the web_search tool (backed by Tavily) to retrieve up to 5 recent, reliable web results for the given topic β€” including title, URL, and a content snippet.

πŸ“„ Reader Agent

Takes the search results, picks the most relevant URL, and scrapes its full text using requests + BeautifulSoup. Scripts, styles, navigation, and footers are stripped for clean content.

✍️ Writer Chain

An LCEL chain that feeds the combined search + scraped data into GPT-4o-mini with a structured prompt. Outputs a full markdown report with:

  • Introduction
  • Key Findings (β‰₯3 points)
  • Conclusion
  • Sources

🧐 Critic Chain

An LCEL chain that reviews the generated report and returns:

  • Score: X/10
  • Strengths: bullet points
  • Areas to Improve: bullet points
  • One-line verdict

🀝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md first.

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'feat: add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


πŸ™ Acknowledgements


Built with ❀️ · Powered by LangChain multi-agent pipeline

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages