> ## 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 Chat

> Modern AI Agent Chat Interface for PraisonAI

# PraisonAI Chat

PraisonAI Chat is a powerful, modern chat interface designed for AI agent interactions. It provides a beautiful UI for interacting with PraisonAI agents with features like streaming responses, tool call visualization, and session management.

## Installation

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install praisonai[chat]
```

## Quick Start

### CLI Usage

Start the chat interface with a single command:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai chat
```

This starts the chat server at `http://localhost:8000`.

### With Custom Port

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai chat --port 3000
```

### Programmatic Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent
from praisonai.chat import start_chat_server

# Create your agent
agent = Agent(
    name="Assistant",
    instructions="You are a helpful AI assistant."
)

# Start the chat UI with your agent
start_chat_server(agent=agent, port=8000)
```

## Features

<CardGroup cols={2}>
  <Card title="Multi-Agent Support" icon="users">
    Seamlessly interact with multiple AI agents in a single interface
  </Card>

  <Card title="Tool Visualization" icon="wrench">
    See agent tool calls and their results in real-time
  </Card>

  <Card title="Streaming Responses" icon="bolt">
    Real-time streaming of agent responses
  </Card>

  <Card title="Session Management" icon="clock-rotate-left">
    Persistent sessions with full history
  </Card>
</CardGroup>

## Multi-Agent Chat

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent
from praisonai.chat import start_chat_server

# Define multiple agents
researcher = Agent(
    name="Researcher",
    role="Research specialist",
    instructions="You research topics thoroughly."
)

writer = Agent(
    name="Writer", 
    role="Content writer",
    instructions="You write clear, engaging content."
)

# Start chat with multiple agents
start_chat_server(agents=[researcher, writer], port=8000)
```

## Configuration

### ChatConfig Options

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai.chat import start_chat_server, ChatConfig

config = ChatConfig(
    host="0.0.0.0",      # Host to bind to
    port=8000,           # Port number
    debug=False,         # Enable debug mode
    auth_enabled=False,  # Enable authentication
    session_id=None,     # Custom session ID
)

start_chat_server(config=config)
```

### Environment Variables

| Variable                        | Description                                 | Default        |
| ------------------------------- | ------------------------------------------- | -------------- |
| `PRAISONAI_CHAT_PORT`           | Server port                                 | `8000`         |
| `PRAISONAI_CHAT_HOST`           | Server host                                 | `0.0.0.0`      |
| `CHAINLIT_HOST`                 | Host the UI binds to (drives auth mode)     | `127.0.0.1`    |
| `CHAINLIT_USERNAME`             | Username for authentication                 | `admin`        |
| `CHAINLIT_PASSWORD`             | Password for authentication                 | `admin`        |
| `PRAISONAI_ALLOW_DEFAULT_CREDS` | Allow admin/admin on external bind (unsafe) | `false`        |
| `CHAINLIT_AUTH_SECRET`          | Auth secret for sessions                    | Auto-generated |

***

## Security

The chat UI enforces bind-aware authentication — stricter security when bound to external interfaces.

| Interface                               | Security Mode | Credentials                 |
| --------------------------------------- | ------------- | --------------------------- |
| **Loopback** (`127.0.0.1`, `localhost`) | Permissive    | `admin/admin` allowed       |
| **External** (`0.0.0.0`, LAN, public)   | Strict        | Custom credentials required |

<Warning>
  Using default `admin/admin` credentials on external interfaces will cause a `UIStartupError` unless `PRAISONAI_ALLOW_DEFAULT_CREDS=1` is set (demo only).
</Warning>

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Safe for external deployment
export CHAINLIT_USERNAME=myuser
export CHAINLIT_PASSWORD=mypass
praisonai chat --host 0.0.0.0
```

<Card title="Bind-Aware Authentication" icon="shield" href="/docs/features/gateway-bind-aware-auth">
  Complete security configuration guide
</Card>

## UI Features

### Chain of Thought Visualization

The chat interface displays agent reasoning steps, showing how agents arrive at their responses.

### Tool Call Panel

When agents use tools, the UI displays:

* Tool name
* Input arguments
* Tool output/results
* Execution time

### Session History

* Automatic session persistence
* Resume previous conversations
* Export chat history

## Integration with PraisonAI Agents

PraisonAI Chat integrates seamlessly with the full PraisonAI agent framework:

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent, Task, AgentTeam

# Define agents with tools
from praisonaiagents import duckduckgo_search

researcher = Agent(
    name="Researcher",
    role="Research specialist",
    tools=[duckduckgo_search]
)

writer = Agent(
    name="Writer",
    role="Content writer"
)

# Define tasks
research_task = Task(
    description="Research {topic}",
    agent=researcher,
    expected_output="Research findings"
)

write_task = Task(
    description="Write article based on research",
    agent=writer,
    expected_output="Article content"
)

# Create the agents system
agents = AgentTeam(
    agents=[researcher, writer],
    tasks=[research_task, write_task]
)

# The chat UI will automatically detect and use these agents
```

## Upstream Updates

PraisonAI Chat is based on [Chainlit](https://github.com/Chainlit/chainlit), an excellent open-source framework. We maintain compatibility with upstream updates.

To sync with upstream improvements:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
cd PraisonAIChat
make sync-upstream
```

## License

PraisonAI Chat is licensed under the Apache 2.0 License. See [THIRD\_PARTY\_NOTICES.md](https://github.com/MervinPraison/PraisonAIChat/blob/main/THIRD_PARTY_NOTICES.md) for attribution.
