Skip to main content
Memory troubleshooting helps resolve common errors when configuring memory providers and debugging memory-related issues in PraisonAI agents.
from praisonaiagents import Agent

agent = Agent(
    name="Assistant",
    instructions="Help the user remember things.",
    memory=True,
)

agent.start("Remember that I prefer concise answers.")
The user enables memory and hits a provider error; this guide maps common failures to fixes.

Quick Start

1

Default (No Extras) — Works Out of the Box

from praisonaiagents import Agent

agent = Agent(
    name="Assistant",
    instructions="Help the user remember things",
    memory=True  # Uses built-in file storage
)
2

Switch to Real Provider — Install Extras First

pip install "praisonaiagents[memory]"
from praisonaiagents import Agent

agent = Agent(
    name="Assistant",
    instructions="Help the user remember things",
    memory="mem0"  # Now uses Mem0 cloud service
)

Why am I seeing ImportError: mem0ai is not installed...?

This error occurs when you explicitly request a memory provider that requires optional dependencies. The new behavior ensures you get clear feedback instead of silent fallbacks.

The Problem

# This will fail if mem0ai package is not installed
agent = Agent(memory="mem0")

The Solution

Install the required extras package:
pip install "praisonaiagents[memory]"

Explicit vs Default Behavior

Configurationmem0ai installed?Result
memory=True (default)✅ Falls back to file storage
memory="mem0"ImportError: mem0ai is not installed. Run: pip install 'praisonaiagents[memory]'
memory="mem0"✅ Uses Mem0 (if API key set)

Why am I seeing ValueError: Mem0 API Key not provided?

This occurs when the mem0ai package is installed but the API key is missing.

Set the API Key

export MEM0_API_KEY="your-mem0-api-key"

Why is memory="mem0" returning empty search results? (MongoDB vector store)

Search results come back empty because mem0’s MongoDB vector store has an upstream signature-mismatch bug. Symptom: Searches return [], and the logs contain Detected mem0 MongoDB vector store compatibility issue. (before this was surfaced, the adapter path returned empty results with no log at all). Cause: mem0’s MongoDB vector store raises TypeError: unexpected keyword argument 'vectors' on .search() (mem0ai/mem0#3185); PraisonAI catches that specific TypeError, logs a warning, and returns [] so the agent keeps running. PraisonAI does not fix the upstream bug — the fix lives in mem0.

Fix: switch mem0’s vector store to Qdrant or Chroma

from praisonaiagents import Agent

agent = Agent(
    name="Assistant",
    memory={
        "provider": "mem0",
        "config": {
            "vector_store": {
                "provider": "qdrant",
                "config": {"host": "localhost", "port": 6333},
            },
        },
    },
)

Alternative: use PraisonAI’s built-in MongoDB adapter

If you need MongoDB itself, use PraisonAI’s first-party MongoDB Memory adapter — it is a separate implementation, unrelated to mem0, and unaffected by this bug.
from praisonaiagents import Agent

agent = Agent(
    name="Assistant",
    memory={
        "provider": "mongodb",
        "config": {
            "connection_string": "mongodb://localhost:27017/",
            "database": "praisonai",
        },
    },
)
See also the Mem0 integration guide.

Common Error Scenarios

User Interaction Flow

Step-by-Step Resolution

  1. User runs Agent(memory="mem0") without extras
  2. PraisonAI raises ImportError: mem0ai is not installed. Run: pip install 'praisonaiagents[memory]'
  3. User runs the suggested install command
  4. User re-runs the agent code — either works or shows next error (missing API key)
  5. User sets MEM0_API_KEY environment variable
  6. Agent works successfully

Dakera adapter not loading

Symptom: ImportError when using memory="dakera" or memory={"provider": "dakera", ...}.Install the extra:
pip install "praisonaiagents[dakera]"
Or equivalently:
pip install dakera
The exact error message when the package is missing:
dakera is required for the dakera adapter. Install with: pip install 'praisonaiagents[dakera]' (or: pip install dakera)
Explicit provider now raises immediately: Using provider="dakera" raises this ImportError with the install hint instead of silently falling back to SQLite.If the server is unreachable: Ensure Dakera is running at the configured URL (default http://localhost:3000). See dakera-ai/dakera-deploy for Docker Compose setup.

SQLite memory: errors after upgrade

ValueError: Invalid table name

Symptom: ValueError: Invalid table name: … Allowed tables: long_term, short_termCause: Custom code called an internal SQLite helper with a table name other than short_term or long_term.Fix: Use the public API — search_short_term() and search_long_term() — instead of private _search_sqlite* methods.

AttributeError: missing connection helper

Symptom: AttributeError: … has no attribute '_get_stm_conn' (or _get_ltm_conn')Cause: Previously this returned an empty list silently; it now surfaces. The memory object lacks the SQLite connection mixin.Fix: Use Memory(provider="sqlite", …) rather than instantiating mixins directly. Subclasses must implement _get_stm_conn and _get_ltm_conn.

Dakera Adapter Not Loading

Symptom: Running with provider="dakera" raises:
ImportError: dakera is required for the dakera adapter. Install with: pip install 'praisonaiagents[dakera]' (or: pip install dakera)
Fix: Install the Dakera extra:
pip install "praisonaiagents[dakera]"
This error surfaces because explicit provider="dakera" now raises a helpful hint instead of silently falling back to SQLite (fix landed in PR #2591 follow-up commit bbddfe3e).

Best Practices

Begin with memory=True for prototyping, then switch to memory="mem0" for production when you need advanced features.
Add "praisonaiagents[memory]" to your requirements.txt or pyproject.toml to ensure consistent environments.
Use MEM0_API_KEY environment variables rather than hardcoding API keys in your source code.
The default file-based memory works great for development and doesn’t require any external dependencies or API keys.

Memory Concepts

Understanding different types of memory and storage options

Advanced Memory

Multi-tiered memory with quality scoring and graph support

Dakera Memory

Self-hosted, decay-weighted vector recall via the Dakera server.