Skip to main content

YAML-driven website generator - CLI and compiler

Project description

PraisonAI ๐Ÿฆž

Python Tests PyPI version

AI Dashboard & Multi-Agent Platform โ€” deploy agents with one Python file

PraisonAIUI gives you a full-featured AI dashboard with multi-agent chat, memory, skills, sessions, and 19 admin pages โ€” all from a single app.py. It also supports YAML-driven chat bots and static documentation sites.

Quick Start

1. Install

pip install aiui

2. Create app.py

import praisonaiui as aiui

aiui.set_style("dashboard")

@aiui.reply
async def on_reply(message):
    return f"You said: {message.content}"

3. Run

aiui run app.py

Open http://localhost:8000 โ€” your AI dashboard is live.

YAML Chat Mode

No Python needed โ€” define your agent in YAML:

# chat.yaml
name: My Assistant
instructions: You are a helpful assistant.
model: gpt-4o-mini
welcome: "Hi! How can I help?"
starters:
  - label: "What can you do?"
    message: "Tell me about your capabilities"
profiles:
  - name: Expert
    description: Expert mode
    icon: ๐ŸŽ“
tools:
  - web_search
  - calculate
features: true
datastore: json
aiui run chat.yaml

Documentation Mode

Generate a static documentation site from Markdown:

aiui init
aiui build
aiui serve

UI Styles

Six distinct UI styles, selectable via --style or aiui.set_style():

Style Flag Description Best For
Dashboard --style dashboard Multi-page admin panel with sidebar Agent management, admin dashboards
Chat --style chat Fullscreen/sidebar/floating chat Conversational AI, customer support
Agents --style agents Tabbed multi-agent playground Agent experimentation
Playground --style playground Input/output side-by-side panels Prompt testing, comparison
Docs --style docs Three-column documentation layout Documentation sites, knowledge bases
Custom --style custom User-defined layout Full control
aiui run app.py --style dashboard
aiui run app.py --style chat
aiui run chat.yaml --style agents

Python SDK API

Write app.py using import praisonaiui as aiui:

Configuration

Function Purpose Example
aiui.set_style(style) Set UI style aiui.set_style("dashboard")
aiui.set_pages(ids) Whitelist sidebar pages aiui.set_pages(["chat", "agents", "memory"])
aiui.set_branding(title, logo) Configure branding aiui.set_branding("MyApp", "๐Ÿš€")
aiui.set_datastore(store) Set persistence backend aiui.set_datastore(aiui.JSONFileDataStore())
aiui.set_provider(provider) Set AI provider aiui.set_provider(aiui.get_provider())
aiui.register_agent(config) Register an agent aiui.register_agent({"agent_id": "bot", ...})
aiui.remove_page(id) Remove a page aiui.remove_page("debug")

Callback Decorators

Decorator Purpose
@aiui.reply Handle chat messages
@aiui.welcome Welcome message on connect
@aiui.goodbye Cleanup on disconnect
@aiui.starters Suggest conversation starters
@aiui.profiles Define chat profiles
@aiui.page(slug, ...) Register a custom dashboard page
@aiui.on(event) Listen for server events
@aiui.login Handle authentication
@aiui.settings User settings handler
@aiui.resume Resume interrupted sessions

Message Functions

Function Purpose
await aiui.say(text) Send a message
await aiui.stream(text) Stream a response
await aiui.stream_token(token) Stream token-by-token
await aiui.ask(question) Ask user a question
await aiui.image(url) Send an image
await aiui.audio(url) Send audio
await aiui.action_buttons(buttons) Show action buttons

UI Components

Function Purpose
aiui.layout(children) Page layout container
aiui.card(title, content) Card component
aiui.chart(data, type) Chart (bar, line, pie)
aiui.table(headers, rows) Data table
aiui.columns(cols) Multi-column layout
aiui.text(content) Text block

Full app.py Example

"""Dashboard with three agents and a custom page."""
import os
import praisonaiui as aiui

# โ”€โ”€ Style & pages โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
aiui.set_style("dashboard")
aiui.set_pages([
    "chat", "agents", "memory", "knowledge",
    "skills", "sessions", "usage", "config", "logs",
])

# โ”€โ”€ Branding โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
aiui.set_branding(title="PraisonAI", logo="๐Ÿฆž")

# โ”€โ”€ Agents โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
aiui.register_agent({
    "agent_id": "researcher",
    "name": "Researcher",
    "description": "Finds and summarizes information",
    "instructions": "You are a research assistant.",
    "model": os.getenv("PRAISONAI_MODEL", "gpt-4o-mini"),
    "icon": "๐Ÿ”ฌ",
})

aiui.register_agent({
    "agent_id": "coder",
    "name": "Coder",
    "description": "Writes clean, well-commented code",
    "instructions": "You are a coding assistant.",
    "model": os.getenv("PRAISONAI_MODEL", "gpt-4o-mini"),
    "icon": "๐Ÿ’ป",
})

# โ”€โ”€ Custom page โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
@aiui.page("explorer", title="Explorer", icon="๐Ÿ”ฌ", group="Control", order=55)
async def explorer_page():
    return aiui.layout([aiui.text("Custom page content here.")])
aiui run app.py

Dashboard Pages

All built-in pages available for set_pages():

ID Icon Group Description
chat ๐Ÿ’ฌ Agent AI agent chat
channels ๐Ÿ“ก Agent Messaging platform connections
agents ๐Ÿค– Agent Configured AI agents
skills โšก Agent Agent skills & plugins
memory ๐Ÿง  Agent Agent memory & knowledge
knowledge ๐Ÿ“š Agent Knowledge base & RAG
guardrails ๐Ÿ›ก๏ธ Agent Input/output safety guardrails
overview ๐Ÿ“Š Control System health and statistics
sessions ๐Ÿ“‹ Control Conversation history
usage ๐Ÿ“ˆ Control Token usage & metrics
cron โฐ Agent Scheduled jobs
jobs ๐Ÿ“‹ Control Async agent jobs
approvals โœ… Control Execution approval queue
nodes ๐Ÿ–ฅ๏ธ Control Execution nodes & presence
eval ๐Ÿ“Š Control Agent evaluation & accuracy
api ๐Ÿ”Œ Control OpenAI-compatible API endpoints
config โš™๏ธ Settings Server configuration
auth ๐Ÿ” Settings Authentication settings
logs ๐Ÿ“œ Settings Server logs and events
debug ๐Ÿ› Settings Debug information
telemetry ๐Ÿ“ˆ Settings Telemetry data
traces ๐Ÿ” Settings Distributed traces
security ๐Ÿ”’ Settings Security settings
inspector ๐Ÿ” Control API endpoint debugger (footer)

CLI Commands

Core Commands

aiui init [--template docs|minimal|marketing] [--frontend]  # Create project
aiui validate [--config FILE] [--strict]                     # Validate config
aiui build [--config FILE] [--output DIR] [--minify]         # Build static site
aiui serve [--port 8000] [--reload] [--style STYLE]          # Serve site
aiui run app.py [--port 8000] [--reload] [--style STYLE]     # Run AI server
aiui run chat.yaml [--port 8000] [--style chat]              # Run YAML chat
aiui dev -e examples [--port 9000]                           # Dev dashboard
aiui doctor [--json]                                         # Diagnostics
aiui test chat|memory|sessions|endpoints|all                 # Run tests

Management Commands

# Sessions
aiui sessions list|create|get|delete|messages

# Memory
aiui memory list|add|search|clear|status|context

# Skills
aiui skills list|status|discover

# Agents & Provider
aiui provider status|health|agents

# Config
aiui config get|set|list|history

# Schedules
aiui schedule list|add|remove|status

# Approvals
aiui approval list|pending|resolve

# Workflows
aiui workflows list|run|status|runs

# Hooks
aiui hooks list|trigger|log

# Eval
aiui eval status|list|scores|judges|run

# Traces
aiui traces status|list|spans|get

# Pages
aiui pages list|ids

# Features
aiui features list|status

# Health
aiui health [--detailed]

YAML Configuration

Site Config (config.yaml in ~/.praisonaiui/)

site:
  title: "PraisonAI"
  logo: "๐Ÿฆž"
  theme:
    preset: "zinc"       # 22 Tailwind color presets
    radius: "md"         # none, sm, md, lg, xl
    darkMode: true

pages:
  disabled:
    - debug
    - telemetry

Static Site Config (aiui.template.yaml)

schemaVersion: 1

site:
  title: "My Docs"
  theme:
    preset: "blue"
    darkMode: true

content:
  docs:
    dir: "./docs"

templates:
  docs:
    layout: "ThreeColumnLayout"

Theme Presets

22 Tailwind color presets with automatic dark/light mode:

zinc slate stone gray neutral red orange amber yellow lime green emerald teal cyan sky blue indigo violet purple fuchsia pink rose

Environment Variables

Variable Purpose Default
OPENAI_API_KEY OpenAI API key โ€”
PRAISONAI_MODEL Default model gpt-4o-mini
AIUI_DATA_DIR Data directory ~/.praisonaiui
AIUI_CONFIG Config file path aiui.template.yaml
AIUI_OUTPUT Build output dir aiui

Architecture

Dashboard Mode:                        Docs Mode:
app.py  โ†’  aiui run  โ†’  Server         aiui.template.yaml  โ†’  aiui build  โ†’  aiui/
               โ†“                                                                โ”œโ”€โ”€ index.html
         http://localhost:8000                                                  โ”œโ”€โ”€ docs/*.md
         โ”œโ”€โ”€ /api/chat/ws (WebSocket)                                           โ”œโ”€โ”€ ui-config.json
         โ”œโ”€โ”€ /api/pages                                                         โ””โ”€โ”€ assets/
         โ”œโ”€โ”€ /api/agents
         โ”œโ”€โ”€ /sessions
         โ””โ”€โ”€ /ui-config.json

Development

git clone https://github.com/MervinPraison/PraisonAIUI.git
cd PraisonAIUI
pip install -e .[dev]
pytest tests -v

License

MIT ยฉ Praison Limited

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiui-0.3.98.tar.gz (4.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiui-0.3.98-py3-none-any.whl (814.5 kB view details)

Uploaded Python 3

File details

Details for the file aiui-0.3.98.tar.gz.

File metadata

  • Download URL: aiui-0.3.98.tar.gz
  • Upload date:
  • Size: 4.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for aiui-0.3.98.tar.gz
Algorithm Hash digest
SHA256 b06297c7045d114b587e06f2963260d390bf564d8d4a08cc26fe562aef8ebb6a
MD5 1ba87b82d6ee8c2e3756a3febf809d88
BLAKE2b-256 735c9b73a91b1b0823e9adf6e69dab3f9ae8d54748329d812c660eeff04bfb1d

See more details on using hashes here.

File details

Details for the file aiui-0.3.98-py3-none-any.whl.

File metadata

  • Download URL: aiui-0.3.98-py3-none-any.whl
  • Upload date:
  • Size: 814.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for aiui-0.3.98-py3-none-any.whl
Algorithm Hash digest
SHA256 769549c8009b88933ddce995f330e6349bb95d099484db8207d0f203878275ec
MD5 6658368bf1cc21ecde0b2fb4a59c42c9
BLAKE2b-256 74e396ae41482bc962dbcbb94bf410d14e8aa2edb857ffaf1e09ebcea88c579a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page