A2UI  by google

Agent-native UI generation and rendering framework

Created 3 months ago
9,587 stars

Top 5.3% on SourcePulse

GitHubView on GitHub
Project Summary

A2UI provides an open standard and libraries for agents to generate and populate rich, updateable user interfaces. It addresses the challenge of presenting complex, interactive UIs from generative AI agents, especially in remote or cross-trust scenarios. The project benefits developers building agent-based applications by enabling safe, expressive, and interoperable UIs across different platforms and frameworks.

How It Works

A2UI employs a declarative JSON format where agents describe UI intent rather than executing code. Client applications maintain a catalog of trusted, pre-approved UI components (e.g., Card, Button) and render the agent's JSON description using these native components. This approach ensures security by design, as agents can only request rendering of known components. The UI representation is a flat list of components with ID references, making it LLM-friendly for generation and incremental updates, facilitating progressive rendering and responsive user experiences.

Quick Start & Requirements

To get started, clone the repository (https://github.com/google/A2UI.git), set up your Gemini API Key, and run the provided agent and client samples.

  • Prerequisites: Node.js (for web clients), Python (for agent samples), and a valid Gemini API Key are required.
  • Demos: Includes a Restaurant Finder Demo. For Flutter developers, the GenUI SDK utilizes A2UI. CopilotKit also offers an A2UI Widget Builder.

Highlighted Details

  • Security First: Agents send declarative data, not executable code, mitigating risks associated with LLM-generated code. Clients control rendering via a trusted component catalog.
  • LLM-Friendly & Incrementally Updateable: The UI is represented as a flat, ID-referenced list of components, simplifying LLM generation and enabling efficient, progressive UI updates.
  • Framework-Agnostic & Portable: Decouples UI structure from implementation, allowing the same A2UI JSON payload to be rendered across diverse client frameworks (e.g., Web, Flutter).
  • Flexibility: Features an open registry pattern for mapping server-side types to custom client implementations, including secure sandboxing via custom component logic.

Maintenance & Community

A2UI is currently in an "Early Stage Public Preview" (v0.8), with the specification and implementations evolving. The project is open for collaboration, feedback, and contributions, with details available in CONTRIBUTING.md.

Licensing & Compatibility

The project is licensed under the Apache 2.0 license. Its framework-agnostic design promotes broad compatibility, though developers are responsible for implementing secure rendering logic within their host applications.

Limitations & Caveats

As an early-stage preview, the specification and implementations are subject to change. A host application built in a supported framework (currently Web or Flutter) is required. Additional renderers (React, SwiftUI) and transports are planned but depend on community contributions.

Health Check
Last Commit

2 days ago

Responsiveness

Inactive

Pull Requests (30d)
120
Issues (30d)
59
Star History
9,791 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.