Configure the OSS Stack - Mem0
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Mem0 OSS works out of the box with OpenAI defaults. Point it at your own LLM, embedder, and vector store by passing a config when you create 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
New to Mem0 OSS? Run the Python or Node.js quickstart first, then come back to swap in your own providers.
Install dependencies
pip
pip install mem0ai
npm
npm install mem0ai
Using Qdrant as your vector store? Install its Python client (the Node SDK talks to Qdrant over REST) and run the server locally:
pip install qdrant-client # Python only
docker run -p 6333:6333 qdrant/qdrant
Define your configuration
Each component takes a provider and a config. Keys are snake_case in Python and camelCase in TypeScript. Pass the config when you create Memory:
Python
from mem0 import Memory
config = {
"vector_store": {
"provider": "qdrant",
"config": {"host": "localhost", "port": 6333},
},
"llm": {
"provider": "openai",
"config": {"model": "gpt-5-mini", "temperature": 0.1},
},
"embedder": {
"provider": "openai",
"config": {"model": "text-embedding-3-small"},
},
"reranker": {
"provider": "cohere",
"config": {"model": "rerank-v3.5"},
},
}
memory = Memory.from_config(config)
Node.js
import { Memory } from "mem0ai/oss";
const memory = new Memory({
llm: {
provider: "openai",
config: { apiKey: process.env.OPENAI_API_KEY || "", model: "gpt-5-mini", temperature: 0.1 },
},
embedder: {
provider: "openai",
config: { apiKey: process.env.OPENAI_API_KEY || "", model: "text-embedding-3-small" },
},
vectorStore: {
provider: "qdrant",
config: { host: "localhost", port: 6333, collectionName: "memories" },
},
});
Set your provider keys as environment variables:
export OPENAI_API_KEY="..."
export COHERE_API_KEY="..." # Python reranker only
The TypeScript OSS SDK configures the LLM, embedder, vector store, and history store. Reranker and graph memory are Python-only today.
Prefer a config file? Load YAML into Python’s from_config:
import yaml
from mem0 import Memory
with open("config.yaml") as f:
config = yaml.safe_load(f)
memory = Memory.from_config(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 the provider 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 |
See the full catalog in Components.
Tune component settings
Vector store collections
Name collections explicitly in production (collection_name / collectionName) to isolate tenants and enable per-tenant retention policies.
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)
Limit top_k to 10 to 20 results. Sending more adds latency without meaningful gains.
Mixing managed and self-hosted components? Make sure every outbound provider call has a secure network path. Managed rerankers and embedders often require outbound internet even if your vector store is on-prem.
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".