PraisonAIUI exposes an AG-UI SSE endpoint (POST /agui) so CopilotKit and any AG-UI-compatible frontend can stream runs directly from your PraisonAI agents.
POST /agui
The AG-UI encoder and runner come from praisonaiagents:
praisonaiagents
When praisonaiagents is not installed (or no agent is available), POST /agui returns HTTP 503 and GET /agui/status reports "status": "unavailable".
503
GET /agui/status
"status": "unavailable"
Register an agent in your app.py (or configure one via the Agents page or PraisonAI gateway):
app.py
POST /agui resolves the target agent in this order:
1. Explicitly registered agents (aiui.register_agent(name, agent)) matching agent_name in the JSON body or ?agent=<name> query parameter (falls back to the registered agent when omitted).
aiui.register_agent(name, agent)
agent_name
?agent=<name>
2. Active AIUIGateway agents when running with --backend praisonai.
AIUIGateway
--backend praisonai
3. Existing provider agents, or lazily constructed agents from the Agents CRUD store when praisonaiagents is installed.
| Method | Path | Description |
|---|---|---|
| POST | /agui | Stream an AG-UI run (text/event-stream). Validates the body as RunAgentInput (400 on invalid payload, 503 when no agent or praisonaiagents is available). |
POST
/agui
text/event-stream
RunAgentInput
400
| OPTIONS | /agui | CORS preflight for browser AG-UI clients. |
OPTIONS
| GET | /agui/status | Check availability: {"status": "available" \| "unavailable", "agent_registered": bool}. |
GET
/agui/status
{"status": "available" \| "unavailable", "agent_registered": bool}
Select a specific agent with "agent_name": "researcher" in the JSON body or ?agent=researcher on the URL.
"agent_name": "researcher"
?agent=researcher
AG-UI is shipped as the built-in plugin builtin.agui. To disable it:
builtin.agui