DAA — Debugging
Autonomous Agent

Your app breaks at 3 AM. DAA investigates the root cause and opens a pull request — while you sleep.

Python 3.11+ FastAPI LangChain ReAct Docker Ready MIT License

How It Works

DAA runs a fully autonomous pipeline from error detection to pull request — no human in the loop until code review.

Error Fires 3 AM crash in your app
DAA Ingests SDK or webhook sends alert
Dedup Check SHA-256 fingerprint filter
AI Investigates 4-dimension analysis
Fix & PR Code fix + pull request
You Review Wake up, merge the PR

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

ComponentTechStatus
Backend APIFastAPI 0.100+ Stable
SRE AgentLangChain ReAct Stable
Admin PanelReact 18 Beta
Python SDKrequests Stable
MCP ServerFastMCP / JSON-RPC Stable
CLI ToolBash Stable
Docker Imagepython:3.11-alpine Stable

AI Agent Deep Dive

The SRE agent uses a 3-phase pipeline with a LangChain ReAct loop at its core:

  1. Pre-flight: Fingerprint dedup, repo cache, log hydration, context packaging
  2. Agent Core: LLM-powered ReAct loop with tool execution (hard budget cap)
  3. Post-flight: Parse output, apply diff, create branch/PR, generate postmortem

Agent Tool Inventory

ToolPurposeCategory
check_recent_changesView recent git commitsChange Horizon
view_file_sliceRead specific file sectionsCode Navigation
grep_searchSearch across codebaseCode Navigation
find_symbolAST symbol lookupCode Navigation
read_repomapSkeletonized repo overviewCode Navigation
query_correlated_logsMulti-service trace correlationLog Horizon
check_alertsInfrastructure alert checkInfra Horizon
run_testsExecute test suiteDiagnostic
write_patchGenerate code fixRemediation
create_branch_and_prPush branch + open PRRemediation

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

ModeComponentsStorageBest 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

ServiceImagePortPurpose
backend-apiCustom build8000FastAPI backend
python-agentCustom buildLangChain agent worker
postgrespostgres:135433Incident database
rabbitmqrabbitmq:3-management5672, 15672Async task queue
admin-panelCustom build5003React dashboard
mcp-serverpython:3.11-slimMCP 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

