| title | PraisonAI Chat |
|---|---|
| description | Guide to PraisonAI's chat interface with support for 100+ LLMs, internet search, vision models, and custom database configurations |
| icon | comments |
| Interface | Description | URL |
|---|---|---|
| UI | Multi Agents such as CrewAI or AG2 | https://docs.praison.ai/ui/ui |
| Chat | Chat with 100+ LLMs, single AI Agent | https://docs.praison.ai/ui/chat |
| Code | Chat with entire Codebase, single AI Agent | https://docs.praison.ai/ui/code |
- Install PraisonAI Chat:
pip install "praisonai[chat]"- Set up your OpenAI API key:
export OPENAI_API_KEY=xxxxxxxx- Set up your Database URL:
export DATABASE_URL=postgresql+asyncpg://<username>:<password>@<your-db-instance-url>/<database-name>- Launch PraisonAI Chat:
praisonai chat-
URL : http://localhost:8084/
-
Username: admin
-
Password: admin
-
Set Model name to be gpt-4o-mini in the settings
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.
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:
- Upload an image to the chat interface
- Ask questions or request analysis based on the uploaded image
- 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.
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.
To use PostgreSQL as your database backend:
-
Install Required Dependencies
For local development:
pip install asyncpg
For Replit:
- Open the "Packages" tab in the Tools section
- Search for and install:
python3-devlibpq-dev
- Then install Python packages:
pip install asyncpg
-
Set Environment Variables Add these variables to your
.envfile or Replit Secrets: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
-
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
-
Cloud Database Services For Replit, we recommend using cloud database services that provide free tiers:
- Neon (Recommended)
- Supabase
- ElephantSQL
These services provide:
- Free PostgreSQL hosting
- Automatic SSL configuration
- Connection string ready to use
If no DATABASE_URL is provided, PraisonAI Chat will automatically use SQLite with the following default configuration:
DATABASE_URL=sqlite+aiosqlite:///{HOME}/.praison/database.sqlitePraisonAI Chat supports various database backends through SQLAlchemy:
- PostgreSQL (recommended for production)
- MySQL/MariaDB
- SQLite (default)
- Oracle
- Microsoft SQL Server
For other database types, refer to the SQLAlchemy documentation for the correct connection string format.
To facilitate local development with live reload, you can use Docker. Follow the steps below:
-
Create a
Dockerfile.dev:FROM python:3.11-slim WORKDIR /app COPY . . RUN pip install flask praisonai==2.2.2 watchdog EXPOSE 5555 ENV FLASK_ENV=development CMD ["flask", "run", "--host=0.0.0.0"]
-
Create a
docker-compose.yml: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"
-
Run Docker Compose:
docker-compose up
This setup will allow you to develop locally with live reload, making it easier to test and iterate on your code.