Oday Bakkour Logo
Back to Vault
developmenttoolkitfree

A2UI: Agent-to-User Interface

1 hour
beginner
A2UI: Agent-to-User Interface

Get Started

Open-source toolkit for AI agents to generate safe, expressive UIs across platforms. Supports Flutter, web, and more.

Access Resource

External Resource • Safe Link

A2UI: Agent-to-User Interface

A2UI is an open-source project that enables AI agents to generate and populate rich, interactive user interfaces across platforms. It provides a declarative JSON format for UI specifications and initial renderers.

Summary

Generative AI excels at text/code creation but struggles with UI presentation, especially across trust boundaries. A2UI solves this by:

  • Declarative JSON Format: Agents send UI intent as structured data
  • Client-Side Rendering: Native implementations (Flutter, Angular, Lit, etc.) render safely
  • Security First: Pre-approved component catalogs prevent code execution risks
  • LLM-Friendly: Incrementally updatable flat component structures
  • Framework-Agnostic: Same JSON renders across platforms

Core Philosophy

  • Security: Declarative data format, not executable code
  • Incremental Updates: Flat component lists with ID references for progressive rendering
  • Portability: Abstract descriptions mapped to native widgets
  • Flexibility: Registry pattern for custom component implementations

Use Cases

  1. Dynamic Data Collection: Context-aware forms (e.g., specialized booking systems)
  2. Remote Sub-Agents: Orchestrate specialized agents with UI payloads (e.g., travel booking)
  3. Adaptive Workflows: Generate approval dashboards/data visualizations on-demand

Architecture

  1. Generation: Agent creates A2UI JSON payload
  2. Transport: Send via A2A Protocol/AG UI
  3. Resolution: Client renderer parses JSON
  4. Rendering: Maps abstract components to native widgets

Getting Started

Prerequisites

  • Node.js (web clients)
  • Python (agent samples)
  • Gemini API key

Restaurant Finder Demo

# Clone & setup
git clone https://github.com/google/A2UI.git
cd A2UI
export GEMINI_API_KEY="your_key"

# Run Agent
cd samples/agent/adk/restaurant_finder
uv run .

# Run Client (new terminal)
cd renderers/markdown/markdown-it && npm install && npm run build
cd ../../web_core && npm install && npm run build
cd ../lit && npm install && npm run build
cd ../../samples/client/lit/shell && npm install && npm run dev

Roadmap

  • Spec stabilization (v1.0)
  • React, Jetpack Compose, SwiftUI renderers
  • REST transport support
  • Genkit/LangGraph integrations

License

Apache 2.0

Explore Documentation

#ai#ui#agent#interface#json#declarative#flutter#web#open-source

Comments

Share your thoughts and join the conversation

Leave a Comment

Loading comments...
A2UI: AI Agent UI Toolkit | Oday Bakkour