DevRelAgent-independent

DevRelAgent - Demo

24/7 AI-Powered Developer Relations Agent — Combines RAG, observability, code intelligence, browser automation, and a Known Error Database to supercharge developer support.

Live demo

Open the demo site →

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.

CLI Usage

The DevRelAgent CLI provides production-grade command-line interface with multiple flags for different use cases:

Basic Investigation

# 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

Advanced CLI Flags

# 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

CLI Flag Reference

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

Architecture

┌─────────────────────────────────────────────────────────┐
│                    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

Tech Stack

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)

Quick Start

# 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

Project Structure

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

Code Search MCP Tools

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

Multi-LLM Support

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

Running Tests

source .venv/bin/activate
python tests/test_code_search.py

Roadmap

Reference

Documentation

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=dev trusts caller-supplied headers and must not be exposed to an untrusted network. Switch to Clerk (or another OIDC provider) for any real deployment.

Security & Governance

Operational Documentation

Key Features

Audit Trail

Security Controls

Explain-Before-Act

Structured Outputs

Identity & Multi-Tenancy (Phase 1)

Every request resolves to a Workspace → Project scope, and data access is confined to it.

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.

Deployment Considerations

Support

For production deployments: