Skip to content

lc708/YADRA-YetAnotherDeepResearchAgent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

124 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

YADRA - Yet Another Deep Research Agent

Python Version LangGraph Next.js TypeScript License PRs Welcome

An intelligent deep research agent powered by LangGraph with multi-step reasoning, real-time streaming responses, and modern web interface.

πŸš€ Quick Start β€’ ✨ Features β€’ πŸ› οΈ Installation β€’ πŸ“– Documentation β€’ 🀝 Contributing

δΈ­ζ–‡ζ–‡ζ‘£

✨ Features

  • 🧠 Smart Workflows: Multi-step reasoning and adaptive plan execution with LangGraph
  • 🌊 Real-time Streaming: Live updates with Server-Sent Events (SSE)
  • 🌐 Modern Web UI: Responsive frontend built with Next.js 15
  • πŸ”„ Human-in-the-Loop: Interactive plan confirmation and feedback
  • 🌐 Multi-language: Support for both English and Chinese
  • πŸ”Œ MCP Integration: Model Context Protocol for extended capabilities
  • πŸ“Š Multiple Formats: Text, charts, podcasts, and more
  • 🐳 Docker Ready: Full containerization support

πŸ› οΈ Tech Stack

Backend

  • Core: LangGraph, LangChain, FastAPI
  • Package Manager: uv (recommended)
  • Database: PostgreSQL (Supabase)
  • Search: Tavily, DuckDuckGo, Brave Search, arXiv

Frontend

  • Framework: Next.js 15 (App Router)
  • Language: TypeScript 5.0+
  • Package Manager: pnpm
  • UI: Tailwind CSS, Radix UI
  • State: Zustand

πŸš€ Quick Start

Prerequisites

  • Python 3.12+
  • Node.js 18+ and pnpm
  • uv package manager (recommended)
  • PostgreSQL database (Supabase recommended)

1. Clone Repository

git clone https://github.com/lc708/YADRA-YetAnotherDeepResearchAgent.git
cd YADRA-YetAnotherDeepResearchAgent

2. Development Setup

Using bootstrap script (Recommended)

# Development mode with hot reload
./bootstrap.sh --dev

# Windows users
bootstrap.bat --dev

This will start:

3. Configuration

Environment Variables

Create .env file in project root:

# Database
DATABASE_URL=your_postgresql_url
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_key

# API
NEXT_PUBLIC_API_URL="http://localhost:8000/api"
DEBUG=True
APP_ENV=development

# Search
SEARCH_API=tavily
TAVILY_API_KEY=your_tavily_key

LLM Configuration

# Copy config template
cp conf.yaml.example conf.yaml

# Edit with your API keys
nano conf.yaml

Example conf.yaml:

BASIC_MODEL:
  base_url: https://api.openai.com/v1
  model: "gpt-4o"
  api_key: "your-openai-api-key"

REASONING_MODEL:
  base_url: https://api.anthropic.com
  model: "claude-3-5-sonnet-20241022"
  api_key: "your-anthropic-api-key"

πŸ“– Usage

Web Interface (Recommended)

  1. Visit http://localhost:3000
  2. Enter your research question
  3. Configure research parameters (optional)
  4. Send and watch real-time streaming responses
  5. View generated artifacts, podcasts, and results

API Usage

# Create research session
POST /research/create
{
  "query": "Your research question",
  "research_config": {
    "max_plan_iterations": 2,
    "max_step_num": 5,
    "auto_accepted_plan": false
  }
}

# Get session status
GET /research/status/{session_id}

# SSE streaming
GET /research/stream/{session_id}

Command Line

python main.py [options] [query]

Options:
  --interactive              Interactive mode
  --debug                    Enable debug logging
  --max_plan_iterations N    Max plan iterations (default: 1)
  --max_step_num N          Max steps (default: 3)

🐳 Deployment

Development

# Local development (recommended)
./bootstrap.sh --dev

# Docker development
docker-compose up -d

Production

Frontend: Deploy to Vercel
Backend: Use ./deploy.sh script for cloud deployment

For detailed deployment instructions, please refer to the configuration examples above and the deployment scripts in the repository.

πŸ—οΈ Architecture

YADRA/
β”œβ”€β”€ src/              # Backend source
β”‚   β”œβ”€β”€ server/       # FastAPI server
β”‚   β”œβ”€β”€ graph/        # LangGraph workflows
β”‚   β”œβ”€β”€ agents/       # AI agents
β”‚   └── tools/        # Tools and utilities
β”œβ”€β”€ web/              # Frontend source
β”‚   β”œβ”€β”€ src/app/      # Next.js pages
β”‚   β”œβ”€β”€ components/   # React components
β”‚   └── core/         # Core functionality
└── scripts/          # Database and utility scripts

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Quick Contribution Steps

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests (pytest tests/)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Development

# Backend
ruff format src/
ruff check src/ --fix
pytest tests/

# Frontend
cd web
pnpm lint
pnpm format
pnpm test

πŸ“„ License

This project is licensed under the MIT License.

πŸ”’ Security

Please see our Security Policy for reporting vulnerabilities.

πŸ“ž Support

πŸ—οΈ Built On

YADRA stands on the shoulders of giants. We're grateful to these amazing open-source projects:

🧠 Core AI & Workflow

🌐 Frontend & UI

πŸ”§ Backend & Infrastructure

  • FastAPI - Modern Python web framework
  • Supabase - Open-source Firebase alternative
  • PostgreSQL - Advanced relational database
  • uv - Fast Python package manager

πŸ” Search & Data

πŸ’‘ Inspiration

YADRA draws inspiration from these pioneering research projects:

Special thanks to these projects for their prompt templates and research methodologies that helped shape YADRA's approach.

πŸ™ Acknowledgments

  • Thanks to all contributors who make YADRA better
  • Inspired by the open-source AI research community
  • Built with love for researchers, by researchers

Made with ❀️ by the YADRA community

⭐ Star us on GitHub β€’ πŸ› Report Issues β€’ πŸ’‘ Request Features

About

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors