1- # cognee-integration- openclaw
1+ # @ openclaw/memory-cognee
22
3- OpenClaw plugin that adds Cognee-backed memory with automatic recall and capture .
3+ OpenClaw plugin that adds Cognee-backed memory with automatic recall and indexing .
44
55## Features
66
77- ** Auto-recall** : Before each agent run, searches Cognee for relevant memories and injects them as context
8- - ** Auto-capture** : After each agent run, stores conversation transcripts in Cognee for future recall
8+ - ** Auto-index** : On startup and after each agent run, syncs memory markdown files to Cognee (add new, update changed, skip unchanged)
9+ - ** CLI commands** : ` openclaw cognee index ` to manually sync, ` openclaw cognee status ` to check state
910- ** Configurable** : Search type, max results, score filtering, token limits, and more
1011
1112## Installation
@@ -41,7 +42,7 @@ plugins:
4142 searchType : " GRAPH_COMPLETION"
4243 maxResults : 6
4344 autoRecall : true
44- autoCapture : true
45+ autoIndex : true
4546` ` `
4647
4748Set your API key in the environment:
@@ -62,16 +63,30 @@ export COGNEE_API_KEY="your-key-here"
6263| ` minScore ` | number | ` 0 ` | Minimum relevance score filter |
6364| ` maxTokens ` | number | ` 512 ` | Token cap for recall context |
6465| ` autoRecall ` | boolean | ` true ` | Inject memories before agent runs |
65- | ` autoCapture ` | boolean | ` true ` | Store transcripts after agent runs |
66+ | ` autoIndex ` | boolean | ` true ` | Sync memory files on startup and after agent runs |
6667| ` autoCognify ` | boolean | ` true ` | Run cognify after new memories are added |
67- | ` updateExisting ` | boolean | ` true ` | Update existing memory entries when possible |
6868| ` requestTimeoutMs ` | number | ` 60000 ` | HTTP timeout for Cognee requests |
6969
7070## How It Works
7171
72- 1 . ** Before agent start** : Plugin searches Cognee for memories relevant to the user's prompt and prepends them as a ` <cognee_memories> ` context block
73- 2 . ** After agent end** : Plugin extracts the conversation transcript and stores it in Cognee, building up the memory over time
74- 3 . ** Dataset state** : Tracks dataset IDs locally at ` ~/.openclaw/memory/cognee/datasets.json `
72+ 1 . ** On startup** : Scans ` memory/ ` directory for markdown files and syncs to Cognee (add new, update changed, skip unchanged)
73+ 2 . ** Before agent start** : Searches Cognee for memories relevant to the prompt and prepends as ` <cognee_memories> ` context
74+ 3 . ** After agent end** : Re-scans memory files and syncs any changes the agent made
75+ 4 . ** State tracking** :
76+ - ` ~/.openclaw/memory/cognee/datasets.json ` — dataset ID mapping
77+ - ` ~/.openclaw/memory/cognee/sync-index.json ` — per-file hash and Cognee data IDs
78+
79+ Memory files detected at: ` MEMORY.md ` , ` memory.md ` , or ` memory/*.md `
80+
81+ ## CLI Commands
82+
83+ ``` bash
84+ # Manually sync memory files to Cognee
85+ openclaw cognee index
86+
87+ # Check sync status (indexed files, pending changes)
88+ openclaw cognee status
89+ ```
7590
7691## Development
7792
0 commit comments