Skip to main content
PraisonAI uses three store types to manage different kinds of information for your agents.

Quick Start

1

Use All Three Stores

from praisonaiagents import Agent

agent = Agent(
    name="Assistant",
    instructions="You are a helpful assistant",
    memory={"session_id": "chat-123"},  # Conversation Store
    knowledge=["docs/manual.pdf"],       # Knowledge Store
)

agent.start("What does the manual say about setup?")

Quick Comparison

AspectConversation StoreKnowledge StoreState Store
What it storesChat messagesDocuments & chunksLearned facts & preferences
Agent parammemory={"session_id": "..."}knowledge=[...]memory=True
LifetimePersistentPersistentPersistent
DirectionRead + WriteRead-mostlyRead + Write
SearchSequentialSemantic (RAG)Text similarity
DependenciesNonechromadbNone (file) / chromadb
Use caseResume conversationsAnswer from documentsRemember preferences

Conversation Store

Saves chat messages so users can resume conversations after app restart.
from praisonaiagents import Agent

# Session 1: Start a conversation
agent = Agent(
    name="Assistant",
    instructions="You are a helpful assistant",
    memory={"session_id": "my-session-123"}
)
agent.start("My name is Alice and I love Python")

# Session 2 (later): History restored automatically
agent = Agent(
    name="Assistant",
    instructions="You are a helpful assistant",
    memory={"session_id": "my-session-123"}
)
agent.start("What's my name?")  # Remembers: "Alice"

Supported Databases

PostgreSQL

Production-ready

SQLite

Lightweight, local

JSON

Zero dependencies

Knowledge Store

Pre-loads documents into a vector database for semantic search (RAG). Agents find relevant information by meaning, not keywords.
from praisonaiagents import Agent

agent = Agent(
    name="Support Agent",
    instructions="Answer questions using the documentation",
    knowledge=["docs/manual.pdf", "docs/faq.txt"]
)

agent.start("How do I reset my password?")

Supported Databases

ChromaDB

Default, local

Qdrant

Production vector DB

Pinecone

Managed cloud

State Store

Stores learned facts, preferences, and entities across sessions. Agents get smarter over time.
from praisonaiagents import Agent

# Session 1: Agent learns
agent = Agent(
    name="Assistant",
    instructions="Remember user preferences",
    memory=True
)
agent.start("I prefer dark mode and formal responses")

# Session 2: Agent recalls
agent = Agent(
    name="Assistant",
    instructions="Remember user preferences",
    memory=True
)
agent.start("What are my preferences?")
# Remembers: "dark mode and formal responses"

Database Configuration

By default, State Store uses JSON files. To use a database backend:
from praisonaiagents import Agent, MemoryConfig

# State Store with Redis
agent = Agent(
    name="Assistant",
    instructions="Remember user preferences",
    memory=MemoryConfig(
        backend="redis",     # or "sqlite", "postgres", "mongodb"
        learn=True           # Enable learning from interactions
    )
)

# State Store with MongoDB
agent = Agent(
    name="Assistant",
    instructions="Remember user preferences",
    memory=MemoryConfig(
        backend="mongodb",
        auto_memory=True      # Auto-extract facts from conversations
    )
)

Supported Databases

JSON Files

Zero dependencies

Redis

Fast, ephemeral

MongoDB

Document-oriented

Which Store Do I Need?


Using Multiple Stores Together

The most powerful pattern combines all three stores.
from praisonaiagents import Agent, AgentTeam, MemoryConfig

# Agent with all three store types
support = Agent(
    name="Support",
    instructions="Answer questions using docs. Remember user issues.",
    knowledge=["docs/manual.pdf"],    # Knowledge Store
    memory=MemoryConfig(              # Conversation + State Store
        session_id="support-123",
        auto_memory=True
    )
)

escalation = Agent(
    name="Escalation",
    instructions="Handle complex issues based on support findings"
)

team = AgentTeam(
    agents=[support, escalation],
    process="sequential"
)

team.start("My account is locked")

Different Databases Per Store

Each store type can use a different database independently:
from praisonaiagents import Agent, MemoryConfig, KnowledgeConfig

agent = Agent(
    name="Support",
    instructions="Answer questions using docs. Remember user issues.",

    # Knowledge Store → Qdrant vector DB
    knowledge=KnowledgeConfig(
        sources=["docs/manual.pdf"],
        vector_store={
            "provider": "qdrant",
            "url": "http://localhost:6333"
        }
    ),

    # Conversation + State Store → PostgreSQL
    memory=MemoryConfig(
        backend="postgres",           # Conversations persisted to PostgreSQL
        session_id="support-123",
        learn=True                    # State/learning also stored in PostgreSQL
    )
)
StoreConfigAvailable Backends
ConversationMemoryConfig(backend="...")file, sqlite, postgres, redis, mongodb
KnowledgeKnowledgeConfig(vector_store={...})ChromaDB, Qdrant, Pinecone, Weaviate, LanceDB, Milvus, PGVector
StateMemoryConfig(backend="...", learn=True)file, sqlite, postgres, redis, mongodb

Performance

Store TypeSetup TimeQuery TimeDependencies
Conversation0ms1-5msNone
Knowledge1-5s per doc50-200mschromadb
State (file)0ms1-5msNone
State (chromadb)~100ms20-100mschromadb
Start with zero-dependency stores (JSON files). Add chromadb only when you need semantic search.

Best Practices

Most agents only need one store type. Add memory={"session_id": "..."} for chat apps, knowledge=[...] for document Q&A, or memory=True for learning agents. Combine only when your use case requires it.
Include user context in session IDs: user-123-main, support-ticket-456. This isolates conversations and makes debugging easier.
JSON files work for development. For production: PostgreSQL for conversation stores, ChromaDB or Qdrant for knowledge stores, Redis for fast state stores.
Load only relevant documents per agent. A support agent needs FAQs, not engineering specs. Smaller knowledge bases give faster, more accurate results.

Context vs Memory

Ephemeral vs persistent data

Context vs Knowledge

Runtime vs pre-loaded data

Knowledge vs Memory vs Context

Complete comparison with RAG

Session Management

Session persistence details