Integrate PraisonAI agents directly into your application using the built-in host integration module.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.
Quick Start
Integration Patterns
Choose your integration pattern based on your needs:Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
pages | Sequence[str] | None | UI pages to include |
title | str | "PraisonAI" | Application title |
logo | str | "🤖" | Logo or emoji |
sidebar | bool | True | Show navigation sidebar |
page_header | bool | True | Show page header |
theme | Dict[str, Any] | None | Custom theme settings |
agents | List[Any] | None | Pre-configured agents |
agent_kwargs | Dict[str, Any] | None | Default agent parameters |
gateway | Any | None | External gateway reference |
modules | Sequence[str] | None | Additional modules to load |
API Reference
Core Functions
configure_host()
configure_host()
Apply host settings and wire backends. Must be called before
create_host_app().create_host_app()
create_host_app()
Return the Starlette app instance. Call after
configure_host().build_host_app()
build_host_app()
One-shot configuration and app creation. Simplest approach.
run_integrated_gateway()
run_integrated_gateway()
Pattern C: Start gateway with integrated UI on single port (async).
Legacy Mode
@aiui.reply callbacks work - no automatic agent integration.
Common Patterns
Pattern B: In-Process Host
Embed the UI in your existing application:Pattern C: Integrated Gateway
Single process serving UI + API + WebSocket:Custom Bridges
Wire your own backend services:Best Practices
Environment Configuration
Environment Configuration
Use environment variables for configuration that changes between deployments:
Error Handling
Error Handling
Handle import errors gracefully for optional features:
Resource Cleanup
Resource Cleanup
Use context managers for proper cleanup in long-running applications:
Related
Integration Patterns
Compare Pattern B vs C vs D
Backend Injection
Custom backend services

