How It Works
Integrate A2UI with Your Frontend
PraisonAI core emits A2UI via the agent toolsend_a2ui_messages. Your frontend detects the payload and renders with Google A2UI renderers or a custom mapper.
Core SDK documents the contract (
A2UIToolResultProtocol). Detection helpers for rich UI live in PraisonAIUI a2ui_utils as the reference UI implementation — do not expect parsing logic in praisonaiagents core.Prerequisites
Quick Start
1
Install and add the A2UI tool
2
Detect A2UI in your frontend
Four-step contract
1. Agent with the A2UI tool
2. Tool output shape (integrator contract)
send_a2ui_messages returns:
3. Detect in your UI (minimum)
a2ui_utils.py as a reference — copy or vendor that file in your UI layer.
4. Render and handle user actions
React (Google renderer):Transport options
AG-UI CUSTOM event
When a tool returns A2UI, the AG-UI bridge emits an additive event:TOOL_CALL_RESULT with stringified JSON is unchanged for backward compatibility.
Tiers (pick the simplest)
See Generative UI for the full tier list:Reference implementation
PraisonAIUI example 29 — A2UI canvas demonstrates chat + live surface preview.Best Practices
Choose the right UI tier
Choose the right UI tier
Start at tier 0 (Markdown) and move up only when you need structured or generative surfaces.
Own the component mapping at tier 1
Own the component mapping at tier 1
Map
output_pydantic types to your design system — do not hard-code PraisonAI defaults in production UIs.Test with the reference example
Test with the reference example
Use the PraisonAIUI example 29 canvas to validate message flow before custom frontends.
Keep A2UI payloads small
Keep A2UI payloads small
Stream incremental surface updates instead of resending full component trees each turn.
Related
A2UI Protocol
Core A2UI message contract
Generative UI
UI tiers and integration patterns

