@cognee/cognee-openclaw
v2026.3.0
Published
OpenClaw Cognee-backed memory plugin with auto-recall/capture
Keywords
Readme
@cognee/cognee-openclaw
OpenClaw plugin that adds Cognee-backed memory with automatic recall and indexing.
Features
- Auto-recall: Before each agent run, searches Cognee for relevant memories and injects them as context
- Auto-index: On startup and after each agent run, syncs memory markdown files to Cognee (add new, update changed, delete removed, skip unchanged)
- CLI commands:
openclaw cognee indexto manually sync,openclaw cognee statusto check state - Configurable: Search type, max results, score filtering, token limits, and more
Installation
Install the plugin locally for development:
cd integrations/openclaw
npm install
npm run build
openclaw plugins install -l .Or once published:
openclaw plugins install @cognee/cognee-openclawConfiguration
Enable the plugin in your OpenClaw config (~/.openclaw/config.yaml or project config):
plugins:
entries:
cognee-openclaw:
enabled: true
config:
baseUrl: "http://localhost:8000"
apiKey: "${COGNEE_API_KEY}"
datasetName: "my-project"
searchType: "GRAPH_COMPLETION"
deleteMode: "hard"
maxResults: 6
autoRecall: true
autoIndex: trueSet your API key in the environment:
export COGNEE_API_KEY="your-key-here"Configuration Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| baseUrl | string | http://localhost:8000 | Cognee API base URL |
| apiKey | string | $COGNEE_API_KEY | API key for authentication |
| datasetName | string | openclaw | Dataset name for storing memories |
| searchType | string | GRAPH_COMPLETION | Search mode: GRAPH_COMPLETION, CHUNKS, SUMMARIES |
| maxResults | number | 6 | Max memories to inject per recall |
| minScore | number | 0 | Minimum relevance score filter |
| maxTokens | number | 512 | Token cap for recall context |
| autoRecall | boolean | true | Inject memories before agent runs |
| autoIndex | boolean | true | Sync memory files on startup and after agent runs |
| autoCognify | boolean | true | Run cognify after new memories are added |
| deleteMode | string | soft | Delete mode: soft removes raw data only, hard also removes degree-one graph nodes |
| searchPrompt | string | "" | System prompt sent to Cognee to guide search query processing |
| requestTimeoutMs | number | 60000 | HTTP timeout for Cognee requests |
| ingestionTimeoutMs | number | 300000 | HTTP timeout for add/update (ingestion) requests, which are typically slower |
How It Works
- On startup: Scans
memory/directory for markdown files and syncs to Cognee (add new, update changed, delete removed, skip unchanged) - Before agent start: Searches Cognee for memories relevant to the prompt and prepends as
<cognee_memories>context - After agent end: Re-scans memory files and syncs any changes the agent made (including deletions)
- State tracking:
~/.openclaw/memory/cognee/datasets.json— dataset ID mapping~/.openclaw/memory/cognee/sync-index.json— per-file hash and Cognee data IDs
Memory files detected at: MEMORY.md and memory/**/*.md (recursive)
CLI Commands
# Manually sync memory files to Cognee
openclaw cognee index
# Check sync status (indexed files, pending changes)
openclaw cognee statusDevelopment
cd integrations/openclaw
# Build once, then link for local development with an OpenClaw project
npm install
npm run build
openclaw plugins install -l .For live rebuilds during development:
npm run devTesting
Run the test suite to verify functionality:
npm test