Skip to content

About

An AI-powered research assistant that creates teams of AI analysts, conduct comprehensive research and generate detailed reports.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

45 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”¬ AgentFranky !!

AI Research Assistant Python React LangGraph

A multi-agent research assistant that creates teams of AI analysts to conduct comprehensive research and generate frank, evidence-based, detailed reports

πŸš€ Quick Start β€’ πŸ•ΉοΈ Live: Research Agent β€’ πŸ”§ Installation


✨ Features

  • 🎯 Multi-Analyst Research: Creates specialized AI analyst teams for comprehensive topic coverage
  • πŸ€– Human-in-the-Loop: Review and approve analyst teams before research begins
  • πŸ“Š Comprehensive Reports: Generates detailed research reports with introduction, analysis, conclusion, and sources
  • πŸ”„ Multiple Interfaces: Web UI, Telegram Bot, and API access
  • πŸ“± Modern UI: Clean, responsive React-based web interface with PDF export
  • ⚑ Real-time Progress: Live updates during research process
  • πŸ” Multi-Source Research: Leverages Tavily Search, Wikipedia, and AI reasoning

πŸ—οΈ Architecture

graph TB
    A[User Input] --> B{Interface}
    B -->|Web| C[React Frontend]
    B -->|Chat| D[Telegram Bot]
    B -->|API| E[Flask API]
    
    C --> F[Flask API Server]
    D --> G[Research Assistant Core]
    E --> G
    F --> G
    
    G --> H[LangGraph Orchestrator]
    H --> I[AI Analyst Creation]
    I --> J[Human Approval]
    J --> K[Parallel Research]
    K --> L[Report Generation]
    
    K --> M[Tavily Search]
    K --> N[Wikipedia]
    K --> O[Google Gemini AI]
    
    L --> P[Final Report]
Loading

Core Components

  • 🧠 Research Assistant Core (src/): LangGraph-based orchestration engine
  • 🌐 Web Frontend (frontend/): Modern React application with Flask API
  • πŸ’¬ Telegram Bot (src/telegram_bot.py): Conversational research interface
  • πŸ”Œ API Interface (api/): RESTful API for programmatic access

πŸš€ Quick Start

Prerequisites

  • Python 3.8+ - Download here
  • Node.js 14+ - Download here
  • API Keys:
    • Google AI API key (for Gemini)
    • Tavily API key (for web search)
    • Telegram Bot Token (optional, for bot interface)

🎯 Web Interface (Recommended)

  1. Clone and setup:

    git clone https://github.com/vijay-varadarajan/ResearchAgent-v0.git
    cd ResearchAgent-v0/frontend
  2. Automated setup:

    # Windows
    setup.bat
    
    # Linux/Mac
    chmod +x setup.sh && ./setup.sh
  3. Configure environment: Create .env file in src/ directory:

    GOOGLE_API_KEY=your_google_api_key
    TAVILY_API_KEY=your_tavily_api_key
    LANGSMITH_API_KEY=your_langsmith_api_key  # optional
  4. Start the application:

    # Terminal 1: Backend API
    python api_server.py
    
    # Terminal 2: Frontend
    npm start
  5. Access the application:

πŸ’¬ Telegram Bot

  1. Setup bot token: Add to your .env file:

    TELEGRAM_BOT_TOKEN=your_telegram_bot_token
  2. Run the bot:

    cd src
    python run_bot.py
  3. Start chatting: Find your bot on Telegram and send /start

πŸ“– Documentation

🌐 Web Interface

The web interface provides a modern, chatbot-style experience:

  1. Enter Research Topic: Type your research question or topic
  2. Review AI Analysts: Approve or modify the generated analyst team
  3. Watch Progress: Real-time updates during research
  4. Download Report: Export as PDF when complete

Key Features:

  • 🎯 Intuitive chat interface
  • πŸ‘₯ Analyst team customization
  • πŸ“Š Real-time progress tracking
  • πŸ“± Responsive design (mobile-friendly)
  • πŸ“„ PDF export functionality

πŸ’¬ Telegram Bot Commands

  • /start - Welcome message and instructions
  • /new - Start a new research project
  • /help - Get help and documentation
  • Send any message - Start research on that topic

πŸ› οΈ Installation

Manual Installation

  1. Clone repository:

    git clone https://github.com/vijay-varadarajan/ResearchAgent-v0.git
    cd ResearchAgent-v0
  2. Install backend dependencies:

    pip install -r requirements.txt
  3. Install frontend dependencies:

    cd frontend
    npm install
  4. Configure environment variables: Create .env file in src/ directory with your API keys

  5. Test installation:

    # Test API
    cd frontend
    python test_api.py
    
    # Test core functionality
    cd ../src
    python test_graph.py

☁️ Cloud Deployment

The application is configured for deployment on:

  • Vercel (Frontend)
  • Render/Railway (Backend API)

See deployment-specific configuration in:

  • frontend/package.json - Frontend build configuration
  • requirements.txt - Production dependencies
  • start.sh - Deployment startup script

πŸ“ Project Structure