VariableDescription
DAA_BACKEND_API_URLDAA server URL (e.g., http://localhost:8000)
DAA_TOKENApplication token from daa register
REPO_NAMERepository name for context
Python Node.js Go Java Ruby .NET

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

Prometheus Sentry Datadog CloudWatch PagerDuty Grafana GCP Alerting Opsgenie Custom YAML

MCP Server

Use DAA as a tool inside Claude Desktop, Cursor, or any MCP-compatible AI client.

Available MCP Tools

ToolDescription
get_fixes_awaiting_approvalList all fixes pending human approval
get_incident_postmortemGet postmortem & PR URL for a fix
approve_remediation_fixApprove a fix and trigger PR creation
get_active_incidentsList incidents currently being processed
get_fix_by_fingerprintLook up fix by SHA-256 fingerprint
list_registered_appsList all registered applications
trigger_manual_incidentFire a synthetic test incident
get_incident_context_for_prGet 4-DIM telemetry for a PR URL
fetch_pull_request_diffFetch PR diff for review
submit_pr_review_commentsPost review comments on a PR
trigger_reinvestigationTrigger 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

ForgeStatusConfig
GitHub StableGIT_PROVIDER=github
GitLab StableGIT_PROVIDER=gitlab
Gitea StableGIT_PROVIDER=gitea
Bitbucket StableGIT_PROVIDER=bitbucket

Workspace Modes

ModeENVBehaviour
Local CloneDAA_GIT_MODE=localClones repo locally. Faster, full git operations.
API OnlyDAA_GIT_MODE=apiReads files via forge REST API. No local clone — ideal for serverless.

REST API Reference

Base URL: http://your-daa:8000

Health & Status

GET /health Health check
GET /status/capabilities Deployment feature flags
GET /dashboard Aggregate stats (incidents, fix rate, etc.)

Ingestion

POST /ingest/prometheus Prometheus/AlertManager webhook
POST /ingest/sentry Sentry webhook (HMAC verified)
POST /ingest/custom/{name} Custom YAML-mapped webhook
POST /logs/ Submit error log via SDK

Incidents

GET /incidents/ List incidents (filterable by status, app_name)
GET /incidents/{id} Get incident detail
PATCH /incidents/{id} Update incident status, root cause, PR

Fixes

GET /fixes/{id} Get fix details
POST /fixes/{id}/approve Approve fix → triggers PR creation
GET /fixes/fingerprint/{fp} Lookup fix by fingerprint

Applications

GET /applications/ List registered apps
POST /applications/ Register new app (returns token)
POST /applications/{id}/escalation-policies Create escalation policy

Alerts

POST /alerts/ Create alert
GET /alerts/ List alerts
POST /alerts/webhook/alertmanager AlertManager webhook

Authentication

POST /auth/register Register user
POST /auth/login Login (returns JWT)

Real-time Streaming

GET /status/incidents/{id}/stream WebSocket — ReAct thought stream
GET /api/v1/mcp/sse SSE — MCP event stream

CLI Reference

The daa CLI provides complete management of your DAA installation.

CommandDescription
daa initInteractive 5-step setup wizard (LLM, Git, DB, Queue, Logging)
daa registerRegister an application and get its DAA_TOKEN
daa policySet escalation threshold (e.g., 3 errors in 60s)
daa testFire a synthetic error and watch the pipeline
daa logsView/stream recent incidents
daa statusHealth check all services
daa redeployRebuild and restart all containers
daa config set-modelSwitch LLM provider/model
daa config set-gitUpdate git provider/token
daa config showShow current configuration
daa mcp listList configured MCP servers
daa mcp addAdd external MCP server
daa versionPrint DAA version
daa uninstallRemove DAA

Configuration Reference

All configuration is via environment variables. Copy .env.example to .env and customize.

LLM Provider

VariableDefaultDescription
LLM_PROVIDERgoogleProvider: google, openai, anthropic, ollama, vertex
GEMINI_API_KEYGemini API key (required if google)
OPENAI_API_KEYOpenAI API key (required if openai)
ANTHROPIC_API_KEYAnthropic API key (required if anthropic)
OLLAMA_HOSThttp://localhost:11434Ollama server URL
LLM_MODELProvider defaultOverride model name (e.g. gemini-2.5-flash, gpt-4o, claude-sonnet-4-20250514)

Database & Queue

VariableDefaultDescription
DAA_DB_PROVIDERsqlitenone / sqlite / postgres / internal-postgres
DATABASE_URLPostgreSQL connection string
DAA_QUEUE_MODEsyncsync (inline) or rabbitmq
RABBITMQ_HOSTRabbitMQ hostname

Git Integration

VariableDefaultDescription
DAA_GIT_TOKENGit forge personal access token
GIT_HOSThttps://github.comGit forge URL
GIT_ORGDefault git org/user
GIT_PROVIDERgithubgithub / gitlab / gitea / bitbucket
DAA_GIT_MODElocallocal (clone) or api (REST only)

Security & Auth

VariableDefaultDescription
DAA_AUTH_ENABLEDfalseEnable JWT auth for SDK/API endpoints
DAA_API_KEYAPI key for webhook endpoints
SECRET_KEYJWT signing key
CORS_ALLOW_ORIGINS*CORS origins allowlist
SENTRY_WEBHOOK_SECRETSentry HMAC verification secret

Agent Configuration

VariableDefaultDescription
DAA_MAX_TOOL_CALLS8Hard cap on agent tool calls per investigation
DAA_MAX_ITERATIONS10Max ReAct loop iterations
DAA_AGENT_MODEfullfull (4-dim) or fast (bug-fix only)
DAA_COOLDOWN_SECONDS3600Dedup cooldown window (seconds)
DAA_HITL_MODEfalseHuman-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_ORIGINS to your specific domains
  • Enable DAA_AUTH_ENABLED=true for SDK endpoints
  • Use a strong DAA_API_KEY for 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

MetricValue
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 imageMulti-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 .
CONTRIBUTING.md SECURITY.md MIT License Report a Bug