# awslabs/loom architecture

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

- Interactive diagram: https://gitdiagram.com/awslabs/loom
- Repository: https://github.com/awslabs/loom

## Overview

Loom is an AWS agent management plane: teams register and deploy agents, invoke them, then govern, evaluate, and operate them. The main path runs from the web console through the FastAPI control plane to deployment and invocation on AgentCore, with custom Strands or ADK runtimes. Separate capabilities cover identity and authorization, integrations and memory, approvals and registry governance, evaluations, and cost/observability. The tree and excerpts support the main API, persistence, and runtime boundaries; several feature-specific routers and frontend pages are represented at subsystem level because their implementation was not sampled.

Main entry points: [`backend/app/routers/agents.py`](https://github.com/awslabs/loom/blob/main/backend/app/routers/agents.py) (Agent lifecycle API), [`backend/app/routers/invocations.py`](https://github.com/awslabs/loom/blob/main/backend/app/routers/invocations.py) (Invocation API), [`backend/app/main.py`](https://github.com/awslabs/loom/blob/main/backend/app/main.py) (FastAPI application), [`agents/adk_agent/src/agent.py`](https://github.com/awslabs/loom/blob/main/agents/adk_agent/src/agent.py) (ADK agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Web console"]
  node_web["Console pages"]
  node_frontend_api["API client<br/>[client.ts]"]
end

subgraph group_control["Control plane"]
  node_backend["FastAPI application<br/>[main.py]"]
  node_agent_routes["Agent lifecycle API<br/>[agents.py]"]
  node_invoke_routes["Invocation API<br/>[invocations.py]"]
  node_auth["Identity and scopes<br/>[auth.py]"]
  node_db[("Platform database<br/>[db.py]")]
  node_deployment["AgentCore deployment<br/>[deployment.py]"]
end

subgraph group_runtime["Agent runtime"]
  node_strands_handler["Strands runtime handler<br/>[handler.py]"]
  node_strands_agent["Strands agent<br/>[agent.py]"]
  node_adk_handler["ADK runtime handler<br/>[handler.py]"]
  node_adk_agent["ADK agent<br/>[agent.py]"]
  node_integrations["Agent integrations"]
end

subgraph group_governance["Governance"]
  node_governance_api["Registry and approvals<br/>[registry.py]"]
  node_guardrails["Guardrail services<br/>[guardrails.py]"]
end

subgraph group_operations["Quality and operations"]
  node_evaluation_api["Agent evaluations<br/>[evaluations.py]"]
  node_costs_api["Cost tracking<br/>[costs.py]"]
  node_telemetry["Runtime telemetry<br/>[telemetry.py]"]
end

node_user(("Platform user"))
node_aws{{"AWS AgentCore and Bedrock"}}
node_registry_service{{"AWS Agent Registry"}}

node_user -->|"uses"| node_web
node_web -.->|"requests data"| node_frontend_api
node_frontend_api -.->|"calls API"| node_backend
node_backend -->|"routes requests"| node_agent_routes
node_backend -->|"routes requests"| node_invoke_routes
node_agent_routes -->|"reads and writes"| node_db
node_invoke_routes -->|"reads and writes"| node_db
node_invoke_routes -->|"checks access"| node_auth
node_agent_routes -.->|"deploys agents"| node_deployment
node_deployment -.->|"provisions runtime"| node_aws
node_aws -.->|"invokes runtime"| node_strands_handler
node_aws -.->|"invokes runtime"| node_adk_handler
node_strands_handler -->|"builds agent"| node_strands_agent
node_adk_handler -->|"builds agent"| node_adk_agent
node_adk_agent -->|"loads tools"| node_integrations
node_agent_routes -.->|"checks approvals"| node_governance_api
node_governance_api -->|"uses registry"| node_registry_service
node_invoke_routes -->|"applies guardrails"| node_guardrails
node_user -.->|"runs evaluations"| node_evaluation_api
node_user -.->|"reviews costs"| node_costs_api
node_strands_agent -.->|"emits telemetry"| node_telemetry
node_adk_agent -.->|"emits telemetry"| node_telemetry

click node_web "https://github.com/awslabs/loom/tree/main/frontend/src/pages"
click node_frontend_api "https://github.com/awslabs/loom/blob/main/frontend/src/api/client.ts"
click node_backend "https://github.com/awslabs/loom/blob/main/backend/app/main.py"
click node_agent_routes "https://github.com/awslabs/loom/blob/main/backend/app/routers/agents.py"
click node_invoke_routes "https://github.com/awslabs/loom/blob/main/backend/app/routers/invocations.py"
click node_auth "https://github.com/awslabs/loom/blob/main/backend/app/dependencies/auth.py"
click node_db "https://github.com/awslabs/loom/blob/main/backend/app/db.py"
click node_deployment "https://github.com/awslabs/loom/blob/main/backend/app/services/deployment.py"
click node_strands_handler "https://github.com/awslabs/loom/blob/main/agents/strands_agent/src/handler.py"
click node_strands_agent "https://github.com/awslabs/loom/blob/main/agents/strands_agent/src/agent.py"
click node_adk_handler "https://github.com/awslabs/loom/blob/main/agents/adk_agent/src/handler.py"
click node_adk_agent "https://github.com/awslabs/loom/blob/main/agents/adk_agent/src/agent.py"
click node_integrations "https://github.com/awslabs/loom/tree/main/agents/adk_agent/src/integrations"
click node_governance_api "https://github.com/awslabs/loom/blob/main/backend/app/routers/registry.py"
click node_guardrails "https://github.com/awslabs/loom/blob/main/backend/app/services/guardrails.py"
click node_evaluation_api "https://github.com/awslabs/loom/blob/main/backend/app/routers/evaluations.py"
click node_costs_api "https://github.com/awslabs/loom/blob/main/backend/app/routers/costs.py"
click node_telemetry "https://github.com/awslabs/loom/blob/main/agents/adk_agent/src/telemetry.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_web,node_frontend_api,node_user toneBlue
class node_backend,node_agent_routes,node_invoke_routes,node_auth,node_db,node_deployment toneAmber
class node_strands_handler,node_strands_agent,node_adk_handler,node_adk_agent,node_integrations toneMint
class node_governance_api,node_guardrails toneRose
class node_evaluation_api,node_costs_api,node_telemetry,node_aws,node_registry_service toneIndigo
```

## Components

### Web console

- [Console pages](https://github.com/awslabs/loom/tree/main/frontend/src/pages): `frontend/src/pages`
- [API client](https://github.com/awslabs/loom/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### Control plane

- [FastAPI application](https://github.com/awslabs/loom/blob/main/backend/app/main.py): `backend/app/main.py`
- [Agent lifecycle API](https://github.com/awslabs/loom/blob/main/backend/app/routers/agents.py): `backend/app/routers/agents.py`
- [Invocation API](https://github.com/awslabs/loom/blob/main/backend/app/routers/invocations.py): `backend/app/routers/invocations.py`
- [Identity and scopes](https://github.com/awslabs/loom/blob/main/backend/app/dependencies/auth.py): `backend/app/dependencies/auth.py`
- [Platform database](https://github.com/awslabs/loom/blob/main/backend/app/db.py): `backend/app/db.py`
- [AgentCore deployment](https://github.com/awslabs/loom/blob/main/backend/app/services/deployment.py): `backend/app/services/deployment.py`

### Agent runtime

- [Strands runtime handler](https://github.com/awslabs/loom/blob/main/agents/strands_agent/src/handler.py): `agents/strands_agent/src/handler.py`
- [Strands agent](https://github.com/awslabs/loom/blob/main/agents/strands_agent/src/agent.py): `agents/strands_agent/src/agent.py`
- [ADK runtime handler](https://github.com/awslabs/loom/blob/main/agents/adk_agent/src/handler.py): `agents/adk_agent/src/handler.py`
- [ADK agent](https://github.com/awslabs/loom/blob/main/agents/adk_agent/src/agent.py): `agents/adk_agent/src/agent.py`
- [Agent integrations](https://github.com/awslabs/loom/tree/main/agents/adk_agent/src/integrations): `agents/adk_agent/src/integrations`

### Governance

- [Registry and approvals](https://github.com/awslabs/loom/blob/main/backend/app/routers/registry.py): `backend/app/routers/registry.py`
- [Guardrail services](https://github.com/awslabs/loom/blob/main/backend/app/services/guardrails.py): `backend/app/services/guardrails.py`

### Quality and operations

- [Agent evaluations](https://github.com/awslabs/loom/blob/main/backend/app/routers/evaluations.py): `backend/app/routers/evaluations.py`
- [Cost tracking](https://github.com/awslabs/loom/blob/main/backend/app/routers/costs.py): `backend/app/routers/costs.py`
- [Runtime telemetry](https://github.com/awslabs/loom/blob/main/agents/adk_agent/src/telemetry.py): `agents/adk_agent/src/telemetry.py`

### Other components

- **Platform user**
- **AWS AgentCore and Bedrock**
- **AWS Agent Registry**

## Connections

- Platform user → Console pages: uses (evidence: `README.md`)
- Console pages → API client: requests data
- API client → FastAPI application: calls API
- FastAPI application → Agent lifecycle API: routes requests (evidence: `backend/app/main.py`)
- FastAPI application → Invocation API: routes requests (evidence: `backend/app/main.py`)
- Agent lifecycle API → Platform database: reads and writes (evidence: `backend/app/routers/agents.py`)
- Invocation API → Platform database: reads and writes (evidence: `backend/app/routers/invocations.py`)
- Invocation API → Identity and scopes: checks access (evidence: `backend/app/routers/invocations.py`)
- Agent lifecycle API → AgentCore deployment: deploys agents (evidence: `backend/app/routers/agents.py`)
- AgentCore deployment → AWS AgentCore and Bedrock: provisions runtime
- AWS AgentCore and Bedrock → Strands runtime handler: invokes runtime
- AWS AgentCore and Bedrock → ADK runtime handler: invokes runtime
- Strands runtime handler → Strands agent: builds agent (evidence: `agents/strands_agent/src/handler.py`)
- ADK runtime handler → ADK agent: builds agent (evidence: `agents/adk_agent/src/handler.py`)
- ADK agent → Agent integrations: loads tools (evidence: `agents/adk_agent/src/agent.py`)
- Agent lifecycle API → Registry and approvals: checks approvals
- Registry and approvals → AWS Agent Registry: uses registry
- Invocation API → Guardrail services: applies guardrails (evidence: `backend/app/routers/invocations.py`)
- Platform user → Agent evaluations: runs evaluations
- Platform user → Cost tracking: reviews costs
- Strands agent → Runtime telemetry: emits telemetry (evidence: `agents/strands_agent/src/agent.py`)
- ADK agent → Runtime telemetry: emits telemetry (evidence: `agents/adk_agent/src/agent.py`)
