Skip to content

MHDataExpert/Deep-Research

Repository files navigation

Deep Research Agent

A sophisticated research agent system built with LangGraph and NVIDIA AI, designed to automate complex research tasks through intelligent multi-agent collaboration.

🚀 Overview

Deep Research Agent is an advanced AI-powered research system that leverages LangGraph to orchestrate multiple specialized agents for conducting comprehensive research. The system can handle complex research queries, perform web searches, analyze information, and generate detailed reports with proper citations.

✨ Features

  • Multi-Agent Architecture: Uses specialized agents for different research tasks (clarification, research, summarization)
  • Intelligent Task Delegation: Automatically breaks down complex research questions into sub-tasks
  • Web Research Integration: Integrates with Tavily API for real-time web searches
  • Structured Output: Generates well-formatted research reports with proper citations
  • Interactive UI: Built-in Streamlit interface for easy interaction
  • Configurable Models: Supports various NVIDIA AI models through configurable settings
  • Conversation Management: Maintains research threads and conversation history
  • Real-time Logging: Comprehensive debugging and monitoring capabilities

🛠️ Tech Stack

  • LangGraph: Stateful multi-agent orchestration
  • LangChain: LLM integration and prompting
  • NVIDIA AI: Large language models (Llama 3.1 70B/8B Instruct)
  • Tavily API: Web search and information retrieval
  • Streamlit: Interactive web interface
  • Pydantic: Data validation and configuration management
  • AsyncIO: Asynchronous processing for efficiency

📋 Prerequisites

  • Python 3.9+
  • NVIDIA API Key
  • Tavily API Key

🔧 Installation

  1. Clone the repository:
git clone https://github.com/yourusername/deep-research-agent.git
cd deep-research-agent
  1. Install dependencies:
pip install -r requirements.txt
# Or if using uv:
uv pip install -r requirements.txt
  1. Set up environment variables:
cp .env.example .env
# Then edit .env with your API keys

🗝️ Environment Variables

Create a .env file in the project root with the following variables:

NVIDIA_API_KEY=your_nvidia_api_key_here
TAVILY_API_KEY=your_tavily_api_key_here

🚀 Usage

Running the Web Interface

streamlit run ui.py

Then navigate to http://localhost:8501 in your browser to interact with the research agent.

Running from Command Line

python graph.py

This will run test scenarios to demonstrate the research agent's capabilities.

🏗️ Architecture

The system consists of several key components:

1. Agent Layer

  • ClarifyAgent: Determines if user queries need clarification
  • WriteResearchBrief: Converts user queries into structured research briefs

2. Supervisor Layer

  • Supervisor: Orchestrates research tasks and manages workflow
  • ConductResearchNode: Executes research tasks in parallel
  • ToolExecutorNode: Manages web searches and other tools

3. Researcher Layer

  • ResearcherNode: Performs individual research tasks
  • CompressionNode: Summarizes and formats research findings

4. State Management

  • AgentState: Manages conversation state
  • ResearcherState: Tracks individual research progress
  • SupervisorState: Coordinates multi-agent workflows

🎯 Example Use Cases

  • Market research and competitive analysis
  • Academic literature reviews
  • Technical trend analysis
  • Comparative studies
  • Fact-checking and verification
  • Content creation and curation

📊 Configuration

The system is highly configurable through the Configuration class:

# Example configuration
config = {
    "configurable": {
        "NVIDIA_api_key": "...",
        "research_base_url": "https://integrate.api.nvidia.com/v1",
        "clarify_model": "meta/llama-3.1-70b-instruct",
        "research_model": "meta/llama-3.1-70b-instruct",
        "max_concurrent_research_units": 3,
        "max_researcher_iterations": 3,
        "max_retries": 3,
        "max_structured_output_retries": 3
    }
}

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m '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.

🐛 Issues

If you encounter any issues, please open an issue on the GitHub repository with detailed information about the problem.

🙏 Acknowledgments

  • NVIDIA for providing the AI infrastructure
  • Tavily for the search API
  • The LangChain and LangGraph teams for excellent development tools

About

Deep Research is an advanced AI research platform that automates the process of conducting comprehensive research on user-specified topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages