Skip to content

Repository files navigation

DeepResearch Agent v2.0

Industrial-grade deep research agent system with live architecture visualization powered by LikeC4.

Features

  • 🤖 5-Agent Intelligent Workflow: Plan → Research → Synthesize → Write → Review
  • 📊 Live Architecture Visualization: LikeC4-powered C4 diagrams that update with code
  • 🔄 Event Sourcing: Complete audit trail with PostgreSQL event store
  • 🖥️ Desktop Application: Electron + React for native experience
  • 🐳 Docker Local Sandbox: Secure isolated code execution (replaces E2B)
  • 🎭 Mock Mode: Demo without API keys

Quick Start

Prerequisites

  • Node.js 20+
  • Python 3.11+
  • Docker Desktop
  • npm 10+

Installation

# Clone repository
git clone <repository-url>
cd deep-research-agent-v2

# Install dependencies
npm run setup

# Start development environment
docker-compose up -d    # Start PostgreSQL
npm run backend         # Start FastAPI backend
npm run dev            # Start Electron app
npm run likec4         # Start architecture viewer

Configuration

Copy .env.example to .env and configure:

# Required (PostgreSQL)
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/deepresearch

# Optional (for real LLM - defaults to Mock mode)
OPENAI_API_KEY=sk-...
TAVILY_API_KEY=tvly-...

# Application
MOCK_MODE=true  # Set to false for real API calls
LOG_LEVEL=info

Architecture

View live architecture diagrams at http://localhost:4040 after running npm run likec4.

System Components

  • Desktop App (Electron + React): User interface
  • Backend API (FastAPI): Orchestration and business logic
  • LangGraph Orchestrator: 5-agent workflow state machine
  • Docker Sandbox: Isolated Python code execution
  • PostgreSQL: Event store + projections
  • LikeC4: Architecture visualization

Agent Workflow

  1. Planner Agent: Breaks research query into sub-tasks
  2. Research Agent: Parallel web search and data extraction
  3. Synthesizer Agent: Consolidates findings
  4. Writer Agent: Generates final report with citations
  5. Critic Agent: Quality review and validation

Project Structure

deep-research-agent-v2/
├── src/
│   ├── architecture/        # LikeC4 architecture models
│   │   ├── workspace.c4     # Root workspace definition
│   │   ├── model/          # C4 model components
│   │   └── views/          # Architecture views
│   ├── backend/            # FastAPI backend
│   │   ├── agents/         # LangGraph agents
│   │   ├── api/            # REST endpoints
│   │   ├── core/           # Event sourcing
│   │   ├── services/       # Docker sandbox, etc.
│   │   └── main.py         # Application entry
│   ├── desktop/            # Electron app
│   │   ├── main/           # Electron main process
│   │   └── renderer/       # React UI
│   └── shared/             # Shared types/utilities
├── docker-compose.yml      # Local development stack
└── package.json            # Monorepo configuration

Development

Testing

# Backend tests
cd src/backend
pytest

# Frontend tests
npm test --workspace=src/desktop

# E2E tests
npm run test:e2e

Linting

# Python
cd src/backend
black .
ruff check .
mypy .

# TypeScript
npm run lint
npm run typecheck

Building

# Backend Docker image
docker build -f docker/backend.Dockerfile -t deepresearch-backend .

# Desktop app
npm run build --workspace=src/desktop

Docker Sandbox

The system uses Docker for secure, isolated code execution instead of E2B:

Security Features:

  • Network disabled
  • CPU/Memory limits
  • Read-only filesystem (except workspace)
  • Auto-cleanup after execution
  • Timeout protection

Pre-installed Libraries:

  • pandas
  • numpy
  • matplotlib
  • seaborn
  • scipy

API Documentation

Access interactive API docs at http://localhost:8000/docs after starting the backend.

Key Endpoints

  • POST /research - Create research task
  • GET /research/{id} - Get research status
  • GET /research/{id}/stream - SSE progress updates
  • GET /health - Health check

Contributing

See CONTRIBUTING.md for development guidelines.

License

MIT License - see LICENSE for details.

Roadmap

MVP (Current)

  • ✅ LikeC4 architecture visualization
  • ✅ 5-agent workflow
  • ✅ Docker sandbox
  • ✅ Event sourcing
  • ✅ Mock mode

Future Enhancements

  • Multi-language support
  • PDF export
  • Custom agent plugins
  • Cloud deployment
  • Collaboration features

Credits

Built with:

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages