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.
Persistence Quickstart
Enable automatic conversation persistence with memory configuration.
Installation
pip install "praisonaiagents[tools]"
Docker Setup
# PostgreSQL
docker run -d --name praison-postgres -p 5432:5432 \
-e POSTGRES_PASSWORD=praison123 \
-e POSTGRES_DB=praisonai \
postgres:16
# Qdrant (optional - for knowledge)
docker run -d --name praison-qdrant -p 6333:6333 qdrant/qdrant
# Redis (optional - for state)
docker run -d --name praison-redis -p 6379:6379 redis:7
Basic Usage
from praisonaiagents import Agent
# Create agent with persistence
agent = Agent(
name="Assistant",
instructions="You are a helpful assistant.",
memory={
"db": "postgresql://postgres:praison123@localhost:5432/praisonai",
"session_id": "my-session-001"
}
)
# All chats are automatically persisted
response = agent.start("My name is Alice")
print(response)
SQLite (Zero Config)
from praisonaiagents import Agent
agent = Agent(
name="Assistant",
memory={
"db": "conversations.db",
"session_id": "local-session"
}
)
response = agent.start("Hello!")
print(response)
Backend Options
from praisonaiagents import Agent
# PostgreSQL
agent = Agent(
name="Bot",
memory={"db": "postgresql://user:pass@localhost/db"}
)
# SQLite
agent = Agent(
name="Bot",
memory={"db": "mydata.db"}
)
# MySQL
agent = Agent(
name="Bot",
memory={"db": "mysql://user:pass@localhost/db"}
)
Environment Variables
export PRAISON_CONVERSATION_URL="postgresql://localhost/mydb"
export OPENAI_API_KEY="your-key"
import os
from praisonaiagents import Agent
agent = Agent(
name="Assistant",
memory={"db": os.getenv("PRAISON_CONVERSATION_URL")}
)
CLI Usage
# Validate connectivity
praisonai persistence doctor \
--conversation-url "postgresql://postgres:praison123@localhost/praisonai"
# Run agent with persistence
praisonai persistence run \
--session-id "cli-session" \
--conversation-url "postgresql://postgres:praison123@localhost/praisonai" \
"Hello, my name is Bob"
Next Steps