Skip to main content
Use this guide when building your own chat app, dashboard, or canvas — not only PraisonAIUI.
The user chats in your app; the agent emits A2UI payloads your frontend renders.

How It Works

Integrate A2UI with Your Frontend

PraisonAI core emits A2UI via the agent tool send_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

Optional React renderer:

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:
Type hint in core (zero runtime cost):

3. Detect in your UI (minimum)

For richer normalisation (surface id, version fields), use PraisonAIUI a2ui_utils.py as a reference — copy or vendor that file in your UI layer.

4. Render and handle user actions

React (Google renderer):
Wire button clicks back to your agent (POST user action → new agent turn).

Transport options

AG-UI CUSTOM event

When a tool returns A2UI, the AG-UI bridge emits an additive event:
The existing 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

Start at tier 0 (Markdown) and move up only when you need structured or generative surfaces.
Map output_pydantic types to your design system — do not hard-code PraisonAI defaults in production UIs.
Use the PraisonAIUI example 29 canvas to validate message flow before custom frontends.
Stream incremental surface updates instead of resending full component trees each turn.

A2UI Protocol

Core A2UI message contract

Generative UI

UI tiers and integration patterns