Memory troubleshooting helps resolve common errors when configuring memory providers and debugging memory-related issues in PraisonAI agents.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.
Quick Start
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
The Solution
Install the required extras package:Explicit vs Default Behavior
| Configuration | mem0ai 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
- Environment Variable
- Direct Configuration
Common Error Scenarios
User Interaction Flow
Step-by-Step Resolution
- User runs
Agent(memory="mem0")without extras - PraisonAI raises
ImportError: mem0ai is not installed. Run: pip install 'praisonaiagents[memory]' - User runs the suggested install command
- User re-runs the agent code — either works or shows next error (missing API key)
- User sets
MEM0_API_KEYenvironment variable - Agent works successfully
Best Practices
Start with the default, upgrade later
Start with the default, upgrade later
Begin with
memory=True for prototyping, then switch to memory="mem0" for production when you need advanced features.Pin extras in your project
Pin extras in your project
Add
"praisonaiagents[memory]" to your requirements.txt or pyproject.toml to ensure consistent environments.Set keys via environment variables in production
Set keys via environment variables in production
Use
MEM0_API_KEY environment variables rather than hardcoding API keys in your source code.Use memory=True for prototypes
Use memory=True for prototypes
The default file-based memory works great for development and doesn’t require any external dependencies or API keys.
Related
Memory Concepts
Understanding different types of memory and storage options
Advanced Memory
Multi-tiered memory with quality scoring and graph support

