OpenClaw Cortex Memory
by @deki18
Independent skill for Cortex Memory operations in OpenClaw. Use when users ask for cross-session memory continuity, prior decisions, preferences, relationshi...
clawhub install openclaw-cortex-memory📖 About This Skill
name: cortex-memory description: OpenClaw 长期记忆系统(TypeScript)。用于跨会话上下文复用、偏好记忆、历史追溯与图谱关系检索。 homepage: https://github.com/deki18/openclaw-cortex-memory metadata: { "openclaw": { "emoji": "🧠", "os": ["darwin", "linux", "win32"], "requires": { "env": ["EMBEDDING_API_KEY", "LLM_API_KEY", "RERANKER_API_KEY"] }, "primaryEnv": "EMBEDDING_API_KEY" } }
Cortex Memory
使用场景
推荐使用:
不建议使用:
可用工具(与代码一致)
search_memorystore_eventquery_graphexport_graph_viewlint_memory_wikilist_graph_conflictsresolve_graph_conflictget_hot_contextget_auto_contextreflect_memorysync_memorybackfill_embeddingsdelete_memorycortex_diagnostics参数速览
| 工具 | 关键参数 |
|------|------|
| search_memory | query, top_k |
| store_event | summary, entities, entity_types, outcome, relations |
| query_graph | entity, rel, dir, path_to, max_depth |
| export_graph_view | write_snapshot |
| lint_memory_wiki | 无 |
| list_graph_conflicts | status, limit |
| resolve_graph_conflict | conflict_id, action, note |
| get_hot_context | limit |
| get_auto_context | include_hot |
| reflect_memory | 无 |
| sync_memory | 无 |
| backfill_embeddings | layer, batch_size, max_retries, retry_failed_only, rebuild_mode |
| cortex_diagnostics | 无 |
| delete_memory | memory_id |
使用建议
1. 回答历史问题前先调 search_memory。
2. 涉及实体关系优先调 query_graph。
3. 如命中冲突事实(conflict_hint),先调 list_graph_conflicts,再让用户确认后执行 resolve_graph_conflict。
4. 需要图谱状态快照或排查投影不一致时,调 export_graph_view 与 lint_memory_wiki。
5. 会话收尾或批量导入后再调 sync_memory / reflect_memory。
6. 诊断发现向量缺失时调 backfill_embeddings。
配置策略
先用最小配置跑通:embedding、llm、reranker + autoSync。
高级项(readFusion、memoryDecay、vectorChunking、writePolicy、readTuning)都有默认值,不需要一开始就调整。
安全与端点声明
/embeddings、/chat/completions、/rerank*.apiKey关键事实
backfill_embeddings 已实现且已注册。query_graph 支持参数:entity、rel、dir、path_to、max_depth。query_graph 会返回 wiki_refs、evidence_ids,冲突时返回 conflict_hint。export_graph_view、lint_memory_wiki、list_graph_conflicts、resolve_graph_conflict。