Mem0 Integration

Mem0 provides semantic memory capabilities — auto-learning from conversations and retrieving relevant memories via vector search.

How It Works

  1. Auto-learn: After each agent response, the conversation is sent to Mem0 in a background task
  2. Memory extraction: Mem0’s LLM extracts key facts and preferences
  3. Embedding: Facts are embedded and stored in a vector database
  4. Retrieval: When building context for new messages, relevant memories are retrieved via semantic search

Setup

Terminal window
# Install PocketPaw
curl -fsSL https://pocketpaw.xyz/install.sh | sh
# Or add the memory extra manually
pip install pocketpaw[memory]
# Configure Mem0
export POCKETCLAW_MEM0_AUTO_LEARN=true
export POCKETCLAW_MEM0_LLM_PROVIDER="ollama"
export POCKETCLAW_MEM0_LLM_MODEL="llama3.2"
export POCKETCLAW_MEM0_EMBEDDER_PROVIDER="ollama"
export POCKETCLAW_MEM0_EMBEDDER_MODEL="nomic-embed-text"
export POCKETCLAW_MEM0_VECTOR_STORE="qdrant"

Provider Configuration

LLM Provider

The LLM is used by Mem0 to extract facts from conversations:

ProviderConfigNotes
Ollamaollama / llama3.2Free, local, recommended
Anthropicanthropic / claude-sonnet-4-5-20250929Needs API key
OpenAIopenai / gpt-4o-miniNeeds API key

Embedder Provider

The embedder converts text to vectors for semantic search:

ProviderConfigNotes
Ollamaollama / nomic-embed-textFree, local
OpenAIopenai / text-embedding-3-smallNeeds API key

Vector Store

StoreDescription
QdrantDefault, runs embedded or as service
ChromaAlternative, runs embedded

Embedding Dimensions

Embedding dimensions must match between the model and the vector store collection. PocketPaw includes a built-in dimensions lookup and auto-detection for Ollama models:

_EMBEDDING_DIMS = {
"nomic-embed-text": 768,
"mxbai-embed-large": 1024,
"text-embedding-3-small": 1536,
"text-embedding-3-large": 3072,
}

For unknown Ollama models, PocketPaw queries the model to auto-detect dimensions.

Dashboard Configuration

The web dashboard provides a Memory settings panel where you can:

  • Enable/disable auto-learning
  • Select LLM and embedder providers
  • Choose models
  • Test memory retrieval
Warning

After changing memory settings, you must restart the memory manager. The dashboard handles this via get_memory_manager(force_reload=True). Note that get_settings() is LRU-cached — the cache must be cleared after saving settings.

Fully Local Setup

For a completely local memory system with no external API calls:

Terminal window
# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh
# Pull models
ollama pull llama3.2
ollama pull nomic-embed-text
# Configure
export POCKETCLAW_MEM0_AUTO_LEARN=true
export POCKETCLAW_MEM0_LLM_PROVIDER="ollama"
export POCKETCLAW_MEM0_LLM_MODEL="llama3.2"
export POCKETCLAW_MEM0_EMBEDDER_PROVIDER="ollama"
export POCKETCLAW_MEM0_EMBEDDER_MODEL="nomic-embed-text"
export POCKETCLAW_MEM0_VECTOR_STORE="qdrant"

This runs everything locally — LLM inference, embedding, and vector storage.