Configuration Guide
Relevant source files
The following files were used as context for generating this wiki page:
The Configuration Guide provides a comprehensive overview of the settings and parameters required to operate the DeepCode agentic system. DeepCode is an open-source platform designed to revolutionize research reproducibility by automating the implementation of complex algorithms from academic papers through a multi-agent architecture.
This guide covers the configuration of LLM clients, memory management strategies, workflow parameters, and user interface customizations. The system relies on structured YAML/JSON configurations and specialized prompts to orchestrate agents for paper analysis, code planning, and production-grade implementation.
Sources: ui/components.py:12-24, workflows/code_implementation_workflow.py:12-20
LLM Client Configuration
DeepCode supports multiple LLM providers, primarily Anthropic and OpenAI. The system dynamically selects a client based on the availability of API keys and configuration parameters defined in secrets and config files.
Provider Settings
The workflow manager initializes clients by checking mcp_agent.secrets.yaml for valid keys. It prioritizes Anthropic (Claude-3.5-Sonnet) and falls back to OpenAI (GPT-4o) if necessary.
| Provider | Default Model | Configuration File |
|---|---|---|
| Anthropic | claude-sonnet-4-20250514 | mcp_agent.config.yaml |
| OpenAI | gpt-4o | mcp_agent.config.yaml |
Sources: workflows/agents/memory_agent_concise.py:59-62, workflows/code_implementation_workflow.py:325-342
Model Parameters
LLM calls are configured with specific hyperparameters to ensure precision in code generation and summarization tasks.
- Max Tokens: Configured up to 8192 for code implementation and 5000 for summaries.
- Temperature: Set to
0.2for deterministic and accurate code synthesis.
Sources: workflows/code_implementation_workflow.py:355-360, workflows/agents/memory_agent_concise.py:307-310
Workflow & Memory Management
DeepCode utilizes a "Concise Memory" strategy to handle long-running development sessions without hitting token limits.
Memory Optimization Logic
The ConciseMemoryAgent implements a clean-slate approach triggered by specific tool calls.
- Initial State: Preserves the
system_promptand theinitial_plan. - Trigger: Once a
write_filetool call is detected, the conversation history is optimized. - Retention: Only essential tool results (e.g.,
read_code_mem,execute_python) and the current round's context are kept.
This diagram shows the iterative cycle of the memory management system.
Sources: workflows/agents/memory_agent_concise.py:12-25, workflows/agents/memory_agent_concise.py:527-548
Workflow Phase Configuration
Implementation is divided into logical phases extracted from the initial_plan.txt. The workflow manager tracks progress through these phases to ensure architectural consistency.
Sources: workflows/agents/memory_agent_concise.py:97-124
Agent Prompt Configuration
Prompts are stored as structured templates in prompts/code_prompts.py. They define the behavior and constraints for specialized agents.
Core Implementation Prompts
- PURE_CODE_IMPLEMENTATION_SYSTEM_PROMPT: Sets the persona for an expert engineer focused on academic reproduction.
- CODE_PLANNING_PROMPT: Directs the synthesis of paper analysis into a file structure and implementation roadmap.
- STRUCTURE_GENERATOR_PROMPT: Provides rules for generating shell commands (
mkdir,touch) to scaffold the project.
Technical Detail Extraction
The PAPER_ALGORITHM_ANALYSIS_PROMPT configures the agent to use a "Segmented Reading Strategy" to avoid token limits when processing large documents.
Sources: prompts/code_prompts.py:127-142, prompts/code_prompts.py:465-475
UI and Visualization Configuration
The DeepCode interface is built with Streamlit and features a "Dark Tech" aesthetic. Configuration of the UI components is managed via ui/components.py and ui/styles.py.
Style Customization
The UI uses CSS variables for theme consistency, supporting both high-contrast dark modes and modern glassmorphism effects.
UI_Theme:
Primary_BG: "#0a0e27"
Neon_Cyan: "#4dd0e1"
Neon_Purple: "#ba68c8"
Fonts: ["JetBrains Mono", "Inter"]
Sources: ui/styles.py:15-32
Feature Toggle
Users can configure the workflow behavior through a sidebar control panel, such as toggling the "Codebase Indexing" feature which affects phases 6 and 7 of the processing pipeline.
Sources: ui/components.py:345-365
Workspace Configuration
The system uses Model Context Protocol (MCP) servers to manage the development environment.
| Component | Purpose | Tool Interface |
|---|---|---|
code-implementation | File writing and bash execution | write_file, execute_bash |
command-executor | Project scaffolding | execute_commands |
code-reference-indexer | Context retrieval | read_code_mem, search_code |
Sources: workflows/code_implementation_workflow_index.py:153-165, workflows/code_implementation_workflow_index.py:270-285
Conclusion
The Configuration Guide ensures that the DeepCode system is tuned for high-fidelity code reproduction. By balancing aggressive memory optimization with detailed agent instruction sets, the system can implement entire research papers into working codebases while maintaining technical accuracy and production standards.
Sources: workflows/code_implementation_workflow.py:590-610