# rahul-leo/agentmesh architecture

> Architecture diagram of the GitHub repository rahul-leo/agentmesh, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rahul-leo/agentmesh
- Repository: https://github.com/rahul-leo/agentmesh

## Overview

AgentMesh is a web-based debugging and CI/CD assistant: a user submits repository details, changed files, and optional failure logs; the backend runs a risk estimate and coordinated agent stages, persists the report, and exposes run history to the dashboard. The graph also preserves the documented deployment options and optional Streamlit dashboard. Agent coordination, API wiring, persistence behavior, and selected UI calls are supported by excerpts; some agent implementations and dashboard behavior are unsampled, so their internal links are omitted.

Main entry points: [`agents/manager_agent.py`](https://github.com/rahul-leo/agentmesh/blob/main/agents/manager_agent.py) (Agent Manager), [`agents/base_agent.py`](https://github.com/rahul-leo/agentmesh/blob/main/agents/base_agent.py) (Agent Primitives), [`backend/routes/runs.py`](https://github.com/rahul-leo/agentmesh/blob/main/backend/routes/runs.py) (Run Endpoints), [`backend/services/pipeline_service.py`](https://github.com/rahul-leo/agentmesh/blob/main/backend/services/pipeline_service.py) (Pipeline Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User Experience"]
  node_dashboard["Web Dashboard<br/>[main.jsx]"]
  node_streamlit["Streamlit Dashboard<br/>[streamlit_app.py]"]
end

subgraph group_api["API and Runs"]
  node_api_app["FastAPI App<br/>[main.py]"]
  node_run_routes["Run Endpoints<br/>[runs.py]"]
  node_schemas["Run Schemas<br/>[schemas.py]"]
  node_pipeline_service["Pipeline Service"]
  node_repository[("Run Repository<br/>[run_repository.py]")]
end

subgraph group_pipeline["Agent Pipeline"]
  node_manager["Agent Manager<br/>[manager_agent.py]"]
  node_task_model["Agent Primitives<br/>[base_agent.py]"]
  node_risk["Risk Predictor<br/>[predict.py]"]
  node_debug["Debug Agent<br/>[debug_agent.py]"]
  node_fix["Fix Agent<br/>[fix_agent.py]"]
  node_autofix["AutoFix Agent<br/>[autofix_agent.py]"]
  node_tests["Test Agent<br/>[test_agent.py]"]
  node_build["Build Agent<br/>[build_agent.py]"]
end

subgraph group_release["Release Integrations"]
  node_deploy["Deploy Agent<br/>[deploy_agent.py]"]
  node_monitor["Monitor Agent<br/>[monitor_agent.py]"]
  node_verdict["Verdict Agent<br/>[verdict_agent.py]"]
end

node_user(("User"))
node_gemini{{"Gemini API"}}
node_firebase[("Firebase Firestore")]
node_vercel{{"Vercel"}}
node_render{{"Render"}}

node_user -->|"submits run"| node_dashboard
node_user -->|"opens dashboard"| node_streamlit
node_dashboard -->|"fetches history"| node_run_routes
node_dashboard -.->|"submits run"| node_run_routes
node_api_app -->|"registers routes"| node_run_routes
node_run_routes -->|"validates payloads"| node_schemas
node_run_routes -->|"dispatches requests"| node_pipeline_service
node_pipeline_service -->|"builds task"| node_task_model
node_pipeline_service -->|"runs pipeline"| node_manager
node_pipeline_service -->|"saves and reads"| node_repository
node_repository -->|"persists runs"| node_firebase
node_manager -->|"estimates risk"| node_risk
node_manager -->|"runs stage"| node_debug
node_manager -->|"runs stage"| node_fix
node_manager -->|"runs stage"| node_autofix
node_manager -->|"runs stage"| node_tests
node_manager -->|"runs stage"| node_build
node_manager -->|"runs stage"| node_deploy
node_manager -->|"runs stage"| node_monitor
node_manager -->|"runs stage"| node_verdict
node_debug -->|"uses primitives"| node_task_model
node_fix -->|"uses primitives"| node_task_model
node_autofix -->|"uses primitives"| node_task_model
node_deploy -->|"uses primitives"| node_task_model
node_task_model -.->|"requests analysis"| node_gemini
node_deploy -->|"checks deployment"| node_vercel
node_deploy -->|"checks deployment"| node_render

click node_dashboard "https://github.com/rahul-leo/agentmesh/blob/main/frontend/src/main.jsx"
click node_streamlit "https://github.com/rahul-leo/agentmesh/blob/main/streamlit_app.py"
click node_api_app "https://github.com/rahul-leo/agentmesh/blob/main/backend/main.py"
click node_run_routes "https://github.com/rahul-leo/agentmesh/blob/main/backend/routes/runs.py"
click node_schemas "https://github.com/rahul-leo/agentmesh/blob/main/backend/models/schemas.py"
click node_pipeline_service "https://github.com/rahul-leo/agentmesh/blob/main/backend/services/pipeline_service.py"
click node_repository "https://github.com/rahul-leo/agentmesh/blob/main/backend/services/run_repository.py"
click node_manager "https://github.com/rahul-leo/agentmesh/blob/main/agents/manager_agent.py"
click node_task_model "https://github.com/rahul-leo/agentmesh/blob/main/agents/base_agent.py"
click node_risk "https://github.com/rahul-leo/agentmesh/blob/main/ml/predict.py"
click node_debug "https://github.com/rahul-leo/agentmesh/blob/main/agents/debug_agent.py"
click node_fix "https://github.com/rahul-leo/agentmesh/blob/main/agents/fix_agent.py"
click node_autofix "https://github.com/rahul-leo/agentmesh/blob/main/agents/autofix_agent.py"
click node_tests "https://github.com/rahul-leo/agentmesh/blob/main/agents/test_agent.py"
click node_build "https://github.com/rahul-leo/agentmesh/blob/main/agents/build_agent.py"
click node_deploy "https://github.com/rahul-leo/agentmesh/blob/main/agents/deploy_agent.py"
click node_monitor "https://github.com/rahul-leo/agentmesh/blob/main/agents/monitor_agent.py"
click node_verdict "https://github.com/rahul-leo/agentmesh/blob/main/agents/verdict_agent.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboard,node_streamlit,node_user toneBlue
class node_api_app,node_run_routes,node_schemas,node_pipeline_service,node_repository,node_firebase toneAmber
class node_manager,node_task_model,node_risk,node_debug,node_fix,node_autofix,node_tests,node_build,node_gemini toneMint
class node_deploy,node_monitor,node_verdict toneRose
class node_vercel,node_render toneIndigo
```

## Components

### User Experience

- [Web Dashboard](https://github.com/rahul-leo/agentmesh/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Streamlit Dashboard](https://github.com/rahul-leo/agentmesh/blob/main/streamlit_app.py): `streamlit_app.py`

### API and Runs

- [FastAPI App](https://github.com/rahul-leo/agentmesh/blob/main/backend/main.py): `backend/main.py`
- [Run Endpoints](https://github.com/rahul-leo/agentmesh/blob/main/backend/routes/runs.py): `backend/routes/runs.py`
- [Run Schemas](https://github.com/rahul-leo/agentmesh/blob/main/backend/models/schemas.py): `backend/models/schemas.py`
- [Pipeline Service](https://github.com/rahul-leo/agentmesh/blob/main/backend/services/pipeline_service.py): `backend/services/pipeline_service.py`
- [Run Repository](https://github.com/rahul-leo/agentmesh/blob/main/backend/services/run_repository.py): `backend/services/run_repository.py`

### Agent Pipeline

- [Agent Manager](https://github.com/rahul-leo/agentmesh/blob/main/agents/manager_agent.py): `agents/manager_agent.py`
- [Agent Primitives](https://github.com/rahul-leo/agentmesh/blob/main/agents/base_agent.py): `agents/base_agent.py`
- [Risk Predictor](https://github.com/rahul-leo/agentmesh/blob/main/ml/predict.py): `ml/predict.py`
- [Debug Agent](https://github.com/rahul-leo/agentmesh/blob/main/agents/debug_agent.py): `agents/debug_agent.py`
- [Fix Agent](https://github.com/rahul-leo/agentmesh/blob/main/agents/fix_agent.py): `agents/fix_agent.py`
- [AutoFix Agent](https://github.com/rahul-leo/agentmesh/blob/main/agents/autofix_agent.py): `agents/autofix_agent.py`
- [Test Agent](https://github.com/rahul-leo/agentmesh/blob/main/agents/test_agent.py): `agents/test_agent.py`
- [Build Agent](https://github.com/rahul-leo/agentmesh/blob/main/agents/build_agent.py): `agents/build_agent.py`

### Release Integrations

- [Deploy Agent](https://github.com/rahul-leo/agentmesh/blob/main/agents/deploy_agent.py): `agents/deploy_agent.py`
- [Monitor Agent](https://github.com/rahul-leo/agentmesh/blob/main/agents/monitor_agent.py): `agents/monitor_agent.py`
- [Verdict Agent](https://github.com/rahul-leo/agentmesh/blob/main/agents/verdict_agent.py): `agents/verdict_agent.py`

### Other components

- **User**
- **Gemini API**
- **Firebase Firestore**
- **Vercel**
- **Render**

## Connections

- User → Web Dashboard: submits run (evidence: `README.md`)
- User → Streamlit Dashboard: opens dashboard (evidence: `README.md`)
- Web Dashboard → Run Endpoints: fetches history (evidence: `frontend/src/main.jsx`)
- Web Dashboard → Run Endpoints: submits run (evidence: `README.md`)
- FastAPI App → Run Endpoints: registers routes (evidence: `backend/main.py`)
- Run Endpoints → Run Schemas: validates payloads (evidence: `backend/routes/runs.py`)
- Run Endpoints → Pipeline Service: dispatches requests (evidence: `backend/routes/runs.py`)
- Pipeline Service → Agent Primitives: builds task (evidence: `backend/services/pipeline_service.py`)
- Pipeline Service → Agent Manager: runs pipeline (evidence: `backend/services/pipeline_service.py`)
- Pipeline Service → Run Repository: saves and reads (evidence: `backend/services/pipeline_service.py`)
- Run Repository → Firebase Firestore: persists runs (evidence: `backend/services/run_repository.py`)
- Agent Manager → Risk Predictor: estimates risk (evidence: `agents/manager_agent.py`)
- Agent Manager → Debug Agent: runs stage (evidence: `agents/manager_agent.py`)
- Agent Manager → Fix Agent: runs stage (evidence: `agents/manager_agent.py`)
- Agent Manager → AutoFix Agent: runs stage (evidence: `agents/manager_agent.py`)
- Agent Manager → Test Agent: runs stage (evidence: `agents/manager_agent.py`)
- Agent Manager → Build Agent: runs stage (evidence: `agents/manager_agent.py`)
- Agent Manager → Deploy Agent: runs stage (evidence: `agents/manager_agent.py`)
- Agent Manager → Monitor Agent: runs stage (evidence: `agents/manager_agent.py`)
- Agent Manager → Verdict Agent: runs stage (evidence: `agents/manager_agent.py`)
- Debug Agent → Agent Primitives: uses primitives (evidence: `agents/debug_agent.py`)
- Fix Agent → Agent Primitives: uses primitives (evidence: `agents/fix_agent.py`)
- AutoFix Agent → Agent Primitives: uses primitives (evidence: `agents/autofix_agent.py`)
- Deploy Agent → Agent Primitives: uses primitives (evidence: `agents/deploy_agent.py`)
- Agent Primitives → Gemini API: requests analysis (evidence: `agents/base_agent.py`)
- Deploy Agent → Vercel: checks deployment (evidence: `agents/deploy_agent.py`)
- Deploy Agent → Render: checks deployment (evidence: `agents/deploy_agent.py`)
