What is A2UI in Google? Agent-to-User Interface Explained

A2UI (Agent-to-User Interface) is Google's open-source framework that enables LLM-driven agents to declare user interfaces through a streaming JSON protocol, creating a secure contract between agent generation and client-side rendering.

The google/A2UI repository implements the Agent-to-User Interface protocol, allowing AI agents to produce declarative UI components that render progressively across web, mobile, and future platforms. This framework separates interface generation from execution, enabling secure, framework-agnostic user experiences driven by large language models.

Core Architecture of the A2UI Framework

The architecture enforces a strict separation between generation (the LLM produces JSON) and execution (the client renders native widgets). This design delivers three critical advantages: LLM-friendly streaming generation, security through catalog-based rendering, and complete framework independence.

Transport and Protocol Layer

At the transport layer, A2UI transmits line-delimited JSON (JSONL) over Server-Sent Events (SSE). The A2uiSchemaManager class in agent_sdks/python/src/a2ui/core/schema/manager.py constructs schema constraints that guide LLM output, ensuring generated JSON adheres to the protocol specification while enabling real-time streaming.

UI Description and Component Catalog

The protocol defines three primary message types that structure the interface declaration:

  • surfaceUpdate: Declares component definitions as a flat adjacency list
  • dataModelUpdate: Transfers data bindings and state changes
  • beginRendering: Triggers the client to render buffered components

The component catalog enumerates permissible widget types (e.g., Text, Button, Card). According to agent_sdks/python/src/a2ui/basic_catalog/provider.py, the BasicCatalog class supplies the standard catalog for version 0.8, which agents negotiate via A2A extension metadata.

Agent Extension and Client Rendering

Agents advertise UI capabilities through the get_a2ui_agent_extension function in agent_sdks/python/src/a2ui/a2a.py. This utility builds extension descriptions specifying supported catalog IDs and whether inline catalogs are accepted. Client implementations (located in renderers/lit/ and related directories) buffer these components, resolve data bindings, and construct native widgets without executing arbitrary agent code.

Implementing A2UI in Python Applications

The Python SDK provides concrete utilities for integrating A2UI into A2A (Agent-to-Agent) compatible systems.

Parsing LLM Output into A2UI Parts

When an LLM generates UI descriptions wrapped in <<A2UI>> tags, the parse_response_to_parts function extracts valid JSON payloads. The create_a2ui_part helper wraps Python dictionaries into DataPart objects with the MIME type application/json+a2ui, enabling the A2A runtime to recognize UI data:

from a2ui.a2a import create_a2ui_part, parse_response_to_parts

# Example LLM output with A2UI delimiters

llm_output = """
Here is the UI for the restaurant list:
<<A2UI>>
[
  {"surfaceUpdate": {"components": [{"id":"root","component":{"Column":{"children":{"explicitList":["list"]}}}}]},
  {"surfaceUpdate": {"components": [{"id":"list","component":{"List":{"template":{"dataBinding":"/restaurants","componentId":"card"}}}}]},
  {"catalogId": "https://a2ui.org/specification/v0_8/standard_catalog_definition.json"}
]
<<A2UI>>
"""

parts = parse_response_to_parts(llm_output, fallback_text="No UI generated.")

Configuring the Schema Manager

The A2uiSchemaManager validates UI generation against protocol schemas and manages catalog configurations:

from a2ui.core.schema.manager import A2uiSchemaManager
from a2ui.basic_catalog.provider import BasicCatalog
from a2ui.core.schema.common_modifiers import remove_strict_validation

schema_mgr = A2uiSchemaManager(
    version="0.8",
    catalogs=[BasicCatalog.get_config(version="0.8", examples_path="examples")],
    schema_modifiers=[remove_strict_validation],
)

This manager loads server-to-client and common-types schemas, applies modifiers such as remove_strict_validation, and prepares catalog definitions for prompt injection.

Advertising A2UI Capabilities

Agents must declare their UI support in their AgentCard metadata using the extension builder:

from a2ui.a2a import get_a2ui_agent_extension

extension = get_a2ui_agent_extension(
    accepts_inline_catalogs=True,
    supported_catalog_ids=[
        "https://a2ui.org/specification/v0_8/standard_catalog_definition.json"
    ],
)

This extension object informs clients which catalogs the agent recognizes and whether it accepts inline catalog definitions beyond the standard set.

Complete Agent Implementation

The RestaurantAgent sample in samples/agent/adk/restaurant_finder/agent.py demonstrates end-to-end implementation:

self._schema_manager = (
    A2uiSchemaManager(
        VERSION_0_8,
        catalogs=[BasicCatalog.get_config(version=VERSION_0_8, examples_path="examples")],
        schema_modifiers=[remove_strict_validation],
    )
    if use_ui else None
)

instruction = (
    self._schema_manager.generate_system_prompt(
        role_description=ROLE_DESCRIPTION,
        ui_description=UI_DESCRIPTION,
        include_schema=True,
        include_examples=True,
        validate_examples=True,
    )
    if use_ui else get_text_prompt()
)

This implementation creates a schema manager, generates system prompts that include UI schemas and examples, and streams validated UI JSON to clients for real-time rendering.

Key Source Files and Their Roles

Understanding the repository structure helps developers navigate the implementation:

Summary

  • A2UI provides a JSON-based, streaming protocol for LLM agents to declare user interfaces declaratively
  • The architecture separates generation (agent produces JSONL over SSE) from execution (client renders from trusted catalogs)
  • The Python SDK in google/A2UI offers A2uiSchemaManager for validation and get_a2ui_agent_extension for capability advertisement
  • Security is enforced through catalog-based rendering, where clients only instantiate pre-defined component types
  • The framework supports progressive streaming, enabling real-time UI generation as the LLM produces content

Frequently Asked Questions

What does A2UI stand for in Google's implementation?

A2UI stands for Agent-to-User Interface. It represents an open-source protocol and SDK that enables AI agents to generate user interface descriptions in JSON format, which client applications render into native widgets without executing arbitrary code from the agent.

How does A2UI differ from traditional UI generation methods?

Unlike traditional server-side rendering or direct code generation, A2UI uses a declarative JSON protocol transmitted over Server-Sent Events. This approach allows progressive streaming of UI components as the LLM generates them, while maintaining security through a strict component catalog system that prevents code injection.

What programming languages support A2UI development?

Currently, Google provides an official Python SDK in the agent_sdks/python/ directory, featuring modules like a2a.py and schema/manager.py. Client renderers exist for web platforms (Lit, Angular) and mobile (Flutter), with the protocol specification being language-agnostic JSON.

Where can I find the complete A2UI protocol specification?

The complete protocol definition resides in specification/v0_8/docs/a2ui_protocol.md within the google/A2UI repository. This document details message types including surfaceUpdate, dataModelUpdate, and beginRendering, along with catalog negotiation and event handling specifications.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →