SWEDeepDiver is an automated analysis agent for Software Engineering (SWE) problems.
Project description
SWEDeepDiver
SWEDeepDiver is an automated analysis agent for Software Engineering (SWE) problems, designed to perform deep diagnosis and root cause analysis for multi-technology stack issues including Android, iOS, Backend, and Frontend.
It simulates experienced engineers' troubleshooting habits: from whole to part, from symptoms to root causes, comprehensively utilizing logs, exception traces, various issue files, source code, and knowledge bases to build "timeline + evidence chains", ultimately providing structured, verifiable diagnostic conclusions.
โจ Features
Core Capabilities
- ๐ค Automated Problem Diagnosis: Simulates experienced engineers' troubleshooting approach using ReAct (Reasoning + Acting) architecture
- ๐ Multi-source Evidence Analysis: Correlates logs, exception traces, issue files, source code, and knowledge bases
- ๐ Structured Reasoning: Builds verifiable "timeline + evidence chain" for root cause analysis
- ๐ฏ Multi-technology Stack: Supports Android, iOS, backend (Java, Python, Node.js, etc.), and frontend
- ๐พ Zero-intrusion Design: All state saved in
~/.deepdiver/, no files written to user projects - ๐ Session Management: Independent sessions, fully traceable and reproducible
- ๐ Plugin System: Custom desensitization, decryption, and filtering strategies
- ๐ Knowledge Base Integration: Domain-specific knowledge injection for better accuracy
- ๐ Multi-LLM Support: DeepSeek, Moonshot, Alibaba Tongyi, OpenRouter, and more
๐ New in v0.2.0
Modern UI & Real-time Feedback
- ๐ฅ๏ธ Rich Terminal UI: Beautiful, informative terminal interface powered by Rich library
- ๐ Real-time Progress Tracking: Watch the agent think, explore, and analyze in real-time
- ๐ก Key Finding Highlights: Important discoveries are highlighted as they happen
- ๐๏ธ Dual Display Modes:
- Concise Mode: Clean output with just the essentials
- Verbose Mode: Detailed thinking process and tool outputs
- Press
vduring runtime to toggle between modes
- ๐ ๏ธ Smart Tool Display: Tool calls show only key parameters for clarity
Enhanced Reporting
- ๐ Interactive HTML Reports: Professional reports with collapsible sections and mobile-responsive design
- ๐ Structured Output Formats: JSON for machine processing, Markdown for documentation, HTML for presentation
- ๐ Enhanced Metadata: Includes commit counts, review results, and confidence scores
Improved Analysis Tools
- โฑ๏ธ Time-Range Filtering: Filter logs by time windows for focused analysis
- ๐ Better Grep Results: Shows total/returned line counts with truncation warnings
- ๐ Enhanced Read Tool: File size and line count information for better context
- ๐งช Improved Review Process: Better separation between LLM summaries and user-facing details
Installation
Using uv (Recommended)
uv is a fast Python package installer and resolver written in Rust. It's the recommended way to install SWEDeepDiver:
# Install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install SWEDeepDiver using uv tool
uv tool install deepdiver-cli
Using pip (Alternative)
pip install deepdiver-cli
Additional Requirements
SWEDeepDiver requires ripgrep for efficient file searching:
# On macOS
brew install ripgrep
# On Ubuntu/Debian
sudo apt-get install ripgrep
# Other platforms: refer to ripgrep installation guide
For code analysis functionality, Claude Code CLI is optional:
npm install -g @anthropic-ai/claude-code
Quick Start
Basic Usage
# Analyze issue with code directory (current directory as code)
cd /path/to/your/code
deepdiver -c --attachment_path /path/to/issue/attachments --issue "Application crashes on startup"
# Analyze issue from attachment directory
cd /path/to/issue/attachments
deepdiver --code_path /path/to/your/code --issue "Performance degradation in payment service"
# Analyze attachments only (no code)
cd /path/to/issue/attachments
deepdiver --issue "Database connection timeout errors"
UI Interaction
During analysis, SWEDeepDiver provides real-time feedback:
Step 1: Thinking...
๐ก Key Finding: Exception trace indicates database connection timeout
Step 1: Grep(/var/log/app.log, "Connection timeout")
โฟ Grep found 15 result(s)
Step 2: Inspect(/var/log/app.log)
โฟ Inspected /var/log/app.log
[Press 'v' to toggle verbose/concise mode]
Press v anytime during analysis to toggle between:
- Concise Mode (default): Clean output with tool summaries
- Verbose Mode: Full thinking process and detailed tool outputs
Parameter Reference
-c,--code: Declare current working directory as code directory--code-path <PATH>: Additional code directories (multiple allowed)--attachment-path <PATH>: Attachment directories (multiple allowed)--issue "<TEXT>": Problem description in natural language--verbose: Start in verbose mode (show detailed thinking and tool outputs)--list-sessions: List historical diagnosis sessions--show-report <session_id>: Show diagnostic report for specific session
Configuration
Agent Configuration
Configuration files are automatically created on first run. The first time you run DeepDiver, it will automatically generate configuration files from templates:
# Configuration files are auto-created in ~/.deepdiver/config/
# - config.toml: Main configuration (LLM providers, API keys, model settings)
# - knowledge_config.toml: Knowledge base configuration (optional)
To manually configure or update settings:
# Edit the main configuration
# Configure LLM providers, API keys, model settings, etc.
vim ~/.deepdiver/config/config.toml
Plugin Development
Implement custom plugins for data processing:
# Example: Custom data masking
from deepdiver_cli.plugins.datamask import DataMasker
class MyDataMasker(DataMasker):
def mask(self, raw: str) -> str:
# Implement your data masking logic
return masked
The plugin system automatically discovers and loads classes implementing Protocol interfaces.
Usage Example
Analyzing an Android ANR issue:
deepdiver -c --attachment_path examples/android/anr --issue "Application experiences ANR, please analyze the cause"
SWEDeepDiver will:
- Parse problem description and attachments
- Identify problem type and evidence sources
- Call analysis tools (Glob, ProcessFile, Grep, Inspect, AnalyzeCode, etc.)
- Build timeline and evidence chains
- Generate structured diagnostic report (Markdown + JSON + HTML)
- Save all results in
~/.deepdiver/sessions/<session_id>/
Report Output:
summary.md: Executive summary with core conclusions and timelinereport.json: Complete structured data for further processingreport.html: Interactive HTML report with collapsible sectionsdiagnosis_*.md: Detailed diagnosis files with evidence chains
Output Example
**Conclusion**: ANR root cause is `HeavyService.performHeavyOperation` calling `Thread.sleep` in main thread.
**Confidence**: High
**Evidence Strength**: High
**Core Evidence**:
1. **Log/Trace Evidence**:
- `03:34:05.428` MainActivity: "Performing heavy database operation"
- `03:34:11.428` ActivityManager reports ANR for service `com.example.testapp/.HeavyService`
- ANR Trace shows main thread Sleeping at `Thread.sleep`, called by `HeavyService.performHeavyOperation`
**Timeline**:
| Time | Event | Source |
|----------------|---------------------------------------------|---------------------|
| 03:34:05.428 | Heavy operation starts | MainActivity log |
| 03:34:11.428 | ANR reported | ActivityManager log |
| 03:34:11 | Main thread blocked in sleep | ANR Trace |
Project Structure
SWEDeepDiver/
โโโ src/deepdiver_cli/ # Source code
โ โโโ react_core/ # ReAct core engine (agent, llm, tool)
โ โโโ tools/ # Analysis tools (grep, glob, read, inspect, etc.)
โ โโโ events/ # Event-driven architecture (NEW)
โ โโโ ui/ # UI rendering system (NEW)
โ โโโ app/ # Application logic
โ โโโ chat/ # Chat models and providers
โ โโโ plugins/ # Plugin interfaces (datamask, decryptor, filter)
โ โโโ templates/ # Report templates (HTML, Markdown)
โ โโโ config.py # Configuration management
โ โโโ cli.py # CLI entry point
โโโ examples/ # Example issues
โโโ config/ # Configuration templates
โโโ knowledge/ # Knowledge base directory
โโโ pyproject.toml # Python project configuration
โโโ README.md # This file
โโโ CLAUDE.md # Development guide
Technology Stack
- Python 3.12+ - Primary language
- Typer - Modern CLI framework
- Pydantic - Data validation and settings management
- Rich - Terminal UI and formatting
- OpenAI - LLM API client
- HTTPX - Async HTTP client
- Tenacity - Retry library with exponential backoff
- Structlog - Structured logging
- ReAct Pattern - Reasoning + Acting architecture for agent decision-making
- Event-Driven Architecture - Decoupled UI and business logic (NEW)
- ripgrep - Fast text search for log analysis
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
Development Setup
git clone https://github.com/SteveYang92/SWEDeepDiver.git
cd SWEDeepDiver
uv venv --python 3.12
source .venv/bin/activate # Unix/macOS
uv pip install -e ".[dev]"
uv run pytest tests/ -v
License
MIT License - see LICENSE file.
Disclaimer
Security & Privacy
- SWEDeepDiver is designed for local/self-hosted use
- Logs, traces, and source code may contain sensitive information
- Implement proper data masking/decryption plugins for your security requirements
- API keys and configurations should be kept secure
Diagnostic Limitations
- Results depend on available data, knowledge bases, and LLM capabilities
- Not guaranteed to be completely accurate in all scenarios
- Use as an auxiliary analysis tool, not the sole basis for decisions
Usage Responsibility
- Provided "as-is" without warranties
- Test thoroughly in controlled environments before production use
Acknowledgments
- Configuration system references OpenManus
- Prompt and tool design references ClaudeCode
For Chinese documentation, see README_CN.md
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deepdiver_cli-0.2.5.tar.gz.
File metadata
- Download URL: deepdiver_cli-0.2.5.tar.gz
- Upload date:
- Size: 135.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c2544b202e94ee255314594b625f52d26263d846b8068f96455123677fd7f80
|
|
| MD5 |
3460be213d428b84caf6ef7464e053ed
|
|
| BLAKE2b-256 |
a84372828a3fa02e386c967adb1a7489f9a6a7234fc0afff17f0979981084b70
|
File details
Details for the file deepdiver_cli-0.2.5-py3-none-any.whl.
File metadata
- Download URL: deepdiver_cli-0.2.5-py3-none-any.whl
- Upload date:
- Size: 170.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f1df2e8926878a6d93a70fe19917712dad3809065037cd2f1db409b0e9004e5
|
|
| MD5 |
6b26d1bcf12beab87f756811e6aeefbd
|
|
| BLAKE2b-256 |
ce9064ea29de90c4f2a169704ced77911eeaef70b52f8ba7ec456244358c963b
|