DAA — Debugging
Autonomous Agent
Your app breaks at 3 AM. DAA investigates the root cause and opens a pull request — while you sleep.
How It Works
DAA runs a fully autonomous pipeline from error detection to pull request — no human in the loop until code review.
4-Dimension Investigation
The AI agent investigates across multiple signal dimensions to build a complete picture:
Git History
What changed recently? Correlates commits with the error timeline.
App Logs
Full stack trace analysis and correlated multi-service log queries.
Traces
Which request triggered the error? Distributed trace correlation.
Source Code
AST navigation to the exact line. Surgical 5-tier code retrieval.
What Makes DAA Different
Traditional Alerting
- Fires every time the error happens
- Tells you "Error occurred"
- You investigate manually
- 3 AM pages every time
DAA
- Once per unique error pattern
- Root cause + code fix
- Review a PR
- Only for genuinely new problems
Features
Zero Alert Fatigue
SHA-256 fingerprint dedup + sliding-window cooldowns. Same error twice? Suppressed silently.
4-Dimension Investigation
Git history · Logs · Traces · AST code navigation. Complete signal coverage.
Agent Safety
Hard 8-tool-call budget cap — no runaway LLM costs. No destructive operations.
Any LLM
Gemini · GPT-4o · Claude · Vertex AI · Ollama (air-gapped). Switch with one env var.
Human-in-the-Loop
Approve AI fixes via the Admin Panel or MCP before the PR lands. Full control.
Any Git Forge
GitHub · GitLab · Gitea · Bitbucket. Pluggable forge-agnostic interface.
MCP Compatible
Use DAA as a tool inside Claude Desktop, Cursor, or any MCP-compatible client.
Multi-Language SDKs
Python · Node.js · Go · Java · Ruby · .NET. One-line instrumentation.
Zero-SDK Webhooks
Point Sentry, Prometheus, Datadog, CloudWatch, PagerDuty at DAA. No code changes.
Quickstart
Get up and running with DAA in under 60 seconds. Choose your deployment mode:
Prerequisites: Docker installed, a free Gemini API key, and a GitHub Personal Access Token with repo scope.
Start DAA (Serverless — 1 Command)
No databases or queues required. Stateless webhook receiver.
docker run -d --name daa \ -p 8000:8080 \ -e LLM_PROVIDER=google \ -e GEMINI_API_KEY="your_api_key_here" \ -e LLM_MODEL="gemini-2.5-flash" \ -e DAA_DB_PROVIDER=none \ -e DAA_GIT_TOKEN="github_pat_..." \ -e GIT_HOST="https://github.com" \ -e GIT_ORG="your-github-username" \ rutvej1/daa-standalone:latest
git clone https://github.com/rutvej/DAA.git cd DAA cp .env.example .env # Edit with your credentials docker compose up -d
curl -sSL https://raw.githubusercontent.com/rutvej/DAA/main/install.sh | bash daa init # Interactive setup wizard
Verify DAA is Running
curl http://localhost:8000/health
# → {"status": "ok"}
Trigger a Test Incident
Simulate a webhook from Prometheus/Sentry:
curl -X POST http://localhost:8000/ingest/generic \
-H "Content-Type: application/json" \
-d '{
"title": "ZeroDivisionError in calculator.py:15",
"stack_trace": "Traceback (most recent call last):\n File \"calculator.py\", line 15\nZeroDivisionError: division by zero",
"app_name": "test-app",
"severity": "critical"
}'
Watch the Magic
DAA investigates, finds root cause, writes a fix, and opens a PR — all in under 90 seconds.
docker logs -f daa # Watch in real-time
Tip: Use daa test from the CLI for an even faster synthetic incident trigger!
Architecture
DAA integrates into your existing observability stack. Here's the high-level event pipeline:
┌──────────────┐ ┌──────────────────┐ ┌────────────────┐
│ Production │ ──► │ DAA Ingestion │ ──► │ Agent Worker │
│ Service │ webhook │ (FastAPI) │ queue │ (LangChain │
│ │ │ │ │ ReAct Agent) │
└──────────────┘ └──────────────────┘ └───────┬────────┘
│
┌────────────────▼────────────────┐
│ Tool Executor │
│ git_log · read_file · grep │
│ run_tests · write_patch │
│ create_branch · open_pr │
└────────────────────────────────┘
Project Structure
DAA/ ├── app/ │ ├── backend-api/ ← FastAPI: ingest, dedup, incident tracking │ ├── python-agent/ ← LangChain ReAct SRE agent (the brain) │ ├── admin-panel/ ← React dashboard (incidents, apps, config) │ ├── daa-sdk/ ← Python SDK (+ Node/Go/Java/Ruby/.NET) │ ├── common/ ← Shared DB, config, queue, fingerprint utils │ └── daa_mcp_server.py ← MCP server for Claude Desktop / Cursor ├── daa ← CLI tool (daa init / register / test / logs) ├── docker-compose.yml ← Full-stack deployment ├── Dockerfile ← Single-container build ├── install.sh ← One-line installer └── docs/ ← Documentation
Component Status
| Component | Tech | Status |
|---|---|---|
| Backend API | FastAPI 0.100+ | Stable |
| SRE Agent | LangChain ReAct | Stable |
| Admin Panel | React 18 | Beta |
| Python SDK | requests | Stable |
| MCP Server | FastMCP / JSON-RPC | Stable |
| CLI Tool | Bash | Stable |
| Docker Image | python:3.11-alpine | Stable |
AI Agent Deep Dive
The SRE agent uses a 3-phase pipeline with a LangChain ReAct loop at its core:
- Pre-flight: Fingerprint dedup, repo cache, log hydration, context packaging
- Agent Core: LLM-powered ReAct loop with tool execution (hard budget cap)
- Post-flight: Parse output, apply diff, create branch/PR, generate postmortem
Agent Tool Inventory
| Tool | Purpose | Category |
|---|---|---|
check_recent_changes | View recent git commits | Change Horizon |
view_file_slice | Read specific file sections | Code Navigation |
grep_search | Search across codebase | Code Navigation |
find_symbol | AST symbol lookup | Code Navigation |
read_repomap | Skeletonized repo overview | Code Navigation |
query_correlated_logs | Multi-service trace correlation | Log Horizon |
check_alerts | Infrastructure alert check | Infra Horizon |
run_tests | Execute test suite | Diagnostic |
write_patch | Generate code fix | Remediation |
create_branch_and_pr | Push branch + open PR | Remediation |
Budget Cap: The agent has a hard limit of 8 tool calls per investigation (configurable via DAA_MAX_TOOL_CALLS). This prevents runaway LLM costs and forces focused investigation.
Deduplication Engine
DAA uses SHA-256 fingerprinting to eliminate alert fatigue:
fingerprint = SHA-256( app_name : exception_type : normalized_top_frame )
if fingerprint seen within cooldown window (default 3600s):
→ return 200 "suppressed"
else:
→ create incident
→ enqueue for investigation
Fingerprints are normalized to strip volatile data (hex addresses, timestamps, variable line numbers) ensuring deterministic matching.
Deployment
| Mode | Components | Storage | Best For |
|---|---|---|---|
| Serverless | Single container, in-memory | None / SQLite | Demos, small teams, Cloud Run |
| Full-Stack | API + Worker + Postgres + RabbitMQ + Admin UI | PostgreSQL | Production, multi-app |
| Cloud | Container on managed platform | None (stateless) | Cloud Run, Fargate, Azure |
Full-Stack Docker Compose
For production with persistence, async queue, and admin UI:
git clone https://github.com/rutvej/DAA.git cd DAA cp .env.example .env # Edit with your credentials docker compose up -d # Access points: # API: http://localhost:8000 # Admin Panel: http://localhost:5003 # RabbitMQ UI: http://localhost:15672
Services in Docker Compose
| Service | Image | Port | Purpose |
|---|---|---|---|
backend-api | Custom build | 8000 | FastAPI backend |
python-agent | Custom build | — | LangChain agent worker |
postgres | postgres:13 | 5433 | Incident database |
rabbitmq | rabbitmq:3-management | 5672, 15672 | Async task queue |
admin-panel | Custom build | 5003 | React dashboard |
mcp-server | python:3.11-slim | — | MCP integration |
Cloud Deployment
gcloud run deploy daa \ --image rutvej1/daa-standalone:latest \ --port 8080 \ --set-env-vars LLM_PROVIDER=google \ --set-env-vars GEMINI_API_KEY=your-key \ --set-env-vars LLM_MODEL=gemini-2.5-flash \ --set-env-vars DAA_DB_PROVIDER=none \ --set-env-vars DAA_GIT_TOKEN=your-token \ --set-env-vars GIT_HOST=https://github.com \ --set-env-vars GIT_ORG=your-org \ --allow-unauthenticated
# Use ECS task definition with: # Image: rutvej1/daa-standalone:latest # Port: 8080 # Environment variables same as above # DAA_DB_PROVIDER=none for stateless mode
SDK
Instrument your app with a single line of code. The SDK catches exceptions and sends them to DAA.
# pip install daa-sdk
from daa_sdk import DaaSdk
# Auto-reads DAA_BACKEND_API_URL and DAA_TOKEN from env
daa = DaaSdk()
# Report a caught exception
try:
risky_operation()
except Exception as e:
daa.capture_exception(e)
from daa_sdk.integrations import flask_integration app = Flask(__name__) daa = DaaSdk() flask_integration(app, daa) # All unhandled exceptions now auto-report to DAA
# settings.py
MIDDLEWARE = [
'daa_sdk.integrations.DjangoDAAMiddleware',
# ... other middleware
]
from daa_sdk.integrations import fastapi_integration app = FastAPI() daa = DaaSdk() fastapi_integration(app, daa)
SDK Environment Variables
| Variable | Description |
|---|---|
DAA_BACKEND_API_URL | DAA server URL (e.g., http://localhost:8000) |
DAA_TOKEN | Application token from daa register |
REPO_NAME | Repository name for context |
Webhook Integrations
Point your existing alerting tools at DAA — no SDK or code changes required.
# alertmanager.yml
receivers:
- name: daa
webhook_configs:
- url: 'http://your-daa:8000/ingest/prometheus'
send_resolved: true
http_config:
headers:
X-API-Key: your-api-key
# Sentry Project Settings → Integrations → Webhooks # # URL: http://your-daa:8000/ingest/sentry # Secret: your-sentry-webhook-secret # Events: issue.created, event.alert # # DAA verifies HMAC-SHA256 signature automatically
# Datadog → Integrations → Webhooks → New Webhook
#
# Name: DAA
# URL: http://your-daa:8000/ingest/generic
# Headers: {"X-API-Key": "your-api-key"}
# Payload: {
# "title": "$EVENT_TITLE",
# "body": "$EVENT_MSG",
# "severity": "$ALERT_TYPE"
# }
curl -X POST http://your-daa:8000/ingest/generic \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{
"title": "Error in payment service",
"stack_trace": "Traceback (most recent call last)...",
"app_name": "payment-svc",
"severity": "critical"
}'
Supported Sources
MCP Server
Use DAA as a tool inside Claude Desktop, Cursor, or any MCP-compatible AI client.
Available MCP Tools
| Tool | Description |
|---|---|
get_fixes_awaiting_approval | List all fixes pending human approval |
get_incident_postmortem | Get postmortem & PR URL for a fix |
approve_remediation_fix | Approve a fix and trigger PR creation |
get_active_incidents | List incidents currently being processed |
get_fix_by_fingerprint | Look up fix by SHA-256 fingerprint |
list_registered_apps | List all registered applications |
trigger_manual_incident | Fire a synthetic test incident |
get_incident_context_for_pr | Get 4-DIM telemetry for a PR URL |
fetch_pull_request_diff | Fetch PR diff for review |
submit_pr_review_comments | Post review comments on a PR |
trigger_reinvestigation | Trigger re-investigation with new context |
Claude Desktop Configuration
{
"mcpServers": {
"daa": {
"command": "python",
"args": ["/path/to/app/daa_mcp_server.py"],
"env": {
"DAA_HOST": "http://localhost:8000",
"DAA_API_KEY": "your-api-key"
}
}
}
}
Git Integration
Supported Forges
| Forge | Status | Config |
|---|---|---|
| GitHub | Stable | GIT_PROVIDER=github |
| GitLab | Stable | GIT_PROVIDER=gitlab |
| Gitea | Stable | GIT_PROVIDER=gitea |
| Bitbucket | Stable | GIT_PROVIDER=bitbucket |
Workspace Modes
| Mode | ENV | Behaviour |
|---|---|---|
| Local Clone | DAA_GIT_MODE=local | Clones repo locally. Faster, full git operations. |
| API Only | DAA_GIT_MODE=api | Reads files via forge REST API. No local clone — ideal for serverless. |
REST API Reference
Base URL: http://your-daa:8000
Health & Status
Ingestion
Incidents
Fixes
Applications
Alerts
Authentication
Real-time Streaming
CLI Reference
The daa CLI provides complete management of your DAA installation.
| Command | Description |
|---|---|
daa init | Interactive 5-step setup wizard (LLM, Git, DB, Queue, Logging) |
daa register | Register an application and get its DAA_TOKEN |
daa policy | Set escalation threshold (e.g., 3 errors in 60s) |
daa test | Fire a synthetic error and watch the pipeline |
daa logs | View/stream recent incidents |
daa status | Health check all services |
daa redeploy | Rebuild and restart all containers |
daa config set-model | Switch LLM provider/model |
daa config set-git | Update git provider/token |
daa config show | Show current configuration |
daa mcp list | List configured MCP servers |
daa mcp add | Add external MCP server |
daa version | Print DAA version |
daa uninstall | Remove DAA |
Configuration Reference
All configuration is via environment variables. Copy .env.example to .env and customize.
LLM Provider
| Variable | Default | Description |
|---|---|---|
| LLM_PROVIDER | google | Provider: google, openai, anthropic, ollama, vertex |
| GEMINI_API_KEY | — | Gemini API key (required if google) |
| OPENAI_API_KEY | — | OpenAI API key (required if openai) |
| ANTHROPIC_API_KEY | — | Anthropic API key (required if anthropic) |
| OLLAMA_HOST | http://localhost:11434 | Ollama server URL |
| LLM_MODEL | Provider default | Override model name (e.g. gemini-2.5-flash, gpt-4o, claude-sonnet-4-20250514) |
Database & Queue
| Variable | Default | Description |
|---|---|---|
| DAA_DB_PROVIDER | sqlite | none / sqlite / postgres / internal-postgres |
| DATABASE_URL | — | PostgreSQL connection string |
| DAA_QUEUE_MODE | sync | sync (inline) or rabbitmq |
| RABBITMQ_HOST | — | RabbitMQ hostname |
Git Integration
| Variable | Default | Description |
|---|---|---|
| DAA_GIT_TOKEN | — | Git forge personal access token |
| GIT_HOST | https://github.com | Git forge URL |
| GIT_ORG | — | Default git org/user |
| GIT_PROVIDER | github | github / gitlab / gitea / bitbucket |
| DAA_GIT_MODE | local | local (clone) or api (REST only) |
Security & Auth
| Variable | Default | Description |
|---|---|---|
| DAA_AUTH_ENABLED | false | Enable JWT auth for SDK/API endpoints |
| DAA_API_KEY | — | API key for webhook endpoints |
| SECRET_KEY | — | JWT signing key |
| CORS_ALLOW_ORIGINS | * | CORS origins allowlist |
| SENTRY_WEBHOOK_SECRET | — | Sentry HMAC verification secret |
Agent Configuration
| Variable | Default | Description |
|---|---|---|
| DAA_MAX_TOOL_CALLS | 8 | Hard cap on agent tool calls per investigation |
| DAA_MAX_ITERATIONS | 10 | Max ReAct loop iterations |
| DAA_AGENT_MODE | full | full (4-dim) or fast (bug-fix only) |
| DAA_COOLDOWN_SECONDS | 3600 | Dedup cooldown window (seconds) |
| DAA_HITL_MODE | false | Human-in-the-loop approval mode |
Security
Self-hosted and private by design. Your code never leaves your infrastructure (except to the LLM provider you choose).
Credentials via Env Only
Never stored in container filesystem. Never logged. Rotatable without downtime.
CORS & Webhook Auth
Strict origin allowlist. API key enforcement. Sentry HMAC-SHA256 verification.
Agent Budget Cap
Hard 8-tool-call limit. No destructive tools. All operations on isolated branches.
Docker Hardened
Non-root user. Minimal alpine base. Pinned deps. Trivy-scanned images.
Security Hardening Checklist
- Set
CORS_ALLOW_ORIGINSto your specific domains - Enable
DAA_AUTH_ENABLED=truefor SDK endpoints - Use a strong
DAA_API_KEYfor webhook endpoints - Deploy behind a reverse proxy (nginx, Caddy, Traefik)
- Use HTTPS in production
- Restrict Docker network access
- Rotate git tokens regularly
Report vulnerabilities: Please use GitHub Security Advisories. Do NOT open public issues for security reports.
Performance
| Metric | Value |
|---|---|
| Alert ingestion latency | < 50ms |
| Dedup lookup | < 5ms |
| Agent investigation (Gemini Flash) | 30–90s |
| Agent investigation (GPT-4o) | 45–120s |
| PR creation | < 10s |
| Memory usage (idle) | ~150 MB |
| Memory usage (active) | ~500 MB |
| Docker image | Multi-arch (amd64 + arm64) |
Roadmap
v3.1 — Next
- Multi-language agent (JavaScript, Go, Java)
- Slack / Teams notifications
- Incident clustering & trend analysis
v3.2
- Kubernetes operator
- Auto-scaling workers
- Fine-tuned models for common error patterns
v4.0 — Vision
- Multi-repo investigation (cross-service root cause)
- Automated rollback integration
- Self-improving agent (learns from merged PRs)
Contributing
PRs welcome! For large changes, open an issue first to align on the approach.
# Development Setup git clone https://github.com/rutvej/DAA.git cd DAA python -m venv .venv source .venv/bin/activate pip install -r requirements.txt # Run tests python -m pytest test.py -v # Linting ruff check .