# soumen2581/capstone-project architecture

> Architecture diagram of the GitHub repository soumen2581/capstone-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/soumen2581/capstone-project
- Repository: https://github.com/soumen2581/capstone-project
- Video tour (about a minute): https://gitdiagram.com/soumen2581/capstone-project/video

## Overview

AgentMesh is a web-based multi-agent orchestration platform: an operator submits a request, backend planning selects capable agents and forms a conditional workflow, agents execute through routed model providers, and validated outputs are synthesized and persisted for the office UI. The graph emphasizes that runtime path, while retaining the documented collaboration, memory/artifact, identity, and observability capabilities. Some subsystem links rely on README claims because their implementation files were not sampled; uncertain links are omitted.

Main entry points: [`backend/app/services/orchestration_service.py`](https://github.com/soumen2581/capstone-project/blob/master/backend/app/services/orchestration_service.py) (Orchestration service), [`backend/app/workflows/engine.py`](https://github.com/soumen2581/capstone-project/blob/master/backend/app/workflows/engine.py) (Workflow engine), [`backend/app/services/workflow_repository.py`](https://github.com/soumen2581/capstone-project/blob/master/backend/app/services/workflow_repository.py) (Workflow persistence), [`backend/app/api/routes/tasks.py`](https://github.com/soumen2581/capstone-project/blob/master/backend/app/api/routes/tasks.py) (Task routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Office interface"]
  node_office["Office workspace<br/>[page.tsx]"]
  node_task_composer["Task composer<br/>[TaskComposer.tsx]"]
  node_workflow_view["Workflow progress"]
  node_ui_api["Frontend API client<br/>[api.ts]"]
end

subgraph group_api["API and identity"]
  node_task_routes["Task routes<br/>[tasks.py]"]
  node_identity["Operator identity<br/>[dependencies.py]"]
  node_auth_routes["Authentication routes<br/>[auth.py]"]
  node_google_auth["Google verification<br/>[google_auth.py]"]
end

subgraph group_planning["Agent planning"]
  node_orchestration["Orchestration service"]
  node_capability_analysis["Capability analysis"]
  node_agent_selection["Agent selection<br/>[selection.py]"]
  node_workflow_planner["Workflow planning<br/>[planner.py]"]
  node_agent_registry["Agent registry<br/>[registry.py]"]
  node_agent_enrollment["Agent enrollment<br/>[enrollment.py]"]
end

subgraph group_execution["Workflow execution"]
  node_workflow_engine["Workflow engine<br/>[engine.py]"]
  node_agent_executor["Agent executor<br/>[agent_executor.py]"]
  node_output_validation["Output validation"]
  node_synthesis["Result synthesis<br/>[synthesis.py]"]
  node_provider_registry["Provider routing<br/>[registry.py]"]
end

subgraph group_platform["State and operations"]
  node_workflow_repository[("Workflow persistence")]
  node_collaboration["Agent collaboration<br/>[collaboration.py]"]
  node_message_store[("Messages and memory<br/>[store.py]")]
  node_metrics["Metrics<br/>[metrics.py]"]
end

node_operator(("Operator"))
node_external_models{{"Model providers"}}
node_postgres[("PostgreSQL")]
node_redis[("Redis work state")]

node_operator -->|"uses"| node_office
node_office -.->|"renders"| node_task_composer
node_task_composer -.->|"submits task"| node_ui_api
node_ui_api -->|"calls API"| node_task_routes
node_task_routes -->|"resolves operator"| node_identity
node_task_routes -->|"submits request"| node_orchestration
node_orchestration -->|"analyzes request"| node_capability_analysis
node_orchestration -->|"selects agents"| node_agent_selection
node_orchestration -.->|"plans graph"| node_workflow_planner
node_agent_selection -.->|"selects definitions"| node_agent_registry
node_agent_enrollment -->|"enrolls agents"| node_agent_registry
node_orchestration -->|"persists plan"| node_workflow_repository
node_orchestration -->|"executes plan"| node_workflow_engine
node_workflow_engine -->|"runs agents"| node_agent_executor
node_workflow_engine -->|"records transitions"| node_workflow_repository
node_agent_executor -->|"routes model call"| node_provider_registry
node_agent_executor -->|"validates output"| node_output_validation
node_provider_registry -.->|"invokes provider"| node_external_models
node_workflow_engine -.->|"synthesizes results"| node_synthesis
node_workflow_engine -->|"dispatches node events"| node_collaboration
node_collaboration -.->|"uses durable messaging"| node_message_store
node_workflow_repository -->|"stores durable state"| node_postgres
node_workflow_repository -->|"records execution metrics"| node_metrics
node_workflow_engine -.->|"uses transient work state"| node_redis
node_workflow_repository -.->|"serves workflow state"| node_workflow_view
node_workflow_view -.->|"refreshes status"| node_ui_api
node_operator -->|"signs in"| node_auth_routes
node_auth_routes -.->|"verifies token"| node_google_auth

click node_office "https://github.com/soumen2581/capstone-project/blob/master/frontend/app/office/page.tsx"
click node_task_composer "https://github.com/soumen2581/capstone-project/blob/master/frontend/components/TaskComposer.tsx"
click node_workflow_view "https://github.com/soumen2581/capstone-project/blob/master/frontend/components/WorkflowProgress.tsx"
click node_ui_api "https://github.com/soumen2581/capstone-project/blob/master/frontend/lib/api.ts"
click node_task_routes "https://github.com/soumen2581/capstone-project/blob/master/backend/app/api/routes/tasks.py"
click node_identity "https://github.com/soumen2581/capstone-project/blob/master/backend/app/api/dependencies.py"
click node_orchestration "https://github.com/soumen2581/capstone-project/blob/master/backend/app/services/orchestration_service.py"
click node_capability_analysis "https://github.com/soumen2581/capstone-project/blob/master/backend/app/orchestration/capability_analysis.py"
click node_agent_selection "https://github.com/soumen2581/capstone-project/blob/master/backend/app/orchestration/selection.py"
click node_workflow_planner "https://github.com/soumen2581/capstone-project/blob/master/backend/app/orchestration/planner.py"
click node_agent_registry "https://github.com/soumen2581/capstone-project/blob/master/backend/app/agents/registry.py"
click node_agent_enrollment "https://github.com/soumen2581/capstone-project/blob/master/backend/app/agents/enrollment.py"
click node_workflow_engine "https://github.com/soumen2581/capstone-project/blob/master/backend/app/workflows/engine.py"
click node_agent_executor "https://github.com/soumen2581/capstone-project/blob/master/backend/app/services/agent_executor.py"
click node_output_validation "https://github.com/soumen2581/capstone-project/blob/master/backend/app/services/output_validation.py"
click node_synthesis "https://github.com/soumen2581/capstone-project/blob/master/backend/app/workflows/synthesis.py"
click node_provider_registry "https://github.com/soumen2581/capstone-project/blob/master/backend/app/providers/registry.py"
click node_workflow_repository "https://github.com/soumen2581/capstone-project/blob/master/backend/app/services/workflow_repository.py"
click node_collaboration "https://github.com/soumen2581/capstone-project/blob/master/backend/app/services/collaboration.py"
click node_message_store "https://github.com/soumen2581/capstone-project/blob/master/backend/app/messaging/store.py"
click node_auth_routes "https://github.com/soumen2581/capstone-project/blob/master/backend/app/api/routes/auth.py"
click node_google_auth "https://github.com/soumen2581/capstone-project/blob/master/backend/app/core/google_auth.py"
click node_metrics "https://github.com/soumen2581/capstone-project/blob/master/backend/app/core/metrics.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_office,node_task_composer,node_workflow_view,node_ui_api toneBlue
class node_task_routes,node_identity,node_auth_routes,node_google_auth,node_postgres,node_redis toneAmber
class node_orchestration,node_capability_analysis,node_agent_selection,node_workflow_planner,node_agent_registry,node_agent_enrollment toneMint
class node_workflow_engine,node_agent_executor,node_output_validation,node_synthesis,node_provider_registry toneRose
class node_workflow_repository,node_collaboration,node_message_store,node_metrics,node_operator,node_external_models toneIndigo
```

## Components

### Office interface

- [Office workspace](https://github.com/soumen2581/capstone-project/blob/master/frontend/app/office/page.tsx): `frontend/app/office/page.tsx`
- [Task composer](https://github.com/soumen2581/capstone-project/blob/master/frontend/components/TaskComposer.tsx): `frontend/components/TaskComposer.tsx`
- [Workflow progress](https://github.com/soumen2581/capstone-project/blob/master/frontend/components/WorkflowProgress.tsx): `frontend/components/WorkflowProgress.tsx`
- [Frontend API client](https://github.com/soumen2581/capstone-project/blob/master/frontend/lib/api.ts): `frontend/lib/api.ts`

### API and identity

- [Task routes](https://github.com/soumen2581/capstone-project/blob/master/backend/app/api/routes/tasks.py): `backend/app/api/routes/tasks.py`
- [Operator identity](https://github.com/soumen2581/capstone-project/blob/master/backend/app/api/dependencies.py): `backend/app/api/dependencies.py`
- [Authentication routes](https://github.com/soumen2581/capstone-project/blob/master/backend/app/api/routes/auth.py): `backend/app/api/routes/auth.py`
- [Google verification](https://github.com/soumen2581/capstone-project/blob/master/backend/app/core/google_auth.py): `backend/app/core/google_auth.py`

### Agent planning

- [Orchestration service](https://github.com/soumen2581/capstone-project/blob/master/backend/app/services/orchestration_service.py): `backend/app/services/orchestration_service.py`
- [Capability analysis](https://github.com/soumen2581/capstone-project/blob/master/backend/app/orchestration/capability_analysis.py): `backend/app/orchestration/capability_analysis.py`
- [Agent selection](https://github.com/soumen2581/capstone-project/blob/master/backend/app/orchestration/selection.py): `backend/app/orchestration/selection.py`
- [Workflow planning](https://github.com/soumen2581/capstone-project/blob/master/backend/app/orchestration/planner.py): `backend/app/orchestration/planner.py`
- [Agent registry](https://github.com/soumen2581/capstone-project/blob/master/backend/app/agents/registry.py): `backend/app/agents/registry.py`
- [Agent enrollment](https://github.com/soumen2581/capstone-project/blob/master/backend/app/agents/enrollment.py): `backend/app/agents/enrollment.py`

### Workflow execution

- [Workflow engine](https://github.com/soumen2581/capstone-project/blob/master/backend/app/workflows/engine.py): `backend/app/workflows/engine.py`
- [Agent executor](https://github.com/soumen2581/capstone-project/blob/master/backend/app/services/agent_executor.py): `backend/app/services/agent_executor.py`
- [Output validation](https://github.com/soumen2581/capstone-project/blob/master/backend/app/services/output_validation.py): `backend/app/services/output_validation.py`
- [Result synthesis](https://github.com/soumen2581/capstone-project/blob/master/backend/app/workflows/synthesis.py): `backend/app/workflows/synthesis.py`
- [Provider routing](https://github.com/soumen2581/capstone-project/blob/master/backend/app/providers/registry.py): `backend/app/providers/registry.py`

### State and operations

- [Workflow persistence](https://github.com/soumen2581/capstone-project/blob/master/backend/app/services/workflow_repository.py): `backend/app/services/workflow_repository.py`
- [Agent collaboration](https://github.com/soumen2581/capstone-project/blob/master/backend/app/services/collaboration.py): `backend/app/services/collaboration.py`
- [Messages and memory](https://github.com/soumen2581/capstone-project/blob/master/backend/app/messaging/store.py): `backend/app/messaging/store.py`
- [Metrics](https://github.com/soumen2581/capstone-project/blob/master/backend/app/core/metrics.py): `backend/app/core/metrics.py`

### Other components

- **Operator**
- **Model providers**
- **PostgreSQL**
- **Redis work state**

## Connections

- Operator → Office workspace: uses
- Office workspace → Task composer: renders
- Task composer → Frontend API client: submits task
- Frontend API client → Task routes: calls API
- Task routes → Operator identity: resolves operator (evidence: `backend/app/api/routes/tasks.py`)
- Task routes → Orchestration service: submits request (evidence: `backend/app/api/routes/tasks.py`)
- Orchestration service → Capability analysis: analyzes request (evidence: `backend/app/services/orchestration_service.py`)
- Orchestration service → Agent selection: selects agents (evidence: `backend/app/services/orchestration_service.py`)
- Orchestration service → Workflow planning: plans graph (evidence: `backend/app/services/orchestration_service.py`)
- Agent selection → Agent registry: selects definitions
- Agent enrollment → Agent registry: enrolls agents (evidence: `backend/app/agents/enrollment.py`)
- Orchestration service → Workflow persistence: persists plan (evidence: `backend/app/services/orchestration_service.py`)
- Orchestration service → Workflow engine: executes plan (evidence: `backend/app/services/orchestration_service.py`)
- Workflow engine → Agent executor: runs agents (evidence: `backend/app/workflows/engine.py`)
- Workflow engine → Workflow persistence: records transitions (evidence: `backend/app/workflows/engine.py`)
- Agent executor → Provider routing: routes model call (evidence: `backend/app/services/agent_executor.py`)
- Agent executor → Output validation: validates output (evidence: `backend/app/services/agent_executor.py`)
- Provider routing → Model providers: invokes provider
- Workflow engine → Result synthesis: synthesizes results (evidence: `backend/app/workflows/engine.py`)
- Workflow engine → Agent collaboration: dispatches node events (evidence: `backend/app/workflows/engine.py`)
- Agent collaboration → Messages and memory: uses durable messaging
- Workflow persistence → PostgreSQL: stores durable state
- Workflow persistence → Metrics: records execution metrics (evidence: `backend/app/services/workflow_repository.py`)
- Workflow engine → Redis work state: uses transient work state
- Workflow persistence → Workflow progress: serves workflow state
- Workflow progress → Frontend API client: refreshes status
- Operator → Authentication routes: signs in
- Authentication routes → Google verification: verifies token
