24/7 AI-Powered Developer Relations Agent — Combines RAG, observability, code intelligence, browser automation, and a Known Error Database to supercharge developer support.
The demo is a static build of apps/frontend that runs with checked-in synthetic
data — no backend, database or credentials required. It exercises the real UI:
chat answers with evidence and tool calls, the system-health dashboard with a
simulated live feed, the human-in-the-loop approval queue, and workspace/project
administration. See docs/DEMO_SITE.md for how the demo
build works and how it is deployed.
The DevRelAgent CLI provides production-grade command-line interface with multiple flags for different use cases:
# Run an investigation
python cli.py investigate "Why is the API slow?"
# Dry-run mode (no write operations)
python cli.py investigate "API errors" --dry-run
# JSON output for automation
python cli.py investigate "Database latency" --json
# Auto-approve all actions (use with caution)
python cli.py investigate "Create dashboard" --auto-approve
# Verbose mode with detailed output
python cli.py investigate "API errors" --verbose
# Use specific session ID for continuity
python cli.py investigate "Follow up on previous issue" --session sess_20260311_120000
# Combined flags
python cli.py investigate "Check logs" --dry-run --verbose --json
# Status and monitoring
python cli.py status --verbose
python cli.py list-investigations --status completed --limit 10
# Export audit logs
python cli.py export-audit --output audit.json
| Flag | Description | Example |
|---|---|---|
--dry-run |
Show what would be done without executing | --dry-run |
--json |
Output results in JSON format | --json |
--auto-approve |
Skip approval prompts (use with caution) | --auto-approve |
--session |
Specify session ID for continuity | --session sess_123 |
--verbose, -v |
Increase output verbosity | --verbose |
--debug |
Enable debug logging | --debug |
┌─────────────────────────────────────────────────────────┐
│ Frontend (Next.js) │
└────────────────────────┬────────────────────────────────┘
│ REST / SSE
┌────────────────────────▼────────────────────────────────┐
│ FastAPI Backend │
│ ┌──────────┐ ┌──────────┐ ┌──────────────────────┐ │
│ │ Agent │ │ Guard- │ │ Tool Registry │ │
│ │ Loop │→ │ rails │→ │ ┌──────┐ ┌────────┐ │ │
│ │ P→R→M→A │ │ I/O/Tool │ │ │ Code │ │ Doc │ │ │
│ └──────────┘ └──────────┘ │ │Search│ │ Search │ │ │
│ │ └──────┘ └────────┘ │ │
│ ┌──────────┐ ┌──────────┐ │ ┌──────┐ ┌────────┐ │ │
│ │ Memory │ │ Skills │ │ │ MCP │ │Browser │ │ │
│ │ Conv/KeDB │ │ Compose │ │ │Server│ │ Use │ │ │
│ └──────────┘ └──────────┘ │ └──────┘ └────────┘ │ │
│ └──────────────────────┘ │
└────────────────────────┬────────────────────────────────┘
│
┌────────────────┼────────────────┐
▼ ▼ ▼
┌─────────┐ ┌───────────┐ ┌───────────┐
│ FAISS │ │ ClickHouse│ │ GitHub / │
│ Vectors │ │ Logs │ │ GitLab API│
└─────────┘ └───────────┘ └───────────┘
Cognitive Pipeline: Perception → Routing → Memory → Action
| Layer | Technology |
|---|---|
| LLM | Anthropic Claude (default), OpenAI, Google Gemini — swappable |
| Embeddings | Ollama nomic-embed-text (local) |
| Vector DB | FAISS |
| Code Parsing | tree-sitter (Python, JS, TS, Java, Rust, Go, C/C++, Ruby) |
| Backend | FastAPI + Pydantic |
| Tool Protocol | MCP (Model Context Protocol) |
| Frontend | Next.js (Phase 3) |
# 1. Clone and setup
git clone <repo-url>
cd DevRelAgent
python3 -m venv .venv && source .venv/bin/activate
pip install -e "."
# 2. Configure
cp .env.example .env
# Edit .env with your API keys
# 3. Start Ollama (for embeddings)
ollama serve &
ollama pull nomic-embed-text
# 4. Run
python apps/backend/main.py
# → http://localhost:8000/health
DevRelAgent/
├── apps/backend/
│ ├── main.py # FastAPI entry point
│ ├── agent/
│ │ ├── llm_provider.py # Multi-LLM abstraction
│ │ ├── loop.py # Agent cognitive pipeline
│ │ ├── router.py # Intent classification
│ │ └── planner.py # Multi-step ReAct planner
│ ├── models/
│ │ └── schemas.py # All Pydantic models
│ ├── tools/
│ │ ├── registry.py # Tool registration
│ │ ├── code_search/ # ★ Git repo indexing
│ │ │ ├── code_chunker.py # AST parsing + text fallback
│ │ │ ├── vector_store.py # FAISS + embeddings
│ │ │ ├── mcp_server.py # 8 MCP tools
│ │ │ └── config.py # Settings
│ │ └── doc_search/ # Document indexing (team)
│ │ ├── base.py # Abstract DocumentIndexer
│ │ └── README.md # Implementation guide
│ ├── guardrails/ # Input/Output/Tool guards
│ ├── memory/ # Conversation + KeDB
│ ├── mcp/ # Unified MCP server
│ └── skills/ # Composable workflows
├── data/ # Repos, indexes, KeDB
├── tests/ # Verification tests
├── scripts/ # Ingestion scripts
└── pyproject.toml # Dependencies
The code search module exposes 8 tools via MCP:
| Tool | Description |
|---|---|
clone_repository |
Clone a GitHub repo locally |
index_repository |
Parse code → AST chunks → FAISS embeddings |
search_code |
Natural language semantic code search |
get_file_content |
Read file with line numbers |
list_files |
Glob-based file listing |
get_repo_status |
Current repo info and index status |
load_repository |
Switch to a previously indexed repo |
list_indexed_repos |
List all cloned/indexed repos |
Switch providers via .env:
LLM_PROVIDER=anthropic # or: openai, gemini
LLM_MODEL=claude-haiku-4-5-20251001 # or: gpt-4o-mini, gemini-2.0-flash
source .venv/bin/activate
python tests/test_code_search.py
Project status: active development / prototype. The API now requires an identity and is scoped to a workspace and project (Phase 1), but the default
AUTH_PROVIDER=devtrusts caller-supplied headers and must not be exposed to an untrusted network. Switch to Clerk (or another OIDC provider) for any real deployment.
Every request resolves to a Workspace → Project scope, and data access is confined to it.
DATABASE_URL at Postgres/Supabase for real use).owner, admin, member, viewer). The creator of a workspace owns it.AUTH_PROVIDER=dev derives the caller
from X-Dev-User-Email / X-Dev-User-Name / X-Dev-Workspace headers (and
the matching query parameters, which is how the browser EventSource streams
identify themselves). AUTH_PROVIDER=clerk verifies a real Clerk/OIDC JWT
against the issuer’s JWKS.X-Project-Id / X-Project-Slug (or
?project_id=); requests without one use the workspace’s default project.drk_<prefix>_<secret>) authenticate machine access.
Only a salted hash is stored. Keys can read data-plane endpoints but cannot
administer workspaces.cd apps/backend && alembic upgrade head.
Set DATABASE_AUTO_CREATE=false in production.SESSION_BACKEND=memory for
a single process, redis for multiple replicas).GET /audit/verify.SESSION_BACKEND=redis) and is
scoped per project, so every replica enforces the same limits.429 with a
Retry-After header when exceeded.traceparent to every request
(echoed back in the response headers and included in the JSON logs), records
HTTP latency/summary metrics, and exposes them in Prometheus text format at
GET /metrics.Endpoints: GET /auth/me, GET/POST /workspaces, GET /workspaces/current/members,
GET/POST /projects, PATCH /projects/{id}, POST /projects/{id}/archive,
GET/POST/DELETE /projects/{id}/api-keys, GET /audit/verify, and GET /metrics.
Frontend pages: / (chat), /dashboard (live activity), /approvals
(review and respond to pending approvals, with recent-decision history), and
/workspace (workspace + members, project lifecycle, and project API keys).
Each page shares the same header, project switcher and navigation.
traceparent across replicas, logged as JSON with request_id/trace_id,
and measured via GET /metrics (Prometheus format). Trace spans are held in
memory per replica; exporting to a tracing backend is a follow-up.SESSION_BACKEND=redis; sessions and guardrail/limit state are shared across
replicas, while vector indexes remain process-localFor production deployments: