memory_store
Write lessons, decisions, and playbooks to persistent local memory in one unified call, with automatic routing by knowledge type so callers avoid knowing internal categories.
Instructions
统一知识写入入口 — 根据 kind 自动路由到 add_lesson / add_decision / add_playbook。 Unified knowledge write endpoint — routes to add_lesson / add_decision / add_playbook based on kind.
**Lifecycle: writeback** — 对话中产生值得长期保留的知识时调用。
Lifecycle: writeback — call when the conversation produces knowledge worth persisting.
这是 Provider 兼容的统一写入接口。如果你已经明确知道要写 lesson/decision/playbook,
也可以直接调用对应的专用工具。本工具的优势在于:调用方不需要知道 Engram 内部的分类体系。
This is a provider-compatible unified write interface. You may also call the specialized
tools directly. The advantage here: callers don't need to know Engram's internal taxonomy.
Args:
kind: 知识类型 — 'lesson' | 'decision' | 'playbook'。批量模式下作为各条目的类型(playbook 不支持批量)。 / Knowledge type; in batch mode, the item type for every item (playbook not supported in batch).
content_json: 知识内容 JSON 字符串(单条模式必填)。格式因 kind 而异:
- lesson: {"summary": "...", "detail": "...", "domain": "..."}
- decision: {"question": "...", "choice": "...", "reasoning": "..."}
- playbook: {"title": "...", "triggers": "...", "steps_json": "[...]"}
Content JSON string (required in single mode). Schema varies by kind (see above).
source_tool: 调用来源工具(可选),如 'claude_code', 'cursor'。 / Source tool (optional).
items_json: 条目 JSON 数组;给了就走批量写入(一次导入多条 lesson/decision)。 / JSON array of items; when provided, batch-writes multiple lessons/decisions in one call.
allow_similar_new: 单条 lesson/playbook:内容相似但不相同、确属新条目时设为 true(可选,默认 false);不能绕过完全相同内容的拒绝。 / Single lesson/playbook: set true when similar but not identical content is genuinely new (optional, default false); it cannot bypass the refusal of identical content.
取代提案:内容(或批量中的某一条)带 supersedes=<已有条目 ID> 时,必须同时带 supersedes_expected_version=<该条目当前版本>;缺失 → version_required,不匹配 → version_conflict,整次调用零写入。
Supersede proposals: content (or a batch item) carrying supersedes=<existing id> must also carry supersedes_expected_version=<that entry's current version>; missing -> version_required, mismatch -> version_conflict, and the whole call writes nothing.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"kind": "<kind>"
},
"name": "memory_store"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | ||
| items_json | No | ||
| source_tool | No | ||
| content_json | No | ||
| project_folder | No | ||
| user_confirmed | No | ||
| allow_similar_new | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |