Skip to main content

Memory Storage

PraisonAI supports 22+ database backends for memory persistence. Choose the right one for your use case.

Storage Categories

Conversation Stores

Store conversation history and chat context. Best for session continuity.

State Stores

Store agent state, checkpoints, and runtime data. Best for complex workflows.

Quick Setup

from praisonaiagents import Agent, db

# SQLite (zero-config, default)
agent = Agent(memory=True)

# PostgreSQL
agent = Agent(
    db=db(database_url="postgresql://localhost/mydb"),
    session_id="user-123"
)

# Redis
agent = Agent(
    db=db(database_url="redis://localhost:6379"),
    session_id="user-123"
)

Choosing a Database

Use CaseRecommendedWhy
Local developmentSQLite/JSONZero config
Production web appPostgreSQLReliable, scalable
High-speed cachingRedisSub-ms latency
ServerlessNeon/UpstashNo server management
AWS infrastructureDynamoDBNative integration