Why Use This Integration
- Multi-scope memory: Separate datasets for company-wide knowledge, per-user preferences, and per-agent context, routed automatically by file path
- Auto-recall: Relevant memories are injected as labeled
<cognee_memories>context before every prompt - Auto-index: Memory files sync to Cognee (add new, update changed, forget removed, skip unchanged)
- Session tracking: Each turn is captured in Cognee’s session cache and bridged into the graph on session end
- 14 search types: From semantic vector search to chain-of-thought graph reasoning
- One-command setup:
openclaw cognee setupconfigures Cognee as the memory provider
Installation
Once published, pin to an exact version (supply-chain best practice):Quick Start
1. Start Cognee
Run a local Cognee server with this minimal Docker Compose file:2. Run setup
3. Configure the connection
Add the Cognee connection to~/.openclaw/openclaw.json:
apiKey, the plugin auto-logs in with the default local credentials (default_user@example.com / default_password).
Cognee Cloud
To use Cognee Cloud instead of a local instance, setmode to "cloud":
Cloud mode supports
remember (new files), recall, and per-item forget. Updating an existing file in place is not supported in cloud mode (PATCH /update is self-hosted only) — delete and re-add the file instead.Multi-Scope Memory
For production use, enable multi-scope mode by setting any scope-specific dataset name. Memory files are routed to the right dataset by path.
Default routing:
memory/company/** → company, memory/user/** → user, memory/** and MEMORY.md → agent (catch-all). Override it with a scopeRouting list of { pattern, scope } rules.
During recall, each scope is searched independently and injected with labels:
How It Works
- On startup: Health check, then scan
memory/and call/remember(one batched upload per scope). Cognee runs add + cognify + improve server-side. - Before each prompt: Call
/recallfor each configured scope in parallel, merge results with scope labels, and inject them as context. The session id is passed through so Cognee captures the turn as a session QA. - After each agent run: Re-scan memory files — new files batch into
/remember, changed files go throughPATCH /update(self-hosted), removed files are dropped via/forget. - On session end: Final sync sweep; with
improveOnSessionEndon, dispatches/improvefor the ended session to bridge session QAs into the permanent graph.
~/.openclaw/memory/cognee/ (datasets.json, scoped-sync-indexes.json, legacy sync-index.json). Files are stored using sanitized relative paths (e.g. MEMORY.md.txt, memory.tools.md.txt).
Configuration Reference
Connection
Search
Automation
Timeouts
Deprecated options (silently ignored if set):
maxTokens — use maxResults; autoCognify and autoMemify — now run server-side via /remember; deleteMode — /forget is always a soft delete.Search Types
The plugin supports all of Cognee’s search types, includingGRAPH_COMPLETION (default), GRAPH_COMPLETION_COT, GRAPH_COMPLETION_CONTEXT_EXTENSION, GRAPH_SUMMARY_COMPLETION, RAG_COMPLETION, TRIPLET_COMPLETION, CHUNKS, CHUNKS_LEXICAL, SUMMARIES, TEMPORAL, NATURAL_LANGUAGE, CYPHER, CODING_RULES, and FEELING_LUCKY (auto-selects per query). See Search Types for details.
CLI Commands
Troubleshooting
File sync not running after each agent turn
File sync not running after each agent turn
OpenClaw ≥ 2026.4.27 requires
hooks.allowConversationAccess: true under the plugin entry for the agent_end hook to register. Add it to ~/.openclaw/openclaw.json, then restart the gateway:Verifying the plugin can reach Cognee
Verifying the plugin can reach Cognee
Check connectivity and sync state:Healthy status shows the dataset ID, indexed file count, and a recent last-sync timestamp. On the Cognee side, confirm the server logs show
Backend server has started (Docker: docker compose logs cognee) before starting OpenClaw.Manual fallback
Manual fallback
Trigger the same sync If this fails, verify
autoIndex runs at any time:baseUrl points to a reachable Cognee server and that your apiKey (or default credentials) are valid.GitHub Repository
View source code and examples
Blog Post
Deep dive into building this plugin
OpenClaw Docs
Learn about OpenClaw’s memory system