---
schema: "https://insidethemachine.ai/schema/listing.schema.json"
slug: "mem0"
name: "Mem0"
category: "Memory"
stack_layer: "memory"
homepage: "https://mem0.ai/"
repo: "https://github.com/mem0ai/mem0"
docs: "https://docs.mem0.ai/cookbooks/companions/local-companion-ollama"
license: "Apache-2.0"
platforms: ["macos-apple-silicon", "linux", "windows"]
mac_studio_fit: "Primary"
stars: 67233
stars_as_of: "2026-10-15"
last_push: "2026-10-14"
gap_score: null
gap_score_status: "pending test on Mac Studio"
benchmarks_status: "pending test on Mac Studio"
verified_on: "2026-10-15"
sponsored: false
---

# Mem0

> A memory layer for agents that can run fully local with Ollama and Qdrant.

**What:** Long-term memory for your agent. **Why:** Your assistant remembers you between sessions.

**Stack layer:** memory (model → runtime → harness → memory → tools)

An open-source memory layer (Python mem0ai / npm mem0ai) that extracts, stores and retrieves memories for agents. There's a hosted platform plus OSS; this listing covers OSS, local only.

**Gap role:** Persistent, personalized memory across sessions, one of the biggest felt gaps between local agents and frontier assistants.

## Gap Score

null (pending test on Mac Studio)

## Prerequisites

- Python 3 + pip
- Ollama with an LLM and an embedding model
- Docker for Qdrant (vector store)

## Install

### macOS (Apple Silicon)

1. Run:

```bash
pip install mem0ai
```

2. models used in Mem0's local Ollama cookbook:

```bash
ollama pull llama3.1:latest && ollama pull nomic-embed-text:latest
```

3. local Qdrant vector store:

```bash
docker run -d -p 6333:6333 --name qdrant qdrant/qdrant
```

## Configure

1. config adapted verbatim from Mem0's 'Self-Hosted AI Companion' cookbook:

```bash
cat > mem0_local.py <<'EOF'
from mem0 import Memory
config = {
  "vector_store": {"provider": "qdrant", "config": {"collection_name": "test", "host": "localhost", "port": 6333, "embedding_model_dims": 768}},
  "llm": {"provider": "ollama", "config": {"model": "llama3.1:latest", "temperature": 0, "max_tokens": 2000, "ollama_base_url": "http://localhost:11434"}},
  "embedder": {"provider": "ollama", "config": {"model": "nomic-embed-text:latest", "ollama_base_url": "http://localhost:11434"}},
}
m = Memory.from_config(config)
m.add("I'm visiting Paris", user_id="john")
print(m.get_all(filters={"user_id": "john"}))
EOF
```

## Verify

1. Expect: prints a results list containing a memory about visiting Paris

```bash
python mem0_local.py
```

## Rollback

1. Run:

```bash
pip uninstall -y mem0ai
```

2. deletes stored vectors unless you mounted a volume:

```bash
docker rm -f qdrant
```

3. Run:

```bash
rm mem0_local.py
```

## One-command install

Status: docs-checked (Not run: commands checked against the official docs only). The wrapper scripts are generated from the site data. Every .sh passed bash -n and shellcheck and ran in plan mode on Linux (Debian 13). Every .ps1 passed the PowerShell parser and chat.ps1 ran in plan, verify and rollback mode under PowerShell 7 on Linux with Windows calls mocked. Not run on macOS or real Windows.

```bash
curl -fsSL https://insidethemachine.ai/install/mem0.sh | bash            # install, then check
curl -fsSL https://insidethemachine.ai/install/mem0.sh | bash -s -- plan    # print only
curl -fsSL https://insidethemachine.ai/install/mem0.sh | bash -s -- rollback --yes
```

Details and Windows: https://insidethemachine.ai/install/mem0.md

## Caveats

- embedding_model_dims must match your embedding model (768 for nomic-embed-text per the cookbook).

## Benchmarks

Status: pending test on Mac Studio. Rig: Mac Studio, Apple Silicon, 128GB unified memory. No results published yet.

## Works with

- ollama (https://insidethemachine.ai/setups/ollama.md)
- litellm (https://insidethemachine.ai/setups/litellm.md)

## Sources

- https://github.com/mem0ai/mem0
- https://docs.mem0.ai/cookbooks/companions/local-companion-ollama
