# sathvik-srivathsan/ai-agent-control-panel architecture

> Architecture diagram of the GitHub repository sathvik-srivathsan/ai-agent-control-panel, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sathvik-srivathsan/ai-agent-control-panel
- Repository: https://github.com/sathvik-srivathsan/ai-agent-control-panel

## Overview

AI Agent Control Panel is a React/FastAPI application for configuring agents, running them against an OpenAI-compatible model gateway, and reviewing execution history and metrics. Users enter through the web UI; agent runs are handled by the API, which invokes the agent loop, persists run artifacts, and returns a result. The graph also shows the workspace tools and monitoring views. Source excerpts establish the backend calls; UI-to-API links and provider options are supported by the README and indexed references.

Main entry points: [`frontend/src/App.jsx`](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/frontend/src/App.jsx) (Application routes), [`backend/app/api/routes_runs.py`](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/api/routes_runs.py) (Run and metrics endpoints), [`frontend/src/api/client.js`](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/frontend/src/api/client.js) (API client), [`backend/app/main.py`](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/main.py) (FastAPI application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web interface"]
  node_app["Application routes<br/>[App.jsx]"]
  node_dashboard["Dashboard metrics<br/>[Dashboard.jsx]"]
  node_agentlist["Agent list<br/>[AgentList.jsx]"]
  node_agentdetail["Agent detail and run<br/>[AgentDetail.jsx]"]
  node_runhistory["Run history<br/>[RunHistory.jsx]"]
  node_rundetail["Run timeline<br/>[RunDetail.jsx]"]
  node_frontendapi["API client<br/>[client.js]"]
end

subgraph group_api["HTTP API"]
  node_fastapi["FastAPI application<br/>[main.py]"]
  node_agentroutes["Agent endpoints<br/>[routes_agents.py]"]
  node_runroutes["Run and metrics endpoints<br/>[routes_runs.py]"]
end

subgraph group_agent["Agent execution"]
  node_agentloop["Agent tool loop<br/>[agent.py]"]
  node_promptdefs["Prompt and tool definitions<br/>[prompts.py]"]
end

subgraph group_integrations["Model and tools"]
  node_llmclient["LLM client<br/>[client.py]"]
  node_omniroute{{"OmniRoute gateway"}}
  node_llmproviders{{"Cloud or local LLM"}}
  node_toolregistry["Tool registry<br/>[registry.py]"]
  node_filesystem["Workspace filesystem tools<br/>[filesystem.py]"]
end

subgraph group_storage["Persistence"]
  node_config["Runtime configuration<br/>[config.py]"]
  node_dbsession["Database sessions<br/>[database.py]"]
  node_models["Agent and run records<br/>[models.py]"]
  node_sqlite[("SQLite database")]
  node_seed["Default agent seeding<br/>[seed.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_agentlist
node_app -->|"routes to"| node_agentdetail
node_app -->|"routes to"| node_runhistory
node_app -->|"routes to"| node_rundetail
node_dashboard -->|"fetches metrics"| node_frontendapi
node_agentlist -->|"fetches agents"| node_frontendapi
node_agentdetail -->|"loads and runs"| node_frontendapi
node_runhistory -->|"fetches runs"| node_frontendapi
node_rundetail -->|"fetches run details"| node_frontendapi
node_frontendapi -->|"calls HTTP API"| node_fastapi
node_fastapi -->|"registers router"| node_agentroutes
node_fastapi -->|"registers router"| node_runroutes
node_fastapi -->|"initializes database"| node_dbsession
node_fastapi -->|"seeds agents"| node_seed
node_agentroutes -->|"queries agents"| node_dbsession
node_runroutes -->|"reads and writes"| node_dbsession
node_runroutes -->|"executes agent"| node_agentloop
node_runroutes -->|"creates client"| node_llmclient
node_agentloop -->|"requests completions"| node_llmclient
node_agentloop -->|"builds prompt and tools"| node_promptdefs
node_agentloop -->|"dispatches tools"| node_toolregistry
node_runroutes -->|"registers tools on import"| node_filesystem
node_filesystem -->|"registers functions"| node_toolregistry
node_llmclient -->|"loads settings"| node_config
node_filesystem -->|"loads workspace path"| node_config
node_llmclient -->|"posts completions"| node_omniroute
node_omniroute -->|"routes requests"| node_llmproviders
node_dbsession -->|"creates ORM tables"| node_models
node_dbsession -->|"stores records"| node_sqlite
node_seed -->|"creates agents"| node_models
node_agentroutes -->|"queries agent records"| node_models
node_runroutes -->|"persists run artifacts"| node_models

click node_app "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/frontend/src/App.jsx"
click node_dashboard "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/frontend/src/pages/Dashboard.jsx"
click node_agentlist "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/frontend/src/pages/AgentList.jsx"
click node_agentdetail "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/frontend/src/pages/AgentDetail.jsx"
click node_runhistory "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/frontend/src/pages/RunHistory.jsx"
click node_rundetail "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/frontend/src/pages/RunDetail.jsx"
click node_frontendapi "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/frontend/src/api/client.js"
click node_fastapi "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/main.py"
click node_agentroutes "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/api/routes_agents.py"
click node_runroutes "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/api/routes_runs.py"
click node_agentloop "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/ai/agent.py"
click node_promptdefs "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/ai/prompts.py"
click node_llmclient "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/ai/client.py"
click node_toolregistry "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/tools/registry.py"
click node_filesystem "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/tools/filesystem.py"
click node_config "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/core/config.py"
click node_dbsession "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/db/database.py"
click node_models "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/db/models.py"
click node_seed "https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/db/seed.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_app,node_dashboard,node_agentlist,node_agentdetail,node_runhistory,node_rundetail,node_frontendapi,node_user toneBlue
class node_fastapi,node_agentroutes,node_runroutes toneAmber
class node_agentloop,node_promptdefs toneMint
class node_llmclient,node_omniroute,node_llmproviders,node_toolregistry,node_filesystem toneRose
class node_config,node_dbsession,node_models,node_sqlite,node_seed toneIndigo
```

## Components

### Web interface

- [Application routes](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Dashboard metrics](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Agent list](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/frontend/src/pages/AgentList.jsx): `frontend/src/pages/AgentList.jsx`
- [Agent detail and run](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/frontend/src/pages/AgentDetail.jsx): `frontend/src/pages/AgentDetail.jsx`
- [Run history](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/frontend/src/pages/RunHistory.jsx): `frontend/src/pages/RunHistory.jsx`
- [Run timeline](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/frontend/src/pages/RunDetail.jsx): `frontend/src/pages/RunDetail.jsx`
- [API client](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/frontend/src/api/client.js): `frontend/src/api/client.js`

### HTTP API

- [FastAPI application](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/main.py): `backend/app/main.py`
- [Agent endpoints](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/api/routes_agents.py): `backend/app/api/routes_agents.py`
- [Run and metrics endpoints](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/api/routes_runs.py): `backend/app/api/routes_runs.py`

### Agent execution

- [Agent tool loop](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/ai/agent.py): `backend/app/ai/agent.py`
- [Prompt and tool definitions](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/ai/prompts.py): `backend/app/ai/prompts.py`

### Model and tools

- [LLM client](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/ai/client.py): `backend/app/ai/client.py`
- **OmniRoute gateway**
- **Cloud or local LLM**
- [Tool registry](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/tools/registry.py): `backend/app/tools/registry.py`
- [Workspace filesystem tools](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/tools/filesystem.py): `backend/app/tools/filesystem.py`

### Persistence

- [Runtime configuration](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/core/config.py): `backend/app/core/config.py`
- [Database sessions](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/db/database.py): `backend/app/db/database.py`
- [Agent and run records](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/db/models.py): `backend/app/db/models.py`
- **SQLite database**
- [Default agent seeding](https://github.com/sathvik-srivathsan/ai-agent-control-panel/blob/master/backend/app/db/seed.py): `backend/app/db/seed.py`

### Other components

- **User**

## Connections

- User → Application routes: uses (evidence: `README.md`)
- Application routes → Dashboard metrics: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Agent list: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Agent detail and run: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Run history: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Run timeline: routes to (evidence: `frontend/src/App.jsx`)
- Dashboard metrics → API client: fetches metrics (evidence: `frontend/src/pages/Dashboard.jsx`)
- Agent list → API client: fetches agents (evidence: `frontend/src/pages/AgentList.jsx`)
- Agent detail and run → API client: loads and runs (evidence: `frontend/src/pages/AgentDetail.jsx`)
- Run history → API client: fetches runs (evidence: `frontend/src/pages/RunHistory.jsx`)
- Run timeline → API client: fetches run details (evidence: `frontend/src/pages/RunDetail.jsx`)
- API client → FastAPI application: calls HTTP API (evidence: `frontend/src/api/client.js`)
- FastAPI application → Agent endpoints: registers router (evidence: `backend/app/main.py`)
- FastAPI application → Run and metrics endpoints: registers router (evidence: `backend/app/main.py`)
- FastAPI application → Database sessions: initializes database (evidence: `backend/app/main.py`)
- FastAPI application → Default agent seeding: seeds agents (evidence: `backend/app/main.py`)
- Agent endpoints → Database sessions: queries agents (evidence: `backend/app/api/routes_agents.py`)
- Run and metrics endpoints → Database sessions: reads and writes (evidence: `backend/app/api/routes_runs.py`)
- Run and metrics endpoints → Agent tool loop: executes agent (evidence: `backend/app/api/routes_runs.py`)
- Run and metrics endpoints → LLM client: creates client (evidence: `backend/app/api/routes_runs.py`)
- Agent tool loop → LLM client: requests completions (evidence: `backend/app/ai/agent.py`)
- Agent tool loop → Prompt and tool definitions: builds prompt and tools (evidence: `backend/app/ai/agent.py`)
- Agent tool loop → Tool registry: dispatches tools (evidence: `backend/app/ai/agent.py`)
- Run and metrics endpoints → Workspace filesystem tools: registers tools on import (evidence: `backend/app/api/routes_runs.py`)
- Workspace filesystem tools → Tool registry: registers functions (evidence: `backend/app/tools/filesystem.py`)
- LLM client → Runtime configuration: loads settings (evidence: `backend/app/ai/client.py`)
- Workspace filesystem tools → Runtime configuration: loads workspace path (evidence: `backend/app/tools/filesystem.py`)
- LLM client → OmniRoute gateway: posts completions (evidence: `backend/app/ai/client.py`)
- OmniRoute gateway → Cloud or local LLM: routes requests (evidence: `README.md`)
- Database sessions → Agent and run records: creates ORM tables (evidence: `backend/app/db/database.py`)
- Database sessions → SQLite database: stores records (evidence: `backend/app/db/database.py`)
- Default agent seeding → Agent and run records: creates agents (evidence: `backend/app/db/seed.py`)
- Agent endpoints → Agent and run records: queries agent records (evidence: `backend/app/api/routes_agents.py`)
- Run and metrics endpoints → Agent and run records: persists run artifacts (evidence: `backend/app/api/routes_runs.py`)
