Skip to content

vvezre/DeepResearch-Agent

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

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors