# flutter/genui architecture

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

- Interactive diagram: https://gitdiagram.com/flutter/genui
- Repository: https://github.com/flutter/genui

## Overview

GenUI is an experimental Flutter SDK for rendering interactive interfaces from agent-produced JSON, using developers’ widget catalogs rather than generated code. The principal loop is agent response → transport/A2UI handling → catalog-based rendering → client-side state updates → feedback to the agent. The README also describes chat and canvas UX, custom widgets, schema support, and optional A2A integration. Package-level paths and relationships below follow README descriptions; sampled source covers native tool launchers, not the Dart package implementations.

Main entry points: [`packages/genui`](https://github.com/flutter/genui/tree/main/packages/genui) (GenUI core), [`packages/genui_a2a`](https://github.com/flutter/genui/tree/main/packages/genui_a2a) (A2A connector), [`packages/genai_primitives`](https://github.com/flutter/genui/tree/main/packages/genai_primitives) (GenAI primitives), [`packages/json_schema_builder`](https://github.com/flutter/genui/tree/main/packages/json_schema_builder) (JSON schema builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Agent integration"]
  node_adapter["Transport adapter"]
  node_a2a["A2A connector"]
end

subgraph group_core["GenUI runtime"]
  node_runtime["GenUI core"]
  node_a2ui["A2UI support"]
  node_binding["Data binding"]
  node_model[("Client data model")]
end

subgraph group_ui["Interactive UI"]
  node_catalog["Standard catalog"]
  node_custom["Custom widgets"]
  node_composition["Widget composition"]
  node_chat["Chat UX"]
  node_canvas["Canvas UX"]
end

subgraph group_foundation["Shared foundations"]
  node_primitives["GenAI primitives"]
  node_schema["JSON schema builder"]
end

node_user(("User"))
node_agent(("Agent / LLM"))
node_backend{{"Agent backend"}}

node_agent -->|"sends response"| node_adapter
node_adapter -->|"ingests response"| node_runtime
node_runtime -->|"uses protocol"| node_a2ui
node_runtime -->|"renders from"| node_catalog
node_runtime -->|"supports"| node_custom
node_runtime -->|"composes widgets"| node_composition
node_catalog -->|"presents UI"| node_user
node_custom -->|"presents UI"| node_user
node_user -->|"interacts with"| node_binding
node_binding -->|"updates"| node_model
node_model -->|"feeds state"| node_agent
node_chat -->|"supports conversation"| node_user
node_canvas -->|"supports canvas"| node_user
node_backend -->|"connects through"| node_a2a
node_a2a -->|"integrates with"| node_runtime
node_runtime -->|"depends on"| node_primitives
node_primitives -->|"depends on"| node_schema

click node_adapter "https://github.com/flutter/genui/tree/main/packages/genui"
click node_a2a "https://github.com/flutter/genui/tree/main/packages/genui_a2a"
click node_runtime "https://github.com/flutter/genui/tree/main/packages/genui"
click node_a2ui "https://github.com/flutter/genui/tree/main/packages/genui"
click node_catalog "https://github.com/flutter/genui/tree/main/packages/genui"
click node_custom "https://github.com/flutter/genui/tree/main/packages/genui"
click node_composition "https://github.com/flutter/genui/tree/main/packages/genui"
click node_chat "https://github.com/flutter/genui/tree/main/packages/genui"
click node_canvas "https://github.com/flutter/genui/tree/main/packages/genui"
click node_binding "https://github.com/flutter/genui/tree/main/packages/genui"
click node_model "https://github.com/flutter/genui/tree/main/packages/genui"
click node_primitives "https://github.com/flutter/genui/tree/main/packages/genai_primitives"
click node_schema "https://github.com/flutter/genui/tree/main/packages/json_schema_builder"

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_adapter,node_a2a,node_user toneBlue
class node_runtime,node_a2ui,node_binding,node_model toneAmber
class node_catalog,node_custom,node_composition,node_chat,node_canvas toneMint
class node_primitives,node_schema toneRose
class node_agent,node_backend toneIndigo
```

## Components

### Agent integration

- [Transport adapter](https://github.com/flutter/genui/tree/main/packages/genui): `packages/genui`
- [A2A connector](https://github.com/flutter/genui/tree/main/packages/genui_a2a): `packages/genui_a2a`

### GenUI runtime

- [GenUI core](https://github.com/flutter/genui/tree/main/packages/genui): `packages/genui`
- [A2UI support](https://github.com/flutter/genui/tree/main/packages/genui): `packages/genui`
- [Data binding](https://github.com/flutter/genui/tree/main/packages/genui): `packages/genui`
- [Client data model](https://github.com/flutter/genui/tree/main/packages/genui): `packages/genui`

### Interactive UI

- [Standard catalog](https://github.com/flutter/genui/tree/main/packages/genui): `packages/genui`
- [Custom widgets](https://github.com/flutter/genui/tree/main/packages/genui): `packages/genui`
- [Widget composition](https://github.com/flutter/genui/tree/main/packages/genui): `packages/genui`
- [Chat UX](https://github.com/flutter/genui/tree/main/packages/genui): `packages/genui`
- [Canvas UX](https://github.com/flutter/genui/tree/main/packages/genui): `packages/genui`

### Shared foundations

- [GenAI primitives](https://github.com/flutter/genui/tree/main/packages/genai_primitives): `packages/genai_primitives`
- [JSON schema builder](https://github.com/flutter/genui/tree/main/packages/json_schema_builder): `packages/json_schema_builder`

### Other components

- **User**
- **Agent / LLM**
- **Agent backend**

## Connections

- Agent / LLM → Transport adapter: sends response
- Transport adapter → GenUI core: ingests response
- GenUI core → A2UI support: uses protocol
- GenUI core → Standard catalog: renders from
- GenUI core → Custom widgets: supports
- GenUI core → Widget composition: composes widgets
- Standard catalog → User: presents UI
- Custom widgets → User: presents UI
- User → Data binding: interacts with
- Data binding → Client data model: updates
- Client data model → Agent / LLM: feeds state
- Chat UX → User: supports conversation
- Canvas UX → User: supports canvas
- Agent backend → A2A connector: connects through
- A2A connector → GenUI core: integrates with
- GenUI core → GenAI primitives: depends on
- GenAI primitives → JSON schema builder: depends on
