This is a community fork of the official MemOS-Cloud-OpenClaw-Plugin by MemTensor, adapted for self-hosted MemOS instances. The original plugin works with MemOS Cloud — a managed service with authentication, dashboard, and zero setup. This fork modifies API paths and response adapters to work with the self-hosted MemOS API.
| MemOS Cloud (Official Plugin) | Self-Hosted (This Fork) | |
|---|---|---|
| Setup | Sign up and get an API key — done | Deploy MemOS + Qdrant + Neo4j + Ollama yourself |
| Maintenance | Zero — managed by MemTensor | You manage updates, backups, infra |
| Data location | MemOS Cloud servers | Your own machine — 100% local |
| Cost | Cloud plan pricing | Free (your hardware + electricity) |
| Best for | Quick start, production use, teams | Privacy-first, air-gapped environments, tinkerers |
If you just want long-term memory for your agents, start with the official Cloud plugin. It's simpler, maintained by the MemOS team, and works out of the box. This fork exists for users who need to keep all data on their own infrastructure.
A fork of the official OpenClaw plugin, adapted for self-hosted MemOS. It gives your AI agent long-term memory using a local MemOS instance. Conversations are automatically stored and recalled across sessions.
Hybrid Memory Design:
| Component | Strategy | When |
|---|---|---|
| Lifecycle Plugin | Auto-capture full sessions | Every conversation end |
| Agent Skill | Manual remember/recall | Agent explicitly saves important facts |
OpenClaw Agent
├── [before_agent_start] → MemOS /product/search → recall relevant memories
└── [agent_end] → MemOS /product/add → store conversation
↓
MemOS API (:8000)
├── Qdrant (:6333) — vector search
├── Neo4j (:7687) — graph DB
└── Ollama (:11434) — embedding + LLM
- OpenClaw installed
- Docker and Docker Compose
- Neo4j Community running on port 7687
- Ollama running on port 11434 with:
- An embedding model (default:
qwen3-embedding:0.6b) - A chat model (default:
gemma3:4b)
- An embedding model (default:
git clone https://github.com/YOUR_USER/memos-openclaw-local.git
cd memos-openclaw-local
# Copy and edit environment variables
cp .env.example .env
# Edit .env — set your Neo4j password, Ollama host, models, etc.ollama pull qwen3-embedding:0.6b
ollama pull gemma3:4b# Clone MemOS source (required for Docker build)
git clone https://github.com/MemTensor/MemOS.git
# Copy our docker-compose and env into MemOS
cp docker/docker-compose.override.yml MemOS/docker/
cp .env MemOS/
# Apply the Neo4j Community search patch
# See patches/searcher.py.patch for details
# Edit: MemOS/src/memos/memories/textual/tree_text_memory/retrieve/searcher.pyPatch 1 — Add at the top of _retrieve_from_keyword method:
if not hasattr(self.graph_store, 'search_by_fulltext'):
return []Patch 2 — In _retrieve_paths, wrap result collection with try/except:
results = []
for t in tasks:
try:
results.extend(t.result())
except Exception as e:
logger.warning(f"[SEARCH] Search path failed: {e}")cd MemOS/docker
docker compose -f docker-compose.override.yml up -dVerify it's running:
curl http://localhost:8000/health# Copy plugin to a permanent location
cp -r plugin /path/to/memos-local-openclaw-plugin
# Add to your OpenClaw config (~/.openclaw/openclaw.json):{
"plugins": {
"entries": {
"memos-local-openclaw-plugin": {
"enabled": true,
"config": {
"baseUrl": "http://localhost:8000",
"userId": "openclaw-user",
"recallEnabled": true,
"addEnabled": true,
"captureStrategy": "full_session",
"includeAssistant": true,
"memoryLimitNumber": 6,
"tags": ["openclaw", "auto"]
}
}
},
"load": {
"paths": ["/path/to/memos-local-openclaw-plugin"]
}
}
}# Copy skill to OpenClaw skills directory
cp -r skill ~/.openclaw/skills/memos-memoryThe agent can then use remember, recall, and status commands.
| Variable | Default | Description |
|---|---|---|
MOS_CHAT_MODEL |
gemma3:4b |
LLM for memory processing |
MOS_EMBEDDER_MODEL |
qwen3-embedding:0.6b |
Embedding model |
EMBEDDING_DIMENSION |
1024 |
Must match your embedding model's output |
NEO4J_PASSWORD |
— | Your Neo4j password |
OLLAMA_API_BASE |
http://host.docker.internal:11434 |
Ollama endpoint (from inside Docker) |
| Option | Default | Description |
|---|---|---|
baseUrl |
http://localhost:8000 |
MemOS API URL |
userId |
openclaw-user |
MemOS user identifier |
captureStrategy |
last_turn |
last_turn or full_session |
includeAssistant |
true |
Include assistant responses in memory |
memoryLimitNumber |
6 |
Max memories to recall per query |
tags |
["openclaw"] |
Tags for stored memories |
recallEnabled |
true |
Enable memory recall on agent start |
addEnabled |
true |
Enable memory capture on agent end |
cd MemOS/docker
# Start
docker compose -f docker-compose.override.yml up -d
# Stop
docker compose -f docker-compose.override.yml down
# Logs
docker logs memos-api --tail 30
# IMPORTANT: Always use down+up to restart (not 'restart')
# 'docker compose restart' does NOT reload .env changes- MemOS delete API bug:
delete_node_by_prams()has a missing argument. Delete memories directly via Neo4j + Qdrant. - docker compose restart ignores .env: Always use
downthenupto apply config changes. - Embedding dimension mismatch: If you change embedding models, delete the Qdrant collection and restart.
- WatchFiles hot-reload: Can corrupt singleton state. Always do a full
down+upafter editing MemOS source files.
This project is a fork of MemOS-Cloud-OpenClaw-Plugin by MemTensor. All core plugin logic (lifecycle hooks, prompt injection, memory formatting) comes from the original. This fork only modifies the API layer (paths, authentication, response adapters) to work with self-hosted MemOS.
- MemOS — The Memory Operating System
- MemOS Cloud — Managed MemOS service
- MemOS-Cloud-OpenClaw-Plugin — The original official plugin
Apache-2.0 — Same as MemOS and the original OpenClaw plugin.