# agno-agi/agno architecture

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

- Interactive diagram: https://gitdiagram.com/agno-agi/agno
- Repository: https://github.com/agno-agi/agno
- Video tour (about a minute): https://gitdiagram.com/agno-agi/agno/video

## Overview

Agno is a self-improving agent platform: developers build agents, teams, and workflows; AgentOS serves them as secure, durable APIs and MCP services; and traces, evaluations, and conversation history support improvement. The graph combines documented product capabilities with the principal runtime modules identified by the source index. Several implementation relationships are not visible in the excerpts, so the graph shows only documented links and omits unverified internal call paths.

Main entry points: [`libs/agno/agno/agent/agent.py`](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/agent/agent.py) (Agents), [`libs/agno/agno/api/os.py`](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/api/os.py) (AgentOS services), [`libs/agno/agno/workflow/workflow.py`](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/workflow/workflow.py) (Workflows), [`libs/agno/agno/team/team.py`](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/team/team.py) (Teams)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Agent authoring"]
  node_agent["Agents<br/>[agent.py]"]
  node_team["Teams<br/>[team.py]"]
  node_workflow["Workflows<br/>[workflow.py]"]
  node_router["Workflow routing<br/>[router.py]"]
  node_step["Workflow steps<br/>[step.py]"]
end

subgraph group_runtime["Execution runtime"]
  node_run["Agent runs<br/>[agent.py]"]
  node_model["Model interface<br/>[base.py]"]
  node_tools["Tools and integrations<br/>[function.py]"]
  node_knowledge["Knowledge and retrieval"]
  node_registry["Component registry<br/>[registry.py]"]
  node_exceptions["Runtime errors<br/>[exceptions.py]"]
end

subgraph group_state["Persistence and learning"]
  node_session["Agent sessions<br/>[_storage.py]"]
  node_team_session["Team sessions<br/>[_storage.py]"]
  node_database[("Database layer<br/>[base.py]")]
  node_offload[("Result offloading<br/>[store.py]")]
  node_memory["Learning and memory<br/>[machine.py]"]
end

subgraph group_serving["Platform services"]
  node_agentos["AgentOS services<br/>[os.py]"]
  node_authorization["Authorization<br/>[native_engine.py]"]
  node_scheduler["Scheduling<br/>[scheduler.py]"]
end

subgraph group_improvement["Monitoring and improvement"]
  node_observability["Metrics and traces<br/>[metrics.py]"]
  node_evaluation["Evaluations<br/>[performance.py]"]
end

node_developer(("Developer"))
node_external_client(("Product, MCP, and chat clients"))
node_control_plane(("Control Plane UI"))

node_developer -->|"builds"| node_agent
node_developer -->|"combines agents"| node_team
node_developer -->|"builds"| node_workflow
node_workflow -->|"supports routing"| node_router
node_workflow -->|"supports steps"| node_step
node_agent -.->|"executes runs"| node_run
node_agent -->|"uses models"| node_model
node_agent -->|"uses tools"| node_tools
node_agent -->|"uses knowledge"| node_knowledge
node_agent -->|"persists sessions"| node_session
node_team -->|"persists sessions"| node_team_session
node_session -.->|"stores data"| node_database
node_team_session -->|"stores data"| node_database
node_agent -->|"supports learning"| node_memory
node_agentos -->|"serves API and MCP"| node_external_client
node_agentos -->|"secures access"| node_authorization
node_agentos -->|"schedules runs"| node_scheduler
node_agentos -->|"serves agents"| node_agent
node_agentos -->|"serves teams"| node_team
node_agentos -->|"serves workflows"| node_workflow
node_agent -.->|"emits metrics"| node_observability
node_agent -->|"supports evaluation"| node_evaluation
node_observability -->|"monitors activity"| node_control_plane
node_evaluation -.->|"informs improvement"| node_memory

click node_agent "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/agent/agent.py"
click node_team "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/team/team.py"
click node_workflow "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/workflow/workflow.py"
click node_router "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/workflow/router.py"
click node_step "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/workflow/step.py"
click node_run "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/run/agent.py"
click node_model "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/models/base.py"
click node_tools "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/function.py"
click node_knowledge "https://github.com/agno-agi/agno/tree/main/libs/agno/agno"
click node_session "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/agent/_storage.py"
click node_team_session "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/team/_storage.py"
click node_database "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/db/base.py"
click node_offload "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/offload/store.py"
click node_memory "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/learn/machine.py"
click node_agentos "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/api/os.py"
click node_authorization "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/os/authz/native_engine.py"
click node_scheduler "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/db/schemas/scheduler.py"
click node_observability "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/metrics.py"
click node_evaluation "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/eval/performance.py"
click node_registry "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/registry/registry.py"
click node_exceptions "https://github.com/agno-agi/agno/blob/main/libs/agno/agno/exceptions.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_agent,node_team,node_workflow,node_router,node_step,node_external_client,node_control_plane toneBlue
class node_run,node_model,node_tools,node_knowledge,node_registry,node_exceptions toneAmber
class node_session,node_team_session,node_database,node_offload,node_memory toneMint
class node_agentos,node_authorization,node_scheduler toneRose
class node_observability,node_evaluation,node_developer toneIndigo
```

## Components

### Agent authoring

- [Agents](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/agent/agent.py): `libs/agno/agno/agent/agent.py`
- [Teams](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/team/team.py): `libs/agno/agno/team/team.py`
- [Workflows](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/workflow/workflow.py): `libs/agno/agno/workflow/workflow.py`
- [Workflow routing](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/workflow/router.py): `libs/agno/agno/workflow/router.py`
- [Workflow steps](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/workflow/step.py): `libs/agno/agno/workflow/step.py`

### Execution runtime

- [Agent runs](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/run/agent.py): `libs/agno/agno/run/agent.py`
- [Model interface](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/models/base.py): `libs/agno/agno/models/base.py`
- [Tools and integrations](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/function.py): `libs/agno/agno/tools/function.py`
- [Knowledge and retrieval](https://github.com/agno-agi/agno/tree/main/libs/agno/agno): `libs/agno/agno`
- [Component registry](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/registry/registry.py): `libs/agno/agno/registry/registry.py`
- [Runtime errors](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/exceptions.py): `libs/agno/agno/exceptions.py`

### Persistence and learning

- [Agent sessions](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/agent/_storage.py): `libs/agno/agno/agent/_storage.py`
- [Team sessions](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/team/_storage.py): `libs/agno/agno/team/_storage.py`
- [Database layer](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/db/base.py): `libs/agno/agno/db/base.py`
- [Result offloading](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/offload/store.py): `libs/agno/agno/offload/store.py`
- [Learning and memory](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/learn/machine.py): `libs/agno/agno/learn/machine.py`

### Platform services

- [AgentOS services](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/api/os.py): `libs/agno/agno/api/os.py`
- [Authorization](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/os/authz/native_engine.py): `libs/agno/agno/os/authz/native_engine.py`
- [Scheduling](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/db/schemas/scheduler.py): `libs/agno/agno/db/schemas/scheduler.py`

### Monitoring and improvement

- [Metrics and traces](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/metrics.py): `libs/agno/agno/metrics.py`
- [Evaluations](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/eval/performance.py): `libs/agno/agno/eval/performance.py`

### Other components

- **Developer**
- **Product, MCP, and chat clients**
- **Control Plane UI**

## Connections

- Developer → Agents: builds (evidence: `README.md`)
- Developer → Teams: combines agents (evidence: `README.md`)
- Developer → Workflows: builds (evidence: `README.md`)
- Workflows → Workflow routing: supports routing (evidence: `README.md`)
- Workflows → Workflow steps: supports steps (evidence: `README.md`)
- Agents → Agent runs: executes runs
- Agents → Model interface: uses models
- Agents → Tools and integrations: uses tools
- Agents → Knowledge and retrieval: uses knowledge (evidence: `README.md`)
- Agents → Agent sessions: persists sessions (evidence: `libs/agno/agno/agent/_storage.py`)
- Teams → Team sessions: persists sessions (evidence: `libs/agno/agno/team/_storage.py`)
- Agent sessions → Database layer: stores data (evidence: `libs/agno/agno/agent/_storage.py`)
- Team sessions → Database layer: stores data (evidence: `libs/agno/agno/team/_storage.py`)
- Agents → Learning and memory: supports learning (evidence: `README.md`)
- AgentOS services → Product, MCP, and chat clients: serves API and MCP (evidence: `README.md`)
- AgentOS services → Authorization: secures access (evidence: `README.md`)
- AgentOS services → Scheduling: schedules runs (evidence: `README.md`)
- AgentOS services → Agents: serves agents (evidence: `README.md`)
- AgentOS services → Teams: serves teams (evidence: `README.md`)
- AgentOS services → Workflows: serves workflows (evidence: `README.md`)
- Agents → Metrics and traces: emits metrics
- Agents → Evaluations: supports evaluation
- Metrics and traces → Control Plane UI: monitors activity (evidence: `README.md`)
- Evaluations → Learning and memory: informs improvement
