memory_store
Create, update, link, or bulk-create thoughts in a persistent knowledge graph, with confirm-gated previews before destructive edge changes.
Instructions
Store and modify thoughts. Single objects answer { item, meta }, batches { items, meta } with counters in meta.counts; a preview sets meta.preview={token,destructive:true}. Actions: create; update (tags merge by default, tags_mode=replace overwrites); link; link_batch and unlink_batch (up to 1000 edges each, one transaction, one row per occurrence; unlink_batch confirm-gated); unlink and retype (preview→confirm, unlink dry-run by default, retype returns both edge ids); bulk_create (up to 10000 thoughts). A write returns compact thoughts unless you read the row back with memory_recall compact=false.
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": {
"action": "<action>"
},
"name": "memory_store"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory — resolves the project a "create" lands in and the project scope meta.scope reports (always pass for "create"/"update"). ACCEPTED AND IGNORED for "link", "link_batch", "unlink", "unlink_batch", "retype". | |
| tags | No | OPTIONAL for "create" and "update" (update merges with existing tags by default; use tags_mode=replace to overwrite the whole tag set). REJECTED for "link", "link_batch", "unlink", "unlink_batch", "retype". | |
| links | No | REQUIRED ONLY for "link_batch". Edges to create as {source, target, type?} pairs (1-1000); partial failures are reported per item. REJECTED for all other actions. | |
| action | Yes | The specific action to perform. This dictates which other parameters are required. | |
| status | No | Thought status (draft/active/archived). OPTIONAL for "create" and "update"; "update" rejects "archived" (archive through memory_supersede action=archive). REJECTED for "link", "link_batch", "unlink", "unlink_batch", "retype". | |
| confirm | No | CONSUMED by "unlink", "unlink_batch", "retype" (true executes the write; false/omitted is a dry-run). REJECTED for all other actions. | |
| content | No | REQUIRED for "create". OPTIONAL for "update". REJECTED for "link", "link_batch", "unlink", "unlink_batch", "retype". Recommended soft limit: 600 chars. | |
| edge_id | No | REQUIRED for "unlink" and "retype". The edge to modify. REJECTED for all other actions. | |
| edge_ids | No | REQUIRED ONLY for "unlink_batch". Edge IDs to delete/preview in one call (1-1000); partial failures are reported per item. REJECTED for all other actions. | |
| new_type | No | REQUIRED for "retype". The new edge type. REJECTED for all other actions. | |
| thoughts | No | REQUIRED ONLY for "bulk_create". Thoughts to create in one run-level transaction with a savepoint per item, so a failing item does not roll back its neighbours (1-10000 items, the same bound this schema enforces). VALIDATED before the action runs, so a present thoughts must be a non-empty array of valid items whatever the action — an empty array is refused with "thoughts is required for bulk_create action". REJECTED for all other actions. Each item is a strict object taking the create item fields — content (required), tags, status, parent_id, is_protected, is_global, url_links — plus project_id, relation and source; url_links is written per item in array order in the same transaction, and is_global reaches the row. Failure splits two ways: a schema-level refusal (an unknown key, a wrong type, the retired is_profile) drops the whole call and writes nothing, while a per-item failure (e.g. a parent_id that does not exist) yields that item's error row at its index and the rest of the batch commits. The top-level content/tags/status/parent_id/is_protected/is_global/url_links are rejected for "bulk_create" (each item carries its own). | |
| edge_type | No | Edge type (default: related). OPTIONAL for "link". REJECTED for "create", "update", "link_batch", "unlink", "unlink_batch", "retype". | |
| is_global | No | Mark as global thought (appears in all project-scoped searches). OPTIONAL for "create" and "update". REJECTED for "link", "link_batch", "unlink", "unlink_batch", "retype". | |
| parent_id | No | Parent thought ID. OPTIONAL for "create". REJECTED for all other actions. | |
| source_id | No | REQUIRED ONLY for "link" (source endpoint, same spelling as memory_supersede merge). REJECTED for all other actions. | |
| tags_mode | No | update only: how to apply `tags` — "merge" (default) unions with existing tags, "replace" overwrites the whole tag set. REJECTED for all other actions. | |
| target_id | No | REQUIRED ONLY for "link" (target side, same spelling as memory_supersede merge). REJECTED for all other actions. | |
| url_links | No | URL links. OPTIONAL for "create" and "update": create sets the initial list, update replaces the whole set in array order (an omitted field leaves the set untouched, [] clears it). The array order is the link order. For "bulk_create" each item carries its own url_links with these semantics, so this top-level field is rejected for it. REJECTED for all other actions. | |
| is_profile | No | Retired: remove this field; there is no replacement. | |
| project_id | No | Removed; a create takes the project its cwd resolves to. | |
| thought_id | No | REQUIRED for "update". REJECTED for "link" (use source_id). REJECTED for "create", "link_batch", "unlink", "unlink_batch", "retype". | |
| is_protected | No | Protect from auto-deletion. OPTIONAL for "create" and "update". REJECTED for "link", "link_batch", "unlink", "unlink_batch", "retype". | |
| preview_token | No | OPTIONAL preview token returned by a prior preview. CONSUMED by "unlink" and "retype" (true executes with token validation; missing/stale fails). REJECTED for all other actions. | |
| surface_after | No | update only: pending surfacing delay as an ISO timestamp (UTC, e.g. 2026-01-01T00:00:00.000Z); pass null to clear. REJECTED for all other actions. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | Action payload (structuredContent.result); JSON mirror of content[].text, except the raw-text config action, whose result is { item: { text }, meta } |