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.
AI Agent
Database adapter interface for PraisonAI Agents.
This module provides the protocol and types for database persistence.
Implementations are provided by the wrapper layer (praisonai.db).
Usage (simplest - recommended):
from praisonaiagents import Agent, db
agent = Agent(
name=“Assistant”,
db=db(database_url=“postgresql://localhost/mydb”), # db(…) shortcut
session_id=“my-session” # optional: defaults to per-hour ID
)
agent.chat(“Hello!”) # auto-persists messages, runs, traces, tool calls
Alternative (explicit backend):
db=db.PraisonDB(database_url=”…”) # Auto-detect backend
db=db.PostgresDB(host=“localhost”) # PostgreSQL
db=db.SQLiteDB(path=“data.db”) # SQLite
db=db.RedisDB(host=“localhost”) # Redis (state only)
Import
from praisonaiagents import db