Skip to main content

Storage Backends

PraisonAI provides pluggable storage backends for training data, session state, and general persistence. Switch between file-based and database storage without changing your application code.

Supported Backends

Quick Start

Any Component with Any Backend

All storage components support pluggable backends. Create a backend once and use it with any component:

FileBackend

JSON file-based storage. Each key becomes a separate .json file.
Features:
  • Zero dependencies (uses built-in json)
  • Thread-safe with atomic writes
  • Human-readable files
  • Easy debugging and inspection

SQLiteBackend

SQLite database storage. All data in a single .db file.
Features:
  • Zero dependencies (uses built-in sqlite3)
  • ACID transactions
  • Better concurrent access
  • Faster for large datasets
  • Single file deployment

Using with Training Storage

Using with Learn Stores

Async Support

For async applications, use AsyncBaseJSONStore:

Custom Backends

Implement StorageBackendProtocol for custom backends:

Protocol Reference

RedisBackend

Redis-based storage for high-speed caching and ephemeral data.
Features:
  • Sub-millisecond latency
  • Built-in TTL support
  • Automatic key prefixing
  • Requires redis package: pip install redis

Using with RunHistory (Recipe History)

Store recipe run history with pluggable backends:

Using with SessionManager (Session State)

Persist CLI session state with different backends:

Using with MCPToolIndex (Tool Index)

Store MCP tool schemas with pluggable backends:

Choosing a Backend

Backend Comparison

Database Overview

All supported databases

Memory Storage

Agent memory persistence

Training

Agent training with storage

Session Resume

Continue conversations