{"slug":"mem0","name":"Mem0","kind":"runbook","what":"A memory layer for agents that can run fully local with Ollama and Qdrant.","page":"https://insidethemachine.ai/setups/mem0","status":"docs-checked","status_label":"Not run: commands checked against the official docs only","status_note":"Commands checked against the official docs on 2026-10-15. Not run end to end.","wrapper":"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.","wrapper_tested":null,"sh":"https://insidethemachine.ai/install/mem0.sh","ps1":null,"md":"https://insidethemachine.ai/install/mem0.md","json":"https://insidethemachine.ai/install/mem0.json","one_liner":"curl -fsSL https://insidethemachine.ai/install/mem0.sh | bash","one_liner_windows":null,"actions":{"install":"curl -fsSL https://insidethemachine.ai/install/mem0.sh | bash","plan":"curl -fsSL https://insidethemachine.ai/install/mem0.sh | bash -s -- plan","verify":"curl -fsSL https://insidethemachine.ai/install/mem0.sh | bash -s -- verify","rollback":"curl -fsSL https://insidethemachine.ai/install/mem0.sh | bash -s -- rollback --yes"},"env":{"ITM_RAM":"memory in GB instead of detecting it"},"model_by_memory_gb":null,"low_memory":null,"platforms":{"macos":{"install":[{"title":"Install Mem0","lines":[{"k":"run","c":"python3 -m venv ~/.venvs/mem0 && source ~/.venvs/mem0/bin/activate"},{"k":"run","c":"pip install mem0ai"},{"k":"ollama","c":"ollama pull llama3.1:latest && ollama pull nomic-embed-text:latest"},{"k":"you","c":"docker run -d -p 6333:6333 --name qdrant qdrant/qdrant","why":"needs Docker; starts a container"}]},{"title":"Configure (your choices)","lines":[{"k":"you","c":"cat > mem0_local.py <<'EOF'\nfrom mem0 import Memory\nconfig = {\n  \"vector_store\": {\"provider\": \"qdrant\", \"config\": {\"collection_name\": \"test\", \"host\": \"localhost\", \"port\": 6333, \"embedding_model_dims\": 768}},\n  \"llm\": {\"provider\": \"ollama\", \"config\": {\"model\": \"llama3.1:latest\", \"temperature\": 0, \"max_tokens\": 2000, \"ollama_base_url\": \"http://localhost:11434\"}},\n  \"embedder\": {\"provider\": \"ollama\", \"config\": {\"model\": \"nomic-embed-text:latest\", \"ollama_base_url\": \"http://localhost:11434\"}},\n}\nm = Memory.from_config(config)\nm.add(\"I'm visiting Paris\", user_id=\"john\")\nprint(m.get_all(filters={\"user_id\": \"john\"}))\nEOF","why":"config adapted verbatim from Mem0's 'Self-Hosted AI Companion' cookbook"}]}],"verify":[{"run":"python mem0_local.py","expect":"prints a results list containing a memory about visiting Paris","you":true}],"rollback":[{"k":"run","c":"pip uninstall -y mem0ai"},{"k":"run","c":"docker rm -f qdrant"},{"k":"run","c":"rm mem0_local.py"}]},"linux":{"install":[{"title":"Linux: same steps as macOS","lines":[{"k":"note","c":"Our data lists Linux as supported but has no separate Linux steps, so these are the macOS steps. brew lines are skipped; install those tools with your package manager."}]},{"title":"Install Mem0","lines":[{"k":"run","c":"python3 -m venv ~/.venvs/mem0 && source ~/.venvs/mem0/bin/activate"},{"k":"run","c":"pip install mem0ai"},{"k":"ollama","c":"ollama pull llama3.1:latest && ollama pull nomic-embed-text:latest"},{"k":"you","c":"docker run -d -p 6333:6333 --name qdrant qdrant/qdrant","why":"needs Docker; starts a container"}]},{"title":"Configure (your choices)","lines":[{"k":"you","c":"cat > mem0_local.py <<'EOF'\nfrom mem0 import Memory\nconfig = {\n  \"vector_store\": {\"provider\": \"qdrant\", \"config\": {\"collection_name\": \"test\", \"host\": \"localhost\", \"port\": 6333, \"embedding_model_dims\": 768}},\n  \"llm\": {\"provider\": \"ollama\", \"config\": {\"model\": \"llama3.1:latest\", \"temperature\": 0, \"max_tokens\": 2000, \"ollama_base_url\": \"http://localhost:11434\"}},\n  \"embedder\": {\"provider\": \"ollama\", \"config\": {\"model\": \"nomic-embed-text:latest\", \"ollama_base_url\": \"http://localhost:11434\"}},\n}\nm = Memory.from_config(config)\nm.add(\"I'm visiting Paris\", user_id=\"john\")\nprint(m.get_all(filters={\"user_id\": \"john\"}))\nEOF","why":"config adapted verbatim from Mem0's 'Self-Hosted AI Companion' cookbook"}]}],"verify":[{"run":"python mem0_local.py","expect":"prints a results list containing a memory about visiting Paris","you":true}],"rollback":[{"k":"run","c":"pip uninstall -y mem0ai"},{"k":"run","c":"docker rm -f qdrant"},{"k":"run","c":"rm mem0_local.py"}]},"windows":null}}