Memory. The Python SDK also supports a reranker and graph memory.
Prerequisites
- Python 3.10+ (
pip) or Node.js 18+ (npm) - A running vector store such as Qdrant or Postgres + pgvector (Python’s default Qdrant and Node’s in-memory store need nothing extra)
- API keys for your chosen LLM and embedder providers
Install dependencies
Define your configuration
Each component takes aprovider and a config. Keys are snake_case in Python and camelCase in TypeScript. Pass the config when you create Memory:
The TypeScript OSS SDK configures the LLM, embedder, vector store, and history store. Reranker and graph memory are Python-only today.
from_config:
Verify it works: add a memory and search it back.
memory.add(...) followed by memory.search(...) should populate your vector store and return the memory as a top hit.Available providers
Change theprovider string to switch backends. The most common options:
| Component | Python | TypeScript |
|---|---|---|
| LLM | openai, anthropic, gemini, groq, ollama, aws_bedrock, azure_openai, litellm | openai, anthropic, gemini, groq, ollama, aws_bedrock, azure_openai, mistral, deepseek |
| Embedder | openai, gemini, azure_openai, ollama, huggingface, vertexai, aws_bedrock | openai, gemini, azure_openai, ollama |
| Vector store | qdrant, pgvector, chroma, pinecone, redis, weaviate, milvus, elasticsearch | memory, qdrant, pgvector, redis, supabase, azure-ai-search, vectorize, milvus |
Tune component settings
Vector store collections
Vector store collections
Name collections explicitly in production (
collection_name / collectionName) to isolate tenants and enable per-tenant retention policies.LLM extraction temperature
LLM extraction temperature
Keep extraction temperature at or below 0.2 so memories stay deterministic. Raise it only when you see facts being missed.
Reranker depth (Python)
Reranker depth (Python)
Limit
top_k to 10 to 20 results. Sending more adds latency without meaningful gains.Quick recovery
- Qdrant connection errors: confirm port
6333is exposed and the API key (if set) matches. - Empty search results: verify the embedder model name. A mismatch causes dimension errors.
Unknown reranker(Python): upgrade the SDK withpip install --upgrade mem0aito load the latest provider registry.Cannot find module(Node): import from the OSS entry point,import { Memory } from "mem0ai/oss", not"mem0ai".