# manifoldailearning/a2a-samples architecture

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

- Interactive diagram: https://gitdiagram.com/manifoldailearning/a2a-samples
- Repository: https://github.com/manifoldailearning/a2a-samples

## Overview

The visible product is an A2A host demo: users manage agents and settings, create conversations, send messages, and inspect resulting tasks and events. The UI calls a FastAPI conversation service, which delegates to a selected application manager; the ADK manager provides the agent-hosting path, while an in-memory manager supplies canned responses. A separate AGP extension demonstrates capability announcements and policy-based route selection. The graph reflects the supplied tree and excerpts; some page and manager wiring is unsampled, so uncertain links are omitted.

Main entry points: [`demo/ui/pages`](https://github.com/manifoldailearning/a2a-samples/tree/main/demo/ui/pages) (UI pages), [`demo/ui/service/server/server.py`](https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/service/server/server.py) (Conversation API), [`demo/ui/service/server/application_manager.py`](https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/service/server/application_manager.py) (Manager interface), [`demo/ui/state/host_agent_service.py`](https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/state/host_agent_service.py) (Host client helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Demo UI"]
  node_main["UI entry<br/>[main.py]"]
  node_pages["UI pages"]
  node_components["UI components"]
  node_state["UI state<br/>[state.py]"]
  node_state_service["Host client helpers"]
  node_form["Form interaction<br/>[form_render.py]"]
end

subgraph group_host["Conversation host"]
  node_client["Conversation client<br/>[client.py]"]
  node_server["Conversation API<br/>[server.py]"]
  node_types["API types<br/>[types.py]"]
  node_manager_api["Manager interface"]
  node_adk_manager["ADK host manager"]
  node_memory_manager["Canned manager"]
end

subgraph group_agp["AGP routing"]
  node_agp_sim["AGP simulation<br/>[agp_run.py]"]
  node_gateway["Gateway routing<br/>[__init__.py]"]
  node_route_table[("Route table<br/>[__init__.py]")]
end

node_user(("User"))
node_agent(("Remote A2A agents"))
node_requester(("Intent requester"))

node_user -->|"uses UI"| node_main
node_main -->|"renders pages"| node_pages
node_pages -->|"renders widgets"| node_components
node_pages -->|"reads state"| node_state
node_pages -->|"requests host actions"| node_state_service
node_form -->|"sends form reply"| node_state_service
node_state_service -->|"calls API"| node_client
node_client -->|"posts requests"| node_server
node_server -->|"uses message types"| node_types
node_server -->|"delegates operations"| node_manager_api
node_manager_api -->|"implemented by"| node_adk_manager
node_manager_api -.->|"implemented by"| node_memory_manager
node_adk_manager -.->|"communicates with"| node_agent
node_agp_sim -->|"announces and routes"| node_gateway
node_requester -->|"submits intents"| node_agp_sim
node_gateway -->|"updates and reads"| node_route_table

click node_main "https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/main.py"
click node_pages "https://github.com/manifoldailearning/a2a-samples/tree/main/demo/ui/pages"
click node_components "https://github.com/manifoldailearning/a2a-samples/tree/main/demo/ui/components"
click node_state "https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/state/state.py"
click node_state_service "https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/state/host_agent_service.py"
click node_form "https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/components/form_render.py"
click node_client "https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/service/client/client.py"
click node_server "https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/service/server/server.py"
click node_types "https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/service/types.py"
click node_manager_api "https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/service/server/application_manager.py"
click node_adk_manager "https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/service/server/adk_host_manager.py"
click node_memory_manager "https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/service/server/in_memory_manager.py"
click node_agp_sim "https://github.com/manifoldailearning/a2a-samples/blob/main/extensions/agp/agp_run.py"
click node_gateway "https://github.com/manifoldailearning/a2a-samples/blob/main/extensions/agp/src/agp_protocol/__init__.py"
click node_route_table "https://github.com/manifoldailearning/a2a-samples/blob/main/extensions/agp/src/agp_protocol/__init__.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_main,node_pages,node_components,node_state,node_state_service,node_form,node_user toneBlue
class node_client,node_server,node_types,node_manager_api,node_adk_manager,node_memory_manager toneAmber
class node_agp_sim,node_gateway,node_route_table,node_requester toneMint
class node_agent toneIndigo
```

## Components

### Demo UI

- [UI entry](https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/main.py): `demo/ui/main.py`
- [UI pages](https://github.com/manifoldailearning/a2a-samples/tree/main/demo/ui/pages): `demo/ui/pages`
- [UI components](https://github.com/manifoldailearning/a2a-samples/tree/main/demo/ui/components): `demo/ui/components`
- [UI state](https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/state/state.py): `demo/ui/state/state.py`
- [Host client helpers](https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/state/host_agent_service.py): `demo/ui/state/host_agent_service.py`
- [Form interaction](https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/components/form_render.py): `demo/ui/components/form_render.py`

### Conversation host

- [Conversation client](https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/service/client/client.py): `demo/ui/service/client/client.py`
- [Conversation API](https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/service/server/server.py): `demo/ui/service/server/server.py`
- [API types](https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/service/types.py): `demo/ui/service/types.py`
- [Manager interface](https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/service/server/application_manager.py): `demo/ui/service/server/application_manager.py`
- [ADK host manager](https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/service/server/adk_host_manager.py): `demo/ui/service/server/adk_host_manager.py`
- [Canned manager](https://github.com/manifoldailearning/a2a-samples/blob/main/demo/ui/service/server/in_memory_manager.py): `demo/ui/service/server/in_memory_manager.py`

### AGP routing

- [AGP simulation](https://github.com/manifoldailearning/a2a-samples/blob/main/extensions/agp/agp_run.py): `extensions/agp/agp_run.py`
- [Gateway routing](https://github.com/manifoldailearning/a2a-samples/blob/main/extensions/agp/src/agp_protocol/__init__.py): `extensions/agp/src/agp_protocol/__init__.py`
- [Route table](https://github.com/manifoldailearning/a2a-samples/blob/main/extensions/agp/src/agp_protocol/__init__.py): `extensions/agp/src/agp_protocol/__init__.py`

### Other components

- **User**
- **Remote A2A agents**
- **Intent requester**

## Connections

- User → UI entry: uses UI
- UI entry → UI pages: renders pages
- UI pages → UI components: renders widgets
- UI pages → UI state: reads state
- UI pages → Host client helpers: requests host actions
- Form interaction → Host client helpers: sends form reply
- Host client helpers → Conversation client: calls API
- Conversation client → Conversation API: posts requests
- Conversation API → API types: uses message types
- Conversation API → Manager interface: delegates operations
- Manager interface → ADK host manager: implemented by
- Manager interface → Canned manager: implemented by
- ADK host manager → Remote A2A agents: communicates with
- AGP simulation → Gateway routing: announces and routes
- Intent requester → AGP simulation: submits intents
- Gateway routing → Route table: updates and reads
