Skip to main content

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.

Memory troubleshooting helps resolve common errors when configuring memory providers and debugging memory-related issues in PraisonAI agents.

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"

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

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