back to home

HKUDS / DeepCode

"DeepCode: Open Agentic Coding (Paper2Code & Text2Web & Text2Backend)"

14,791 stars
1,986 forks
33 issues
PythonTypeScriptShell

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing HKUDS/DeepCode in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/HKUDS/DeepCode)
Preview:Analyzed by RepoMind

Repository Summary (README)

Preview
DeepCode Logo
    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
    โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•
    โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
    โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•  โ–ˆโ–ˆโ•”โ•โ•โ•  โ–ˆโ–ˆโ•”โ•โ•โ•โ• โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•
    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘     โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
    โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•      โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•
HKUDS%2FDeepCode | Trendshift

DeepCode Logo DeepCode: Open Agentic Coding

Advancing Code Generation with Multi-Agent Systems

๐Ÿ–ฅ๏ธ Interface Showcase

๐Ÿ–ฅ๏ธ CLI Interface

Terminal-Based Development

CLI Interface Demo
๐Ÿš€ Advanced Terminal Experience
โšก Fast command-line workflow
๐Ÿ”ง Developer-friendly interface
๐Ÿ“Š Real-time progress tracking

Professional terminal interface for advanced users and CI/CD integration

๐ŸŒ Web Interface

Visual Interactive Experience

Web Interface Demo
๐ŸŽจ Modern Web Dashboard
๐Ÿ–ฑ๏ธ Intuitive drag-and-drop
๐Ÿ“ฑ Responsive design
๐ŸŽฏ Visual progress tracking

Beautiful web interface with streamlined workflow for all skill levels


๐ŸŽฌ Introduction Video

๐ŸŽฏ Watch our complete introduction - See how DeepCode transforms research papers and natural language into production-ready code

Watch Video


"Where AI Agents Transform Ideas into Production-Ready Code"


๐Ÿ“‘ Table of Contents


๐Ÿ“ฐ News

๐ŸŽ‰ [2026-02] nanobot โœ–๏ธ DeepCode. Just chat naturally with openclaw/nanobot to handle your coding tasks:

DeepCode

โœฆ

nanobot
  • nanobot nanobot now powers your agentic coding & engineering! ๐Ÿค–๐Ÿ’ป
  • Step away from your laptop โ€” make vibe coding even more vibe! Code directly from your phone! ๐Ÿ“ฑโœจ
  • One-command deploy: ./nanobot/run_nanobot.sh โ†’ Setup Guide โ†’
Feishu Chat Example 1 Feishu Chat Example 2
Feishu Bot in Action โ€” Natural language โ†’ Full code generation with setup instructions

๐ŸŽ‰ [2026-02] New Web UI Experience Upgrade!

  • ๐Ÿ”„ User-in-Loop Interaction: Support real-time user interaction during workflows - AI asks clarifying questions directly in the chat
  • ๐Ÿ’ฌ Inline Interaction Design: Interaction prompts appear naturally within the chat flow for a seamless experience
  • ๐Ÿš€ One-Click Launch: Simply run deepcode to start the new UI (cross-platform: Windows/macOS/Linux)
  • ๐Ÿ”ง Improved Process Management: Enhanced service start/stop mechanism with automatic port cleanup
  • ๐Ÿ“ก WebSocket Real-time Communication: Fixed message loss issues, ensuring proper interaction state synchronization
DeepCode New UI
DeepCode New Web UI - Modern React-based Interface

๐ŸŽ‰ [2025-10-28] DeepCode Achieves SOTA on PaperBench!

DeepCode sets new benchmarks on OpenAI's PaperBench Code-Dev across all categories:

  • ๐Ÿ† Surpasses Human Experts: 75.9% (DeepCode) vs Top Machine Learning PhDs 72.4% (+3.5%).
  • ๐Ÿฅ‡ Outperforms SOTA Commercial Code Agents: 84.8% (DeepCode) vs Leading Commercial Code Agents (+26.1%) (Cursor, Claude Code, and Codex).
  • ๐Ÿ”ฌ Advances Scientific Coding: 73.5% (DeepCode) vs PaperCoder 51.1% (+22.4%).
  • ๐Ÿš€ Beats LLM Agents: 73.5% (DeepCode) vs best LLM frameworks 43.3% (+30.2%).

๐Ÿš€ Key Features


๐Ÿš€ Paper2Code

Algorithm Badge

Automated Implementation of Complex Algorithms

Effortlessly converts complex algorithms from research papers into high-quality, production-ready code, accelerating algorithm reproduction.

๐ŸŽจ Text2Web

Frontend Badge

Automated Front-End Web Development

Translates plain textual descriptions into fully functional, visually appealing front-end web code for rapid interface creation.

โš™๏ธ Text2Backend

Backend Badge

Automated Back-End Development

Generates efficient, scalable, and feature-rich back-end code from simple text inputs, streamlining server-side development.



๐Ÿ“Š Experimental Results



We evaluate DeepCode on the PaperBench benchmark (released by OpenAI), a rigorous testbed requiring AI agents to independently reproduce 20 ICML 2024 papers from scratch. The benchmark comprises 8,316 gradable components assessed using SimpleJudge with hierarchical weighting.

Our experiments compare DeepCode against four baseline categories: (1) Human Experts, (2) State-of-the-Art Commercial Code Agents, (3) Scientific Code Agents, and (4) LLM-Based Agents.

โ‘  ๐Ÿง  Human Expert Performance (Top Machine Learning PhD)

DeepCode: 75.9% vs. Top Machine Learning PhD: 72.4% (+3.5%)

DeepCode achieves 75.9% on the 3-paper human evaluation subset, surpassing the best-of-3 human expert baseline (72.4%) by +3.5 percentage points. This demonstrates that our framework not only matches but exceeds expert-level code reproduction capabilities, representing a significant milestone in autonomous scientific software engineering.

โ‘ก ๐Ÿ’ผ State-of-the-Art Commercial Code Agents

DeepCode: 84.8% vs. Best Commercial Agent: 58.7% (+26.1%)

On the 5-paper subset, DeepCode substantially outperforms leading commercial coding tools:

  • Cursor: 58.4%
  • Claude Code: 58.7%
  • Codex: 40.0%
  • DeepCode: 84.8%

This represents a +26.1% improvement over the leading commercial code agent. All commercial agents utilize Claude Sonnet 4.5 or GPT-5 Codex-high, highlighting that DeepCode's superior architectureโ€”rather than base model capabilityโ€”drives this performance gap.

โ‘ข ๐Ÿ”ฌ Scientific Code Agents

DeepCode: 73.5% vs. PaperCoder: 51.1% (+22.4%)

Compared to PaperCoder (51.1%), the state-of-the-art scientific code reproduction framework, DeepCode achieves 73.5%, demonstrating a +22.4% relative improvement. This substantial margin validates our multi-module architecture combining planning, hierarchical task decomposition, code generation, and iterative debugging over simpler pipeline-based approaches.

โ‘ฃ ๐Ÿค– LLM-Based Agents

DeepCode: 73.5% vs. Best LLM Agent: 43.3% (+30.2%)

DeepCode significantly outperforms all tested LLM agents:

  • Claude 3.5 Sonnet + IterativeAgent: 27.5%
  • o1 + IterativeAgent (36 hours): 42.4%
  • o1 BasicAgent: 43.3%
  • DeepCode: 73.5%

The +30.2% improvement over the best-performing LLM agent demonstrates that sophisticated agent scaffolding, rather than extended inference time or larger models, is critical for complex code reproduction tasks.


๐ŸŽฏ Autonomous Self-Orchestrating Multi-Agent Architecture

The Challenges:

  • ๐Ÿ“„ Implementation Complexity: Converting academic papers and complex algorithms into working code requires significant technical effort and domain expertise

  • ๐Ÿ”ฌ Research Bottleneck: Researchers spend valuable time implementing algorithms instead of focusing on their core research and discovery work

  • โฑ๏ธ Development Delays: Product teams experience long wait times between concept and testable prototypes, slowing down innovation cycles

  • ๐Ÿ”„ Repetitive Coding: Developers repeatedly implement similar patterns and functionality instead of building on existing solutions

