Give your OpenClaw assistant persistent, graph-structured memory using Mem0 and FalkorDB. The agent remembers user preferences, facts, and relationships across sessions — automatically.
┌─────────────┐ ┌──────────────────┐ ┌─────────────┐
│ OpenClaw │────▶│@falkordb/openclaw│────▶│ FalkorDB │
│ (Agent) │ │ -mem0 (Plugin) │ │ (Graphs) │
└─────────────┘ └────────┬─────────┘ └─────────────┘
│
┌──────▼──────┐
│ OpenAI │
│ (Embeddings │
│ + LLM) │
└─────────────┘
How the pieces fit together:
| Component | Role |
|---|---|
| OpenClaw | Personal AI assistant — the agent runtime and chat interface |
| @falkordb/openclaw-mem0 | OpenClaw plugin — auto-recall/capture + 5 memory tools, with FalkorDB graph support |
| Mem0 Node.js SDK | Memory management — extracts, stores, and retrieves facts |
| @falkordb/mem0 | TypeScript library — FalkorDB as a graph store for Mem0 (bundled in the plugin) |
| FalkorDB | Graph database — stores entity relationships per user |
| OpenAI | Embeddings for semantic search + LLM for entity extraction |
Memory flow:
- You chat with your OpenClaw agent on any channel (WhatsApp, Telegram, Slack, CLI, etc.)
- Auto-Capture: After each response, the mem0 plugin extracts entities and relationships
- Auto-Recall: Before each response, vector search + graph traversal inject relevant memories
- FalkorDB stores entity relationships as isolated per-user graphs (
mem0_alice,mem0_bob)
- Node.js ≥ 22 (for OpenClaw)
- Docker (for FalkorDB)
- Redis CLI (
redis-cli— for verifying and inspecting FalkorDB) - uv (for Python verification scripts)
- OpenAI API key
docker compose up -dVerify it's running:
redis-cli -h localhost -p 6379 ping
# → PONGcp .env.example .env
# Edit .env and add your OPENAI_API_KEY# Install OpenClaw globally
npm install -g openclaw@latest
# Install the FalkorDB-enabled Mem0 memory plugin
openclaw plugins install @falkordb/openclaw-mem0
# Copy the provided config (OSS mode — fully self-hosted, no Mem0 Cloud needed)
mkdir -p ~/.openclaw && cp openclaw.json ~/.openclaw/openclaw.jsonopenclaw onboard --install-daemon
# Or run directly:
openclaw gateway --port 18789 --verbose# Send a message — the agent will auto-capture facts
openclaw agent --local --session-id demo --message "I'm a software engineer who loves Rust and hiking"
# Later, the agent auto-recalls relevant memories
openclaw agent --local --session-id demo --message "Recommend me a weekend project"
# → Agent remembers you like Rust and hiking!
# Use the CLI to search memories directly
openclaw mem0 search "what languages does the user know"
# View memory stats
openclaw mem0 statsAlready have OpenClaw running? Follow these steps to add persistent graph memory powered by Mem0 and FalkorDB.
Choose one of the following:
docker run -d --name falkordb -p 6379:6379 -p 3000:3000 falkordb/falkordb:latestVerify it's running:
redis-cli -h localhost -p 6379 ping
# → PONG- Sign up at app.falkordb.cloud
- Create an instance and note the host, port, username, and password
openclaw plugins install @falkordb/openclaw-mem0Verify it's installed:
openclaw plugins list
# → Should show @falkordb/openclaw-mem0Open your existing config file (~/.openclaw/openclaw.json) and add the mem0 plugin configuration.
Add the following to your config — merge it with any existing settings you already have:
The mem0 plugin needs an OpenAI key for embeddings and entity extraction. Set it as an environment variable:
export OPENAI_API_KEY="sk-your-key-here"To make it permanent, add it to your shell profile (~/.bashrc, ~/.zshrc, etc.) or use a .env file in your OpenClaw workspace.
# Stop the running gateway, then restart it
openclaw gateway --port 18789 --verboseOr if you installed it as a daemon:
openclaw onboard --install-daemonSend a few messages so the agent captures some facts:
openclaw agent --local --session-id demo --message "I'm a software engineer who loves Rust and hiking"
openclaw agent --local --session-id demo --message "Recommend me a weekend project"
# → Agent should recall your preferences!FalkorDB includes a built-in browser UI for visualizing your graphs.
- Open http://localhost:3000 in your browser (for local Docker), or use the browser at app.falkordb.cloud for cloud instances
- Select the graph named
mem0_alice(ormem0_<your-userId>) - Run a query to see stored entities and relationships:
MATCH (a)-[r]->(b) RETURN a, r, bYou should see nodes representing extracted entities (people, technologies, hobbies, etc.) and edges showing their relationships — confirming that Mem0 is capturing and storing memories in FalkorDB.
Tip: You can also verify via the CLI:
redis-cli -h localhost -p 6379 GRAPH.LIST GRAPH.QUERY mem0_alice "MATCH (n) RETURN n.name LIMIT 10"
This repo includes two ready-to-use configs:
Fully local — no Mem0 Cloud account needed. Uses OpenAI for embeddings/LLM and FalkorDB for graph storage via @falkordb/openclaw-mem0.
Key config points:
gateway.mode: "local"— required for local-only operationplugins.slots.memory: "openclaw-mem0"— tells OpenClaw to use the mem0 plugin instead of the defaultmemory-coreoss.graphStore— configures FalkorDB as the graph backend
{
"gateway": { "mode": "local" },
"plugins": {
"slots": { "memory": "openclaw-mem0" },
"entries": {
"openclaw-mem0": {
"enabled": true,
"config": {
"mode": "open-source",
"userId": "alice",
"autoRecall": true,
"autoCapture": true,
"enableGraph": true,
"topK": 5,
"searchThreshold": 0.3,
"oss": {
"embedder": { "provider": "openai", "config": { "model": "text-embedding-3-small" } },
"vectorStore": { "provider": "memory", "config": { "dimension": 1536 } },
"graphStore": {
"provider": "falkordb",
"config": { "host": "localhost", "port": 6379, "graphName": "mem0" }
},
"llm": { "provider": "openai", "config": { "model": "gpt-4o-mini" } }
}
}
}
}
}
}Uses Mem0's managed cloud with enableGraph: true for built-in graph entity relationships.
{
"plugins": {
"entries": {
"openclaw-mem0": {
"enabled": true,
"config": {
"mode": "platform",
"apiKey": "${MEM0_API_KEY}",
"userId": "alice",
"enableGraph": true // entity graph for relationships
}
}
}
}
}To use Platform Mode: set MEM0_API_KEY in .env and copy openclaw.platform-mode.json to ~/.openclaw/openclaw.json:
mkdir -p ~/.openclaw && cp openclaw.platform-mode.json ~/.openclaw/openclaw.jsonThe mem0 plugin gives your OpenClaw agent five tools it can use during conversations:
| Tool | Description |
|---|---|
memory_search |
Search memories by natural language |
memory_store |
Explicitly save a fact (long-term or session) |
memory_list |
List all stored memories for a user |
memory_get |
Retrieve a specific memory by ID |
memory_forget |
Delete a memory by ID or query |
| Scope | Behavior |
|---|---|
| Session (short-term) | Auto-captured during the current conversation |
| User (long-term) | Persists across all sessions for the user |
Auto-recall searches both scopes and presents long-term memories first.
The Python scripts let you test the Mem0 + FalkorDB backend directly — useful for verifying the graph store is working before connecting OpenClaw.
# Install Python dependencies
uv sync
# Quick test — add memories and search
uv run python demo_basic.py
# Full demo — multi-user isolation, updates, cleanup
uv run python demo.pyRegisters mem0-falkordb, adds memories, and searches — ~30 lines.
| Scenario | What it demonstrates |
|---|---|
| Add & Search | Store facts, search with natural language queries |
| Multi-User Isolation | Each user gets their own FalkorDB graph — no data leaks |
| Memory Updates | Mem0 handles conflicting info automatically |
| List Memories | Inspect all stored memories for a user |
| Cleanup | Drop a user's entire graph with one call |
Connect to FalkorDB and query the graph directly:
redis-cli -h localhost -p 6379
# List all graphs
GRAPH.LIST
# Query alice's memory graph
GRAPH.QUERY mem0_alice "MATCH (n) RETURN n LIMIT 10"
# See entity relationships
GRAPH.QUERY mem0_alice "MATCH (a)-[r]->(b) RETURN a.name, type(r), b.name"| Key | Type | Default | Description |
|---|---|---|---|
mode |
"platform" | "open-source" |
"platform" |
Backend mode |
userId |
string |
"default" |
Scope memories per user |
autoRecall |
boolean |
true |
Inject memories before each turn |
autoCapture |
boolean |
true |
Store facts after each turn |
topK |
number |
5 |
Max memories per recall |
searchThreshold |
number |
0.3 |
Min similarity (0–1) |
enableGraph |
boolean |
false |
Enable entity graph (supported in both OSS and platform modes) |
oss.graphStore.provider |
string |
— | Graph store provider (e.g., "falkordb") |
oss.graphStore.config |
object |
— | host, port, graphName, username, password |
config = {
"graph_store": {
"provider": "falkordb",
"config": {
"host": "localhost", # FalkorDB host
"port": 6379, # FalkorDB port
"database": "mem0", # Graph name prefix
},
},
"llm": {
"provider": "openai",
"config": {"model": "gpt-4o-mini"},
},
}Each user gets their own isolated graph: {database}_{user_id} (e.g., mem0_alice).
Replace localhost:6379 with your cloud instance:
"config": {
"host": "your-instance.falkordb.cloud",
"port": 6379,
"username": "default",
"password": "your-password",
"database": "mem0",
}Sign up at app.falkordb.cloud.
| Problem | Solution |
|---|---|
ConnectionError to FalkorDB |
Ensure docker compose up -d is running and port 6379 is free |
OPENAI_API_KEY error |
Copy .env.example to .env and add your key |
| OpenClaw plugin not loading | Run openclaw plugins list to verify, then openclaw doctor |
| Empty search results | Verify memories were added with openclaw mem0 stats or m.get_all() |
| Python import errors | Run with uv run or activate the venv: source .venv/bin/activate |
register() not called (Python) |
Must call register() before Memory.from_config() |
- OpenClaw — Personal AI assistant framework
- OpenClaw Mem0 Plugin Docs
- @falkordb/openclaw-mem0 (npm) — FalkorDB-enabled Mem0 plugin for OpenClaw
- @falkordb/mem0 (TypeScript) — FalkorDB graph store for Mem0 Node.js
- mem0-falkordb (Python) — FalkorDB graph store for Mem0 Python
- Mem0 Node.js Graph Memory Docs
- FalkorDB Mem0 Integration
- FalkorDB Cloud
MIT
{ // ... your existing config ... "plugins": { "slots": { "memory": "openclaw-mem0" // ← replace default memory-core with mem0 }, "entries": { "openclaw-mem0": { "enabled": true, "config": { "mode": "open-source", "userId": "alice", // ← change to your user identifier "autoRecall": true, "autoCapture": true, "enableGraph": true, "topK": 5, "searchThreshold": 0.3, "oss": { "embedder": { "provider": "openai", "config": { "model": "text-embedding-3-small" } }, "vectorStore": { "provider": "memory", "config": { "dimension": 1536 } }, "graphStore": { "provider": "falkordb", "config": { // Local Docker: "host": "localhost", "port": 6379, "graphName": "mem0" // FalkorDB Cloud — replace the above with: // "host": "your-instance.falkordb.cloud", // "port": 6379, // "username": "default", // "password": "your-password", // "graphName": "mem0" } }, "llm": { "provider": "openai", "config": { "model": "gpt-4o-mini" } } } } } } } }