A2UI - Google's open-source declarative protocol for generating user interfaces using Agent.
A2UI (Agent-to-User Interface) is an open-source agent-based interface protocol from Google used for interaction between AI and user interfaces. A2UI uses AI-generated JSON descriptions to allow the client to natively render the interactive interface, seamlessly...
What is A2UI?
A2UI (Agent-to-User Interface) is an open-source agent-based interface protocol from Google for interaction between AI and user interfaces. A2UI uses AI-generated JSON descriptions to allow the client to natively render the interactive interface, eliminating the need for AI to write front-end code. A2UI supports multiple frameworks (such as Flutter, Angular, and Lit), emphasizes security and consistent style, and is suitable for efficient collaboration on complex tasks. A2UI comes with a rich component library, supports customization, and enables AI to communicate with users through the GUI as naturally as using natural language, driving a revolution in AI interaction.
Main functions of A2UI
-
Dynamically generate user interfaceAI can dynamically generate graphical user interfaces (GUIs) based on task requirements, such as forms, date pickers, and buttons, optimizing the interactive experience for complex tasks.
-
Secure client-side renderingBy using native client-side rendering, the risk of code injection is avoided, ensuring UI security and maintaining a consistent style across multiple platforms (mobile, web, and desktop).
-
Declarative JSON descriptionAI only needs to output JSON data describing the UI intent, without the need to write front-end code, reducing development difficulty and improving development efficiency.
-
Rich component libraryIt comes with a Widget Gallery containing a large number of commonly used UI components, which can be used directly or customized, making it convenient for developers to quickly build interfaces.
-
Frame independenceIt separates the UI structure from the implementation, supports multiple front-end frameworks (such as Flutter, Angular, Lit, etc.), and improves project portability.
-
Incremental update capabilityThe UI is represented by a flat list of components, which supports incremental updates, making it easier for AI to gradually improve the interface during dialogue.
-
Flexible scalabilityIt supports developers in connecting existing UI components with A2UI's data binding and event system by registering "smart wrappers," enabling high customization.
How to use A2UI
- Environmental preparationEnsure that Node.js (version 18 or higher) and Python are installed. Prepare a valid Gemini API key for accessing the AI model.
- Get ProjectClone the A2UI project from GitHub to your local machine.
git clone https://github.com/google/a2ui.git - Set API keyIn the project directory, set the Gemini API key.
export GEMINI_API_KEY="your_gemini_api_key_here" - Running ExampleNavigate to the example directory and run the front-end client:
cd a2ui/samples/client/lit/shell
npm install
npm run dev
-
- Open your browser to access
http://localhost:5173You can then see the A2UI web application.
- Open your browser to access
- Experience featuresEnter prompts such as "book a table for two" or "find nearby Italian restaurants" into a web application and observe how the AI dynamically generates a user interface based on the request.
A2UI's project address
- Project official websitehttps://a2ui.org/
- GitHub repositoryhttps://github.com/google/a2ui
A2UI application scenarios
- Intelligent Customer ServiceAI dynamically generates forms or interactive interfaces based on user questions, such as entering an order number or selecting a question type, to quickly locate the problem and provide a solution.
- Online bookingFor applications such as restaurant, hotel, and flight bookings, AI dynamically generates forms that include date pickers and number of people input fields, allowing users to quickly complete their bookings.
- E-commerce shoppingAI generates product filtering and purchase process interfaces based on user needs, enhancing the shopping experience.
- Personalized learningAI dynamically generates practice questions, test interfaces, or learning resource recommendation interfaces based on students' learning progress, providing a personalized learning experience.
-
Game InteractionAI dynamically generates task interfaces, item selection interfaces, etc., based on the game progress, enhancing the game's interactivity and fun.