Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.praison.ai/llms.txt

Use this file to discover all available pages before exploring further.

Generative UI

PraisonAI supports rich agent output through three tiers — use the simplest path that fits your client.

Tiers

TierMechanismBest for
0Markdown streaming (OutputConfig(stream=True, markdown=True))CLI, logs, simple chat
1Structured output (output_pydantic / output_json)APIs — your frontend maps schema → components
2AG-UI (AGUI + FastAPI)CopilotKit / React — streaming text + tool events
3A2UI (optional a2ui-agent-sdk)Cross-platform declarative UI (Flutter, React renderers)
from pydantic import BaseModel
from praisonaiagents import Agent

class Dashboard(BaseModel):
    title: str
    metrics: list[dict]

agent = Agent(name="analyst", output_pydantic=Dashboard)
data = agent.start("Summarise Q1 sales")
# Map Dashboard schema to your React/Vue components

Tier 2 — AG-UI (CopilotKit)

from praisonaiagents import Agent, AGUI
from fastapi import FastAPI

agent = Agent(name="assistant", tools=[search])
agui = AGUI(agent=agent)

app = FastAPI()
app.include_router(agui.get_router())
Deploy: praisonai serve a2u --port 8002 AG-UI streams text deltas and tool call events to compatible frontends. See AG-UI server. A2UI tool results also emit a CUSTOM event name="a2ui" on the AG-UI stream.

Tier 3 — A2UI (optional)

For declarative JSON UI consumed by A2UI renderers:
pip install praisonaiagents[a2ui]
See A2UI Protocol for details. For any custom frontend, see Integrate A2UI with Your Frontend.

What not to use

  • Do not reimplement A2UI types in application code — use the official SDK via praisonaiagents[a2ui].
  • Renderers live outside PraisonAI core (React, Flutter, Lit in the Google A2UI repo).