ResearchAgent-v0/
β”œβ”€β”€ πŸ“ src/                          # Core research engine
β”‚   β”œβ”€β”€ 🧠 research_assistant.py     # Main LangGraph orchestrator
β”‚   β”œβ”€β”€ πŸ“‹ schema.py                 # Data models and types
β”‚   β”œβ”€β”€ πŸ’¬ telegram_bot.py           # Telegram interface
β”‚   β”œβ”€β”€ πŸš€ run_bot.py               # Bot runner script
β”‚   └── πŸ§ͺ test_*.py                # Test utilities
β”œβ”€β”€ πŸ“ frontend/                     # Web application
β”‚   β”œβ”€β”€ πŸ“ src/                     # React components
β”‚   β”‚   β”œβ”€β”€ βš›οΈ App.js               # Main application
β”‚   β”‚   β”œβ”€β”€ 🎨 index.css            # Styles
β”‚   β”‚   └── βš™οΈ config.js            # Configuration
β”‚   β”œβ”€β”€ 🌐 api_server.py            # Flask API server
β”‚   β”œβ”€β”€ πŸ“„ README.md               # Frontend documentation
β”‚   β”œβ”€β”€ πŸ“¦ package.json            # Dependencies
β”‚   └── πŸ› οΈ setup.sh/.bat           # Setup scripts
β”œβ”€β”€ πŸ“ api/                         # API deployment
β”‚   └── πŸ”Œ index.py                # API endpoint
β”œβ”€β”€ πŸ“„ requirements.txt             # Python dependencies
β”œβ”€β”€ πŸš€ start.sh                    # Startup script
└── πŸ“– README.md                   # This file

πŸ”§ Configuration

Environment Variables

Create a .env file in the src/ directory:

# Required - Google AI (Gemini)
GOOGLE_API_KEY=your_google_ai_api_key

# Required - Web Search
TAVILY_API_KEY=your_tavily_api_key

# Optional - Telegram Bot
TELEGRAM_BOT_TOKEN=your_telegram_bot_token

# Optional - LangSmith Tracing
LANGSMITH_API_KEY=your_langsmith_api_key
LANGCHAIN_TRACING_V2=true
LANGCHAIN_PROJECT=your-langchain-project-name

# Optional - Production Settings
FLASK_ENV=production
PORT=5000

Getting API Keys

  1. Google Gemini API:

    • Go to Google AI Studio
    • Sign in and navigate to the Gemini API section
    • Create and copy your Gemini API key
    • Ensure the Gemini API is enabled for your project
  2. Tavily API:

    • Sign up at Tavily
    • Get your API key from the dashboard
  3. Telegram Bot (optional):

    • Message @BotFather on Telegram
    • Create a new bot and get the token

🎯 Usage Examples

Research Examples

Academic Research:

"Latest developments in quantum computing and their applications"

Business Analysis:

"Market trends in renewable energy sector 2024"

Technology Review:

"Comparison of large language models: GPT-4 vs Claude vs Gemini"

Health & Medicine:

"Recent advances in CRISPR gene editing technology"

Customizing Analyst Teams

When the system creates analyst teams, you can:

  • βœ… Approve the suggested team
  • ✏️ Modify with feedback like:
    • "Add a financial analyst perspective"
    • "Focus more on technical implementation"
    • "Include regulatory and ethical considerations"
    • "Remove the [specific role] and add [new role]"

πŸ§ͺ Testing

Run Tests

# Test API functionality
cd frontend
python test_api.py

# Test core research functionality  
cd ../src
python test_graph.py

# Test report splitting (for Telegram)
python test_splitting.py

Health Checks

# Check API health
curl http://localhost:5000/api/health

# Check active sessions
curl http://localhost:5000/api/sessions

🀝 Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes and test thoroughly
  4. Commit changes: git commit -m "Add feature"
  5. Push to branch: git push origin feature-name
  6. Submit a pull request

Development Guidelines

  • πŸ§ͺ Add tests for new features
  • πŸ“ Update documentation
  • 🎨 Follow existing code style
  • βœ… Ensure all tests pass
  • πŸ“± Test on multiple interfaces (Web, Telegram, API)

πŸ› Troubleshooting

Common Issues

"Module not found" errors:

# Ensure all dependencies are installed
pip install -r requirements.txt
cd frontend && npm install

API connection issues:

# Check if API server is running
curl http://localhost:5000/api/health

# Verify environment variables
echo $GOOGLE_API_KEY

Telegram bot not responding:

# Check bot token in .env file
# Ensure bot is running: python run_bot.py
# Verify webhook settings if using webhooks

Frontend build issues:

# Clear cache and reinstall
cd frontend
rm -rf node_modules package-lock.json
npm install
npm start

Getting Help

  • πŸ“§ Issues: Open an issue on GitHub
  • πŸ’¬ Discussions: Use GitHub Discussions
  • πŸ“– Documentation: Check the frontend README for detailed setup

Inspired by

Langgraph-Research-Assistant

πŸ™ Acknowledgments

  • LangChain & LangGraph - AI orchestration framework
  • Google AI - Gemini language model
  • Tavily - Web search API
  • React - Frontend framework
  • Flask - Backend API framework

⭐ If you find this project useful, please give it a star! ⭐

Report Bug β€’ Request Feature β€’ Documentation

About

An AI-powered research assistant that creates teams of AI analysts, conduct comprehensive research and generate detailed reports.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages