> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# PraisonAI Chat

> Guide to PraisonAI's chat interface with support for 100+ LLMs, internet search, vision models, and custom database configurations

<div className="relative w-full aspect-video">
  <iframe className="absolute top-0 left-0 w-full h-full" src="https://www.youtube.com/embed/sw3uDqn2h1Y" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />
</div>

## Different User Interfaces:

| Interface | Description                                | URL                                                                |
| --------- | ------------------------------------------ | ------------------------------------------------------------------ |
| **UI**    | Multi-Agent Systems Interface              | [https://praison.ai/docs/ui/ui](https://praison.ai/docs/ui/ui)     |
| **Chat**  | Chat with 100+ LLMs, single AI Agent       | [https://praison.ai/docs/ui/chat](https://praison.ai/docs/ui/chat) |
| **Code**  | Chat with entire Codebase, single AI Agent | [https://praison.ai/docs/ui/code](https://praison.ai/docs/ui/code) |

## Quick Start

1. Install PraisonAI Chat:

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

2. Set up your OpenAI API key:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
export OPENAI_API_KEY=xxxxxxxx
```

3. Set up your Database URL:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
export DATABASE_URL=postgresql+asyncpg://<username>:<password>@<your-db-instance-url>/<database-name>
```

4. Launch PraisonAI Chat:

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

5. URL : [http://localhost:8084/](http://localhost:8084/)

6. Username: admin

7. Password: admin

8. Set Model name to be gpt-4o-mini in the settings

## Key Features

### Internet Search

PraisonAI Chat now includes internet search capabilities using Crawl4AI and Tavily. This feature allows you to retrieve up-to-date information during your conversations, enhancing the AI's ability to provide current and relevant information.

### Vision Language Model (VLM) Support

You can now upload images and ask questions based on them using Vision Language Models. This multimodal support enables visual understanding and analysis within your chat sessions, allowing for a more comprehensive interaction with the AI.

To use this feature:

1. Upload an image to the chat interface
2. Ask questions or request analysis based on the uploaded image
3. The VLM will process the image and provide insights or answers based on its visual content

These new features significantly expand the capabilities of PraisonAI Chat, allowing for more diverse and informative interactions.

## External Agents

The PraisonAI Chat interface includes sidebar Switch widgets that allow you to toggle external AI coding CLI tools when they are installed on your system. These toggles enhance your chat experience by adding specialized coding capabilities.

### Available External Agents

When the corresponding CLIs are installed, the following toggle switches appear in the sidebar:

* **Claude Code**: Toggle for Claude Code CLI integration (file editing, coding tasks)
* **Gemini CLI**: Toggle for Google Gemini CLI (analysis, search capabilities)
* **Codex CLI**: Toggle for OpenAI Codex CLI (refactoring, optimization)
* **Cursor CLI**: Toggle for Cursor CLI (IDE-style development)

### How It Works

1. **Automatic Detection**: Only CLIs that are installed and available on PATH show toggles
2. **Persistent Settings**: Toggle states are saved to Chainlit settings and persist across sessions
3. **Enhanced Capability**: Enabled external agents add specialized tools to your chat agent
4. **Workspace Integration**: External agents operate within your `PRAISONAI_WORKSPACE` directory

### Usage Example

When you enable external agents and ask coding-related questions, your chat agent can delegate to the appropriate external CLI:

```text theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
User: "Refactor the authentication module in my project"
Assistant: "I'll use Claude Code to analyze and refactor the auth module..."
→ Delegates to Claude Code CLI
```

<Note>
  For complete documentation on external agents across all PraisonAI interfaces, see [External Agents in UI](/docs/features/external-agents-ui).
</Note>

## Custom Database

PraisonAI Chat supports custom database configurations, allowing you to use PostgreSQL or other databases instead of the default SQLite database. This is particularly useful for production environments or when you need more advanced database features.

### PostgreSQL Configuration

To use PostgreSQL as your database backend:

1. **Install Required Dependencies**

   For local development:

   ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
   pip install asyncpg
   ```

   For Replit:

   * Open the "Packages" tab in the Tools section
   * Search for and install:
     * `python3-dev`
     * `libpq-dev`
   * Then install Python packages:

   ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
   pip install asyncpg
   ```

2. **Set Environment Variables**
   Add these variables to your `.env` file or Replit Secrets:

   ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
   DATABASE_URL=postgresql+asyncpg://<username>:<password>@<your-db-instance-url>/<database-name>
   DATABASE_SSL=true  # Required for most cloud PostgreSQL services
   ```

   For Replit:

   * Click on "Tools" in the left sidebar
   * Select "Secrets"
   * Add your database configuration as `DATABASE_URL`

3. **Database Tables**
   The application will automatically:
   * Detect PostgreSQL connections
   * Create all necessary tables if they don't exist
   * Set up proper indexes and constraints
   * Handle table creation errors

4. **Cloud Database Services**
   For Replit, we recommend using cloud database services that provide free tiers:

   * [Neon](https://neon.tech) (Recommended)
   * [Supabase](https://supabase.com)
   * [ElephantSQL](https://www.elephantsql.com)

   These services provide:

   * Free PostgreSQL hosting
   * Automatic SSL configuration
   * Connection string ready to use

### Default Configuration

If no `DATABASE_URL` is provided, PraisonAI Chat will automatically use SQLite with the following default configuration:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
DATABASE_URL=sqlite+aiosqlite:///{HOME}/.praison/database.sqlite
```

### Supported Database Types

PraisonAI Chat supports these database backends for chat storage:

#### Currently Supported Chat Storage Backends

* **PostgreSQL** (recommended for production)
  * `postgresql+asyncpg://user:password@host:port/database`
* **SQLite** (default)
  * `sqlite+aiosqlite:///path/to/database.db`
* **MongoDB** (document database)
  * `mongodb://user:password@host:port/database`
* **Redis** (key-value store with persistence)
  * `redis://user:password@host:port/database`
* **DynamoDB** (AWS managed NoSQL)
  * `dynamodb://region/table-name`

#### Cloud Database Services

* **Supabase** (PostgreSQL-based)
  * `postgresql+asyncpg://user:password@db.supabase.co:5432/postgres`
* **Neon** (PostgreSQL-based)
  * `postgresql+asyncpg://user:password@endpoint.neon.tech:5432/database`

<Note>
  For SurrealDB and vector databases, use their dedicated tool integrations instead of `DATABASE_URL` chat storage configuration. Other databases may be possible via custom adapters or future support.
</Note>

## Local Docker Development with Live Reload

To facilitate local development with live reload, you can use Docker. Follow the steps below:

1. **Create a `Dockerfile.dev`**:
   ```dockerfile theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
   FROM python:3.11-slim

   WORKDIR /app

   COPY . .

   RUN pip install flask praisonai==2.2.25 watchdog

   EXPOSE 5555

   ENV FLASK_ENV=development

   CMD ["flask", "run", "--host=0.0.0.0"]
   ```

2. **Create a `docker-compose.yml`**:
   ```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
   version: '3.8'

   services:
     app:
       build:
         context: .
         dockerfile: Dockerfile.dev
       volumes:
         - .:/app
       ports:
         - "5555:5555"
       environment:
         FLASK_ENV: development
       command: flask run --host=0.0.0.0

     watch:
       image: alpine:latest
       volumes:
         - .:/app
       command: sh -c "apk add --no-cache inotify-tools && while inotifywait -r -e modify,create,delete /app; do kill -HUP 1; done"
   ```

3. **Run Docker Compose**:
   ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
   docker-compose up
   ```

This setup will allow you to develop locally with live reload, making it easier to test and iterate on your code.
