Skip to content

Skip to main content

Mem0 home pagelight logodark logo

Search...

Ctrl KAsk AI

Search...

Navigation

Configuration

Configure the OSS Stack

Welcome Mem0 Platform Open Source Cookbooks Integrations API Reference Release Notes

Getting Started
Self-Hosting Features
Configuration
Community & Support

On this page

Configure Mem0 OSS Components

Prerequisites

  • Python 3.10+ with pip available
  • Running vector database (e.g., Qdrant, Postgres + pgvector) or access credentials for a managed store
  • API keys for your chosen LLM, embedder, and reranker providers

Start from the Python quickstart if you still need the base CLI and repository.

Install dependencies

  • Python

  • Docker Compose

1

Navigate to header

Install Mem0 OSS

pip install mem0ai

2

Navigate to header

Add provider SDKs (example: Qdrant + OpenAI)

pip install qdrant-client openai

1

Navigate to header

Clone the repo and copy the compose file

git clone https://github.com/mem0ai/mem0.git
cd mem0/examples/docker-compose

2

Navigate to header

Install dependencies for local overrides

pip install -r requirements.txt

Define your configuration

  • Python

  • config.yaml

1

Navigate to header

Create a configuration dictionary

from mem0 import Memory

config = {
    "vector_store": {
        "provider": "qdrant",
        "config": {"host": "localhost", "port": 6333},
    },
    "llm": {
        "provider": "openai",
        "config": {"model": "gpt-4.1-mini", "temperature": 0.1},
    },
    "embedder": {
        "provider": "vertexai",
        "config": {"model": "textembedding-gecko@003"},
    },
    "reranker": {
        "provider": "cohere",
        "config": {"model": "rerank-english-v3.0"},
    },
}

memory = Memory.from_config(config)

2

Navigate to header

Store secrets as environment variables

export QDRANT_API_KEY="..."
export OPENAI_API_KEY="..."
export COHERE_API_KEY="..."

1

Navigate to header

Create a `config.yaml` file

vector_store:
  provider: qdrant
  config:
    host: localhost
    port: 6333

llm:
  provider: azure_openai
  config:
    api_key: ${AZURE_OPENAI_KEY}
    deployment_name: gpt-4.1-mini

embedder:
  provider: ollama
  config:
    model: nomic-embed-text

reranker:
  provider: zero_entropy
  config:
    api_key: ${ZERO_ENTROPY_KEY}

2

Navigate to header

Load the config file at runtime

from mem0 import Memory

memory = Memory.from_config_file("config.yaml")

Run memory.add(["Remember my favorite cafe in Tokyo."], user_id="alex") and then memory.search("favorite cafe", user_id="alex"). You should see the Qdrant collection populate and the reranker mark the memory as a top hit.

Tune component settings

Vector store collections

Name collections explicitly in production (collection_name) to isolate tenants and enable per-tenant retention policies.

LLM extraction temperature

Keep extraction temperatures ≤0.2 so advanced memories stay deterministic. Raise it only when you see missing facts.

Reranker depth

Limit top_k to 10–20 results; sending more adds latency without meaningful gains.

Mixing managed and self-hosted components? Make sure every outbound provider call happens through a secure network path. Managed rerankers often require outbound internet even if your vector store is on-prem.

Quick recovery

  • Qdrant connection errors → confirm port 6333 is exposed and API key (if set) matches.
  • Empty search results → verify the embedder model name; a mismatch causes dimension errors.
  • Unknown reranker → update the SDK (pip install --upgrade mem0ai) to load the latest provider registry.

Pick Providers

Deploy with Docker Compose

Was this page helpful?

YesNo

Suggest edits Raise issue

OpenAI Compatibility\ \ Previous Overview\ \ Next

Ctrl+I

Assistant

Responses are generated using AI and may contain mistakes.

Suggestions

How do I configure vector stores?Which LLM providers work?How do I set up Mem0 OSS?

Contact support

SOP Documentation Site for Mem0