DeepCode addresses these workflow inefficiencies by providing reliable automation for common development tasks, streamlining your development workflow from concept to code.

flowchart LR
    A["๐Ÿ“„ Research Papers<br/>๐Ÿ’ฌ Text Prompts<br/>๐ŸŒ URLs & Document<br/>๐Ÿ“Ž Files: PDF, DOC, PPTX, TXT, HTML"] --> B["๐Ÿง  DeepCode<br/>Multi-Agent Engine"]
    B --> C["๐Ÿš€ Algorithm Implementation <br/>๐ŸŽจ Frontend Development <br/>โš™๏ธ Backend Development"]

    style A fill:#ff6b6b,stroke:#c0392b,stroke-width:2px,color:#000
    style B fill:#00d4ff,stroke:#0984e3,stroke-width:3px,color:#000
    style C fill:#00b894,stroke:#00a085,stroke-width:2px,color:#000

๐Ÿ—๏ธ Architecture

๐Ÿ“Š System Overview

DeepCode is an AI-powered development platform that automates code generation and implementation tasks. Our multi-agent system handles the complexity of translating requirements into functional, well-structured code, allowing you to focus on innovation rather than implementation details.

๐ŸŽฏ Technical Capabilities:

๐Ÿงฌ Research-to-Production Pipeline
Multi-modal document analysis engine that extracts algorithmic logic and mathematical models from academic papers. Generates optimized implementations with proper data structures while preserving computational complexity characteristics.

๐Ÿช„ Natural Language Code Synthesis
Context-aware code generation using fine-tuned language models trained on curated code repositories. Maintains architectural consistency across modules while supporting multiple programming languages and frameworks.

โšก Automated Prototyping Engine
Intelligent scaffolding system generating complete application structures including database schemas, API endpoints, and frontend components. Uses dependency analysis to ensure scalable architecture from initial generation.

๐Ÿ’Ž Quality Assurance Automation
Integrated static analysis with automated unit test generation and documentation synthesis. Employs AST analysis for code correctness and property-based testing for comprehensive coverage.

๐Ÿ”ฎ CodeRAG Integration System
Advanced retrieval-augmented generation combining semantic vector embeddings with graph-based dependency analysis. Automatically discovers optimal libraries and implementation patterns from large-scale code corpus.


๐Ÿ”ง Core Techniques

  • ๐Ÿง  Intelligent Orchestration Agent: Central decision-making system that coordinates workflow phases and analyzes requirements. Employs dynamic planning algorithms to adapt execution strategies in real-time based on evolving project complexity. Dynamically selects optimal processing strategies for each implementation step.

  • ๐Ÿ’พ Efficient Memory Mechanism: Advanced context engineering system that manages large-scale code contexts efficiently. Implements hierarchical memory structures with intelligent compression for handling complex codebases. This component enables instant retrieval of implementation patterns and maintains semantic coherence across extended development sessions.

  • ๐Ÿ” Advanced CodeRAG System: Global code comprehension engine that analyzes complex inter-dependencies across repositories. Performs cross-codebase relationship mapping to understand architectural patterns from a holistic perspective. This module leverages dependency graphs and semantic analysis to provide globally-aware code recommendations during implementation.


๐Ÿค– Multi-Agent Architecture of DeepCode:

  • ๐ŸŽฏ Central Orchestrating Agent: Orchestrates entire workflow execution and makes strategic decisions. Coordinates specialized agents based on input complexity analysis. Implements dynamic task planning and resource allocation algorithms.

  • ๐Ÿ“ Intent Understanding Agent: Performs deep semantic analysis of user requirements to decode complex intentions. Extracts functional specifications and technical constraints through advanced NLP processing. Transforms ambiguous human descriptions into precise, actionable development specifications with structured task decomposition.

  • ๐Ÿ“„ Document Parsing Agent: Processes complex technical documents and research papers with advanced parsing capabilities. Extracts algorithms and methodologies using document understanding models. Converts academic concepts into practical implementation specifications through intelligent content analysis.

  • ๐Ÿ—๏ธ Code Planning Agent: Performs architectural design and technology stack optimization. Dynamic planning for adaptive development roadmaps. Enforces coding standards and generates modular structures through automated design pattern selection.

  • ๐Ÿ” Code Reference Mining Agent: Discovers relevant repositories and frameworks through intelligent search algorithms. Analyzes codebases for compatibility and integration potential. Provides recommendations based on similarity metrics and automated dependency analysis.

  • ๐Ÿ“š Code Indexing Agent: Builds comprehensive knowledge graphs of discovered codebases. Maintains semantic relationships between code components. Enables intelligent retrieval and cross-reference capabilities.

  • ๐Ÿงฌ Code Generation Agent: Synthesizes gathered information into executable code implementations. Creates functional interfaces and integrates discovered components. Generates comprehensive test suites and documentation for reproducibility.


๐Ÿ› ๏ธ Implementation Tools Matrix

๐Ÿ”ง Powered by MCP (Model Context Protocol)

DeepCode leverages the Model Context Protocol (MCP) standard to seamlessly integrate with various tools and services. This standardized approach ensures reliable communication between AI agents and external systems, enabling powerful automation capabilities.

๐Ÿ“ก MCP Servers & Tools
๐Ÿ› ๏ธ MCP Server๐Ÿ”ง Primary Function๐Ÿ’ก Purpose & Capabilities
๐Ÿ” braveWeb Search EngineReal-time information retrieval via Brave Search API
๐ŸŒ bocha-mcpAlternative SearchSecondary search option with independent API access
๐Ÿ“‚ filesystemFile System OperationsLocal file and directory management, read/write operations
๐ŸŒ fetchWeb Content RetrievalFetch and extract content from URLs and web resources
๐Ÿ“ฅ github-downloaderRepository ManagementClone and download GitHub repositories for analysis
๐Ÿ“‹ file-downloaderDocument ProcessingDownload and convert files (PDF, DOCX, etc.) to Markdown
โšก command-executorSystem CommandsExecute bash/shell commands for environment management
๐Ÿงฌ code-implementationCode Generation HubComprehensive code reproduction with execution and testing
๐Ÿ“š code-reference-indexerSmart Code SearchIntelligent indexing and search of code repositories
๐Ÿ“„ document-segmentationSmart Document AnalysisIntelligent document segmentation for large papers and technical documents
๐Ÿ”ง Legacy Tool Functions (for reference)
๐Ÿ› ๏ธ Function๐ŸŽฏ Usage Context
๐Ÿ“„ read_code_memEfficient code context retrieval from memory
โœ๏ธ write_fileDirect file content generation and modification
๐Ÿ execute_pythonPython code testing and validation
๐Ÿ“ get_file_structureProject structure analysis and organization
โš™๏ธ set_workspaceDynamic workspace and environment configuration
๐Ÿ“Š get_operation_historyProcess monitoring and operation tracking

๐ŸŽ›๏ธ Multi-Interface Framework
RESTful API with CLI and web frontends featuring real-time code streaming, interactive debugging, and extensible plugin architecture for CI/CD integration.

๐Ÿš€ Multi-Agent Intelligent Pipeline:

๐ŸŒŸ Intelligence Processing Flow

๐Ÿ’ก INPUT LAYER
๐Ÿ“„ Research Papers โ€ข ๐Ÿ’ฌ Natural Language โ€ข ๐ŸŒ URLs โ€ข ๐Ÿ“‹ Requirements
๐ŸŽฏ CENTRAL ORCHESTRATION
Strategic Decision Making โ€ข Workflow Coordination โ€ข Agent Management
๐Ÿ“ TEXT ANALYSIS
Requirement Processing
๐Ÿ“„ DOCUMENT ANALYSIS
Paper & Spec Processing
๐Ÿ“‹ REPRODUCTION PLANNING
Deep Paper Analysis โ€ข Code Requirements Parsing โ€ข Reproduction Strategy Development
๐Ÿ” REFERENCE ANALYSIS
Repository Discovery
๐Ÿ“š CODE INDEXING
Knowledge Graph Building
๐Ÿงฌ CODE IMPLEMENTATION
Implementation Generation โ€ข Testing โ€ข Documentation
โšก OUTPUT DELIVERY
๐Ÿ“ฆ Complete Codebase โ€ข ๐Ÿงช Test Suite โ€ข ๐Ÿ“š Documentation โ€ข ๐Ÿš€ Deployment Ready

๐Ÿ”„ Process Intelligence Features

๐ŸŽฏ Adaptive Flow

Dynamic agent selection based on input complexity

๐Ÿง  Smart Coordination

Intelligent task distribution and parallel processing

๐Ÿ” Context Awareness

Deep understanding through CodeRAG integration

โšก Quality Assurance

Automated testing and validation throughout


๐Ÿš€ Quick Start

๐Ÿ“‹ Prerequisites

Before installing DeepCode, ensure you have the following:

RequirementVersionPurpose
Python3.9+Core runtime
Node.js18+New UI frontend
npm8+Package management
# Check your versions
python --version   # Should be 3.9+
node --version     # Should be 18+
npm --version      # Should be 8+
๐Ÿ“ฅ Install Node.js (if not installed)
# macOS (using Homebrew)
brew install node

# Ubuntu/Debian
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs

# Windows
# Download from https://nodejs.org/

๐Ÿ“ฆ Step 1: Installation

Choose one of the following installation methods:

โšก Direct Installation (Recommended)

# ๐Ÿš€ Install DeepCode package directly
pip install deepcode-hku

# ๐Ÿ”‘ Download configuration files
curl -O https://raw.githubusercontent.com/HKUDS/DeepCode/main/mcp_agent.config.yaml
curl -O https://raw.githubusercontent.com/HKUDS/DeepCode/main/mcp_agent.secrets.yaml

๐Ÿ”ง Development Installation (From Source)

๐Ÿ“‚ Click to expand development installation options
๐Ÿ”ฅ Using UV (Recommended for Development)
git clone https://github.com/HKUDS/DeepCode.git
cd DeepCode/

curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python=3.13
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -r requirements.txt

# Install frontend dependencies
npm install --prefix new_ui/frontend
๐Ÿ Using Traditional pip
git clone https://github.com/HKUDS/DeepCode.git
cd DeepCode/

pip install -r requirements.txt

# Install frontend dependencies
npm install --prefix new_ui/frontend

๐Ÿ”ง Step 2: Configuration

The following configuration applies to all installation methods (pip, UV, source, and Docker).

๐Ÿ”‘ API Keys (required)

Edit mcp_agent.secrets.yaml with your API keys:

# At least ONE provider API key is required
openai:
  api_key: "your_openai_api_key"
  base_url: "https://openrouter.ai/api/v1"  # Optional: for OpenRouter or custom endpoints

anthropic:
  api_key: "your_anthropic_api_key"  # For Claude models

google:
  api_key: "your_google_api_key"     # For Gemini models

๐Ÿค– LLM Provider (optional)

Edit mcp_agent.config.yaml to choose your preferred LLM provider (line ~106):

# Options: "google", "anthropic", "openai"
# If not set or unavailable, will automatically fallback to first available provider
llm_provider: "google"

๐Ÿ” Search API Keys (optional)

Configure web search in mcp_agent.config.yaml:

# For Brave Search (default) โ€” set in brave.env section (line ~28)
brave:
  env:
    BRAVE_API_KEY: "your_brave_api_key_here"

# For Bocha-MCP (alternative) โ€” set in bocha-mcp.env section (line ~74)
bocha-mcp:
  env:
    BOCHA_API_KEY: "your_bocha_api_key_here"

๐Ÿ“„ Document Segmentation (optional)

Control document processing in mcp_agent.config.yaml:

document_segmentation:
  enabled: true          # true/false โ€” whether to use intelligent document segmentation
  size_threshold_chars: 50000  # Document size threshold to trigger segmentation
๐ŸชŸ Windows Users: Additional MCP Server Configuration

If you're using Windows, you may need to configure MCP servers manually in mcp_agent.config.yaml:

# 1. Install MCP servers globally
npm i -g @modelcontextprotocol/server-brave-search
npm i -g @modelcontextprotocol/server-filesystem

# 2. Find your global node_modules path
npm -g root

Then update your mcp_agent.config.yaml to use absolute paths:

mcp:
  servers:
    brave:
      command: "node"
      args: ["C:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-brave-search/dist/index.js"]
    filesystem:
      command: "node"
      args: ["C:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js", "."]

Note: Replace the path with your actual global node_modules path from step 2.

๐Ÿ” Search Server Configuration (Optional)

DeepCode supports multiple search servers for web search functionality. You can configure your preferred option in mcp_agent.config.yaml:

# Default search server configuration
# Options: "brave" or "bocha-mcp"
default_search_server: "brave"

Available Options:

  • ๐Ÿ” Brave Search ("brave"): Default option with high-quality search results. Requires BRAVE_API_KEY. Recommended for most users.
  • ๐ŸŒ Bocha-MCP ("bocha-mcp"): Alternative search server. Requires BOCHA_API_KEY. Uses local Python server implementation.

Full MCP server configuration in mcp_agent.config.yaml:

# For Brave Search (default) - around line 28
brave:
  command: "npx"
  args: ["-y", "@modelcontextprotocol/server-brave-search"]
  env:
    BRAVE_API_KEY: "your_brave_api_key_here"

# For Bocha-MCP (alternative) - around line 74
bocha-mcp:
  command: "python"
  args: ["tools/bocha_search_server.py"]
  env:
    PYTHONPATH: "."
    BOCHA_API_KEY: "your_bocha_api_key_here"

๐Ÿ’ก Tip: Both search servers require API key configuration. Choose the one that best fits your API access and requirements.

โšก Step 3: Launch Application

Choose your preferred launch method:

๐Ÿณ Docker (Recommended)๐Ÿš€ Local (deepcode command)๐Ÿ› ๏ธ Other Methods

No Python/Node needed โ€” everything in container.

git clone https://github.com/HKUDS/DeepCode.git
cd DeepCode/
cp mcp_agent.secrets.yaml.example \
   mcp_agent.secrets.yaml
# Edit secrets with your API keys

./deepcode_docker/run_docker.sh
# Access โ†’ http://localhost:8000

Auto-installs deps on first run.

deepcode
# Frontend โ†’ http://localhost:5173
# Backend  โ†’ http://localhost:8000
# Ctrl+C to stop

Features: User-in-Loop, real-time progress, inline chat.

# macOS / Linux
./run.sh
# or: python deepcode.py

# Windows
run.bat
# or: python deepcode.py

# Classic Streamlit UI
deepcode --classic

# CLI mode
deepcode --cli
# or: python cli/main_cli.py
๐Ÿณ Docker Management Commands
./deepcode_docker/run_docker.sh stop      # Stop
./deepcode_docker/run_docker.sh restart   # Restart (no rebuild needed for config changes)
./deepcode_docker/run_docker.sh --build   # Force rebuild
./deepcode_docker/run_docker.sh logs      # Real-time logs
./deepcode_docker/run_docker.sh status    # Health check
./deepcode_docker/run_docker.sh clean     # Remove containers & images

Or with Docker Compose directly:

docker compose -f deepcode_docker/docker-compose.yml up --build   # Build & start
docker compose -f deepcode_docker/docker-compose.yml down         # Stop
docker compose -f deepcode_docker/docker-compose.yml logs -f      # Logs

๐Ÿ’ก Config files are mounted as volumes โ€” edit and restart, no rebuild needed. ๐Ÿ’ก Windows users: run docker compose commands directly if shell scripts aren't available.

๐ŸŽฏ Step 4: Generate Code

  1. ๐Ÿ“„ Input โ€” Upload a research paper, type requirements, or paste a URL
  2. ๐Ÿค– Processing โ€” The multi-agent system analyzes, plans, and generates
  3. โšก Output โ€” Receive production-ready code with tests and documentation

๐Ÿ”ง Troubleshooting

โ“ Common Issues & Solutions
ProblemCauseFix
Docker build fails with tsc: not foundCorrupted build cachedocker builder prune -f then rebuild with --no-cache
error during connect / cannot find the fileDocker Desktop not runningStart Docker Desktop, wait until ready, retry
Frontend blank pageCorrupted node_modulescd new_ui/frontend && rm -rf node_modules && npm install
ERR_CONNECTION_REFUSEDWrong port / backend not runningDocker: http://localhost:8000. Local: http://localhost:5173
npm install โ†’ Could not read package.jsonWrong directoryUse npm install --prefix new_ui/frontend
Windows: MCP servers not workingNeed absolute pathsSee Windows MCP Configuration above

๐Ÿค– nanobot Integration (Feishu Chatbot)

Chat with DeepCode from Feishu โ€” powered by nanobot.

flowchart LR
    subgraph Clients["๐Ÿ’ฌ Chat Platforms"]
        direction TB
        F["<b>Feishu</b><br/>WebSocket"]
        T["<b>Telegram</b><br/>Polling"]
        D["<b>Discord</b><br/>Gateway"]
    end

    subgraph Gateway["๐Ÿˆ nanobot Gateway"]
        direction TB
        A["Agent Loop<br/><i>LLM + Tool Calls</i>"]
    end

    subgraph Engine["๐Ÿง  DeepCode Engine"]
        direction TB
        P2C["Paper โ†’ Code"]
        C2C["Chat โ†’ Code"]
        TRK["Task Tracking"]
    end

    F & T & D <-->|"messages"| A
    A -->|"HTTP API"| P2C & C2C & TRK
    A -.->|"LLM API"| LLM["โ˜๏ธ OpenRouter"]

    style Clients fill:#1a1a2e,stroke:#00d9ff,color:#fff
    style Gateway fill:#1a1a2e,stroke:#4ecdc4,color:#fff
    style Engine fill:#1a1a2e,stroke:#ff6b6b,color:#fff
    style LLM fill:#1a1a2e,stroke:#9b59b6,color:#fff
DeepCode

โœฆ

nanobot

Both services run inside the same Docker Compose network. Prerequisites: Docker Desktop + OpenRouter API Key (get one) + Feishu App.


Step 1 ยท Create a Feishu Bot

Feishu / Lark (Recommended โ€” WebSocket, no public IP needed)
  1. Go to Feishu Open Platform โ†’ Create Custom App
  2. Enable Bot capability in App Features
  3. Add permissions: im:message ยท im:message:send_as_bot
  4. Event Subscription โ†’ select Long Connection โ†’ add im.message.receive_v1
  5. Note your App ID (cli_xxx) and App Secret โ†’ Publish the app

Note: Feishu requires an active WebSocket connection before you can save "Long Connection" mode. Start nanobot first (Step 3), then come back to configure Event Subscription.

Step 2 ยท Configure

cp nanobot_config.json.example nanobot_config.json

Edit nanobot_config.json โ€” fill in the 3 required fields:

{
  "channels": {
    "feishu": {
      "enabled": true,
      "appId": "cli_xxx",              // โ† Feishu App ID
      "appSecret": "xxx",              // โ† Feishu App Secret
      "allowFrom": []                  // [] = allow all users
    }
  },
  "providers": {
    "openrouter": {
      "apiKey": "sk-or-v1-xxx"         // โ† OpenRouter API Key
    }
  },
  "agents": {
    "defaults": {
      "model": "anthropic/claude-sonnet-4-20250514"
    }
  }
}

Model choice: Any model on openrouter.ai/models. Use anthropic/claude-sonnet-4-20250514 for English, minimax/minimax-m2.1 for Chinese.


Step 3 ยท Launch

Make sure mcp_agent.secrets.yaml has your DeepCode API keys (see Configuration), then:

./nanobot/run_nanobot.sh -d          # Start both DeepCode + nanobot in background

The script checks Docker, validates configs, builds images (first run only), and starts both containers.

โœ“ DeepCode API:  http://localhost:8000
โœ“ Nanobot:       http://localhost:18790

Now open Feishu โ†’ find your bot โ†’ send a message!

Management Commands
./nanobot/run_nanobot.sh              # Start (foreground)
./nanobot/run_nanobot.sh -d           # Start (background)
./nanobot/run_nanobot.sh stop         # Stop all services
./nanobot/run_nanobot.sh restart      # Restart (config changes take effect immediately)
./nanobot/run_nanobot.sh --build      # Force rebuild Docker images
./nanobot/run_nanobot.sh logs         # View real-time logs
./nanobot/run_nanobot.sh status       # Health check
./nanobot/run_nanobot.sh clean        # Remove containers & images
Troubleshooting
ProblemFix
Feishu bot doesn't respondCheck logs (./nanobot/run_nanobot.sh logs), verify appId/appSecret, ensure app is published with Long Connection mode
Can't connect to DeepCodeVerify deepcode container is healthy: curl http://localhost:8000/health
Wrong language outputSwitch model โ€” minimax-m2.1 defaults to Chinese, use Claude/GPT for English
Config not taking effectJust restart: ./nanobot/run_nanobot.sh restart (no rebuild needed)
Clear chat historySend /clear in chat, or: docker exec nanobot sh -c 'rm -rf /root/.nanobot/sessions/*.jsonl'

๐Ÿ’ก Examples

๐ŸŽฌ Live Demonstrations

๐Ÿ“„ Paper2Code Demo

Research to Implementation

Paper2Code Demo

โ–ถ๏ธ Watch Demo

Transform academic papers into production-ready code automatically

๐Ÿ–ผ๏ธ Image Processing Demo

AI-Powered Image Tools

Image Processing Demo

โ–ถ๏ธ Watch Demo

Intelligent image processing with background removal and enhancement

๐ŸŒ Frontend Implementation

Complete Web Application

Frontend Demo

โ–ถ๏ธ Watch Demo

Full-stack web development from concept to deployment

๐Ÿ†• Recent Updates

๐Ÿ“„ Smart Document Segmentation (v1.2.0)

  • Intelligent Processing: Automatically handles large research papers and technical documents that exceed LLM token limits
  • Configurable Control: Toggle segmentation via configuration with size-based thresholds
  • Semantic Analysis: Advanced content understanding with algorithm, concept, and formula preservation
  • Backward Compatibility: Seamlessly falls back to traditional processing for smaller documents

๐Ÿš€ Coming Soon

We're continuously enhancing DeepCode with exciting new features:

๐Ÿ”ง Enhanced Code Reliability & Validation

  • Automated Testing: Comprehensive functionality testing with execution verification and error detection.
  • Code Quality Assurance: Multi-level validation through static analysis, dynamic testing, and performance benchmarking.
  • Smart Debugging: AI-powered error detection with automatic correction suggestions

๐Ÿ“Š PaperBench Performance Showcase

  • Benchmark Dashboard: Comprehensive performance metrics on the PaperBench evaluation suite.
  • Accuracy Metrics: Detailed comparison with state-of-the-art paper reproduction systems.
  • Success Analytics: Statistical analysis across paper categories and complexity levels.

โšก System-wide Optimizations

  • Performance Boost: Multi-threaded processing and optimized agent coordination for faster generation.
  • Enhanced Reasoning: Advanced reasoning capabilities with improved context understanding.
  • Expanded Support: Extended compatibility with additional programming languages and frameworks.

โญ Star History

Community Growth Trajectory

Star History Chart

๐Ÿš€ Ready to Transform Development?

Get Started View on GitHub Star Project


๐Ÿ“– Citation

If you find DeepCode useful in your research or applications, please kindly cite:

@misc{li2025deepcodeopenagenticcoding,
      title={DeepCode: Open Agentic Coding},
      author={Zongwei Li and Zhonghang Li and Zirui Guo and Xubin Ren and Chao Huang},
      year={2025},
      eprint={2512.07921},
      archivePrefix={arXiv},
      primaryClass={cs.SE},
      url={https://arxiv.org/abs/2512.07921},
}

๐Ÿ“„ License

MIT License

MIT License - Copyright (c) 2025 Data Intelligence Lab, The University of Hong Kong


Visitors