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.
PraisonAI supports three integration patterns for different deployment scenarios.
Pattern Decision Guide
Pattern B: In-Process Host
Embed PraisonAIUI directly in your Python application.
from praisonai . integration import build_host_app
app = build_host_app (
title = " My Agent App " ,
pages =[ " chat " , " agents " , " sessions " ]
)
# Run with uvicorn main:app
When to Use:
Single application deployment
Direct Python integration needed
Simple agent interactions
Development and testing
When NOT to Use:
Need separate UI and API processes
Complex microservice architecture
High-scale production deployments
Pattern C: Integrated Gateway
Single process serving UI, REST API, and WebSocket on one port.
import asyncio
from praisonai . integration import run_integrated_gateway
async def main ():
await run_integrated_gateway (
port = 8080 ,
host = " 0.0.0.0 " ,
title = " Agent Gateway " ,
agents =[{ " name " : " Assistant " , " llm " : " gpt-4o " }]
)
asyncio . run ( main ())
When to Use:
Need unified endpoint for UI + API
WebSocket real-time communication required
Single-port deployment constraints
Container deployment scenarios
When NOT to Use:
Want separate scaling of UI vs API
Complex routing requirements
Need multiple protocol support
Deferred (P3) - Connect to PraisonAI Cloud via Platform Client
Connect PraisonAIUI to PraisonAI Cloud for managed agents.
# Future implementation
from praisonai . integration import configure_host
configure_host (
title = " Cloud Agents " ,
platform_token = os . getenv ( " PRAISONAI_PLATFORM_TOKEN " )
)
When Available:
Cloud-managed agent infrastructure
Multi-tenant deployments
Enterprise security requirements
Global agent orchestration
Comparison Matrix
Feature Pattern B Pattern C Pattern D Complexity Low Medium High Setup Time Minutes Minutes TBD Scalability Application-bound Single-process Cloud-scale Real-time Via callbacks WebSocket Platform streams Deployment Embedded Standalone Distributed Use Cases Apps, Prototypes Gateways, APIs Enterprise, SaaS
Pattern Examples
FastAPI Integration (Pattern B)
from fastapi import FastAPI
from praisonai . integration import build_host_app
main_app = FastAPI ()
# Your API routes
@ main_app . get ( " /api/health " )
def health ():
return { " status " : " healthy " }
# Mount agent UI
agent_ui = build_host_app (
title = " Agent Dashboard " ,
pages =[ " chat " , " agents " ]
)
main_app . mount ( " /agents " , agent_ui )
# Access at: http://localhost:8000/agents
Container Deployment (Pattern C)
FROM python:3.11
COPY . /app
WORKDIR /app
RUN pip install praisonai[ui]
EXPOSE 8080
CMD [ "python" , "-c" , "import asyncio; from praisonai.integration import run_integrated_gateway; asyncio.run(run_integrated_gateway(port=8080))" ]
Development vs Production
# Quick development setup
from praisonai . integration import build_host_app
app = build_host_app (
title = " Dev Agent " ,
pages =[ " chat " , " agents " , " logs " ],
agent_kwargs ={ " llm " : " gpt-4o-mini " }
)
# Production-ready gateway
import os
from praisonai . integration import run_integrated_gateway
await run_integrated_gateway (
port = int ( os . getenv ( " PORT " , " 8080 " )),
host = " 0.0.0.0 " ,
title = os . getenv ( " APP_TITLE " , " Agent Gateway " ),
agents =[{
" name " : " Production Assistant " ,
" llm " : os . getenv ( " PRAISONAI_MODEL " , " gpt-4o " ),
" instructions " : " You are a production assistant. "
}],
ui_config ={
" analytics " : os . getenv ( " ANALYTICS_ID " ),
" theme " : " production "
}
)
Migration Path
Moving between patterns as your needs evolve:
# Start with Pattern B (embedded)
app = build_host_app ( title = " MVP " )
# Migrate to Pattern C (gateway)
# Extract configuration:
config = {
" title " : " MVP " ,
" agents " : [ ... ],
" pages " : [ ... ]
}
# Use in gateway:
await run_integrated_gateway ( ** config )
# Future: Pattern D (cloud)
# Same config, different backend
configure_host ( platform_token = " ... " , ** config )
Host Integration Implementation details
Backend Injection Custom backend services