DeepSeek Engineer v2 🐋
Overview
DeepSeek Engineer v2 is a powerful AI-powered coding assistant that provides an interactive terminal interface for seamless code development. It integrates with DeepSeek's advanced reasoning models to offer intelligent file operations, code analysis, and development assistance through natural conversation and function calling.
🚀 Latest Update: Function Calling Architecture
Version 2.0 introduces a big upgrade from structured JSON output to native function calling, providing:
- Natural conversations with the AI without rigid response formats
- Automatic file operations through intelligent function calls
- Real-time reasoning visibility with Chain of Thought (CoT) capabilities
- Enhanced reliability and better error handling
Key Features
🧠 AI Capabilities
- Elite Software Engineering: Decades of experience across all programming domains
- Chain of Thought Reasoning: Visible thought process before providing solutions
- Code Analysis & Discussion: Expert-level insights and optimization suggestions
- Intelligent Problem Solving: Automatic file reading and context understanding
🛠️ Function Calling Tools
The AI can automatically execute these operations when needed:
read_file(file_path: str)
- Read single file content with automatic path normalization
- Built-in error handling for missing or inaccessible files
- Automatic: AI can read any file you mention or reference in conversation
read_multiple_files(file_paths: List[str])
- Batch read multiple files efficiently
- Formatted output with clear file separators
create_file(file_path: str, content: str)
- Create new files or overwrite existing ones
- Automatic directory creation and safety checks
create_multiple_files(files: List[Dict])
- Create multiple files in a single operation
- Perfect for scaffolding projects or creating related files
edit_file(file_path: str, original_snippet: str, new_snippet: str)
- Precise snippet-based file editing
- Safe replacement with exact matching
📁 File Operations
Automatic File Reading (Recommended)
The AI can automatically read files you mention:
You> Can you review the main.py file and suggest improvements?
→ AI automatically calls read_file("main.py")
You> Look at src/utils.py and tests/test_utils.py
→ AI automatically calls read_multiple_files(["src/utils.py", "tests/test_utils.py"])
Manual Context Addition (Optional)
For when you want to preload files into conversation context:
/add path/to/file- Include single file in conversation context/add path/to/folder- Include entire directory (with smart filtering)
Note: The /add command is mainly useful when you want to provide extra context upfront. The AI can read files automatically via function calls whenever needed during the conversation.
🎨 Rich Terminal Interface
- Color-coded feedback (green for success, red for errors, yellow for warnings)
- Real-time streaming with visible reasoning process
- Structured tables for diff previews
- Progress indicators for long operations
🛡️ Security & Safety
- Path normalization and validation
- Directory traversal protection
- File size limits (5MB per file)
- Binary file detection and exclusion
Getting Started
Prerequisites
- DeepSeek API Key: Get your API key from DeepSeek Platform
- Python 3.11+: Required for optimal performance
Installation
-
Clone the repository:
git clone cd deepseek-engineer -
Set up environment:
# Create .env file echo "DEEPSEEK_API_KEY=your_api_key_here" > .env -
Install dependencies (choose one method):
Using uv (recommended - faster)
uv venv uv run deepseek-eng.pyUsing pip
pip install -r requirements.txt python3 deepseek-eng.py
Usage Examples
Natural Conversation with Automatic File Operations
You> Can you read the main.py file and create a test file for it?
💭 Reasoning: I need to first read the main.py file to understand its structure...
🤖 Assistant> I'll read the main.py file first to understand its structure.
⚡ Executing 1 function call(s)...
→ read_file
✓ Read file 'main.py'
🔄 Processing results...
Now I'll create comprehensive tests based on the code structure I found.
⚡ Executing 1 function call(s)...
→ create_file
✓ Created/updated file at 'test_main.py'
I've analyzed main.py and created comprehensive tests covering all the main functions...
Automatic Multi-File Analysis
You> Compare the implementation in utils.py with the tests in test_utils.py
💭 Reasoning: I need to read both files to compare them...
🤖 Assistant> I'll read both files to analyze the implementation and tests.
⚡ Executing 1 function call(s)...
→ read_multiple_files
✓ Read files: utils.py, test_utils.py
🔄 Processing results...
After analyzing both files, I can see several areas where the tests could be improved...
Manual Context Loading (Optional)
You> /add src/
✓ Added folder 'src/' to conversation.
📁 Added files: (15 files)
📄 src/utils.py
📄 src/models.py
...
You> Now review this codebase structure
🤖 Assistant> I've reviewed your codebase and found several areas for improvement:
1. **Error Handling**: The utils.py file could benefit from more robust error handling...
Technical Details
Model: DeepSeek-Reasoner
- Powered by DeepSeek-R1 with Chain-of-Thought reasoning
- Real-time reasoning visibility during processing
- Enhanced problem-solving capabilities
Function Call Execution Flow
- User Input → Natural language request
- AI Reasoning → Visible thought process (CoT)
- Function Calls → Automatic tool execution
- Real-time Feedback → Operation status and results
- Follow-up Response → AI processes results and responds
Streaming Architecture
- Triple-stream processing: reasoning + content + tool_calls
- Real-time tool execution during streaming
- Automatic follow-up responses after tool completion
- Error recovery and graceful degradation
Advanced Features
Intelligent Context Management
- Automatic file detection from user messages
- Smart conversation cleanup to prevent token overflow
- File content preservation across conversation history
- Tool message integration for complete operation tracking
Batch Operations
You> Create a complete Flask API with models, routes, and tests
🤖 Assistant> I'll create a complete Flask API structure for you.
⚡ Executing 1 function call(s)...
→ create_multiple_files
✓ Created 4 files: app.py, models.py, routes.py, test_api.py
Project Analysis
You> /add .
You> Analyze this entire project and suggest a refactoring plan
🤖 Assistant> ⚡ Executing 1 function call(s)...
→ read_multiple_files
Based on my analysis of your project, here's a comprehensive refactoring plan...
File Operations Comparison
| Method | When to Use | How It Works |
|---|---|---|
| Automatic Reading | Most cases - just mention files | AI automatically calls read_file() when you reference files |
/add Command |
Preload context, bulk operations | Manually adds files to conversation context upfront |
Recommendation: Use natural conversation - the AI will automatically read files as needed. Use /add only when you want to provide extra context upfront.
Troubleshooting
Common Issues
API Key Not Found
# Make sure .env file exists with your API key
echo "DEEPSEEK_API_KEY=your_key_here" > .env
Import Errors
# Install dependencies
uv sync # or pip install -r requirements.txt
File Permission Errors
- Ensure you have write permissions in the working directory
- Check file paths are correct and accessible
Contributing
This is an experimental project showcasing DeepSeek reasoning model capabilities. Contributions are welcome!
Development Setup
git clone
cd deepseek-engineer
uv venv
uv sync
Run
# Run the application (preferred)
uv run deepseek-eng.py
or
python3 deepseek-eng.py
License
This project is licensed under the MIT License - see the LICENSE file for details.
This project is experimental and developed for testing DeepSeek reasoning model capabilities.
Note: This is an experimental project developed to explore the capabilities of DeepSeek's reasoning model with function calling. The AI can automatically read files you mention in conversation, while the
/addcommand is available for when you want to preload context. Use responsibly and enjoy the enhanced AI pair programming experience! 🚀