memory
Persist and retrieve semantic memory across sessions. Supports storing key-value entries, appending fragments, editing sections, and semantic search.
Instructions
On session start: get session:latest + project:overview. Semantic memory for cross-session persistence. Returns {success, results/value}. Actions: store (save key+message, full overwrite), append (add fragment to existing key without rewriting it - server concatenates and re-embeds), replace_section (in-place edit of marker-bounded region inside an existing entry), search (semantic query), get (exact key), delete, list. RAM-backed with async disk persist - use liberally. Key conventions: session:latest (current state), project:overview (architecture), learn: (discoveries), pref: (user prefs), todo:, code:. For large rolling docs (timelines, session logs) use append instead of store - massive token savings. For in-place section edits inside a long doc, use replace_section with HTML-comment markers like ''/''. Search is semantic with synonym expansion ('fast'->'quick'). Use preprocess=False for exact match. When encountering issues or problems search for related context. On milestones: store session:latest.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Storage key (e.g., 'learn:kg-patterns'). Required for store/append/replace_section/get/delete. | |
| tags | No | Tags for filtering (search/list) or storing. Auto-extracted from key prefix (learn:topic -> ['learn']). | |
| limit | No | Max results for search/list. Default: 10. | |
| query | No | Semantic search query. Finds related content even with different wording. | |
| action | Yes | store=full overwrite, append=add fragment without rewrite, replace_section=in-place edit between markers, search=semantic query, get=exact key, delete=remove, list=all keys | |
| offset | No | For get: starting char offset into stored text. Use with _next_offset from prior response to page through large entries. | |
| message | No | Content for store/append. For store: full content (overwrites). For append: only the new fragment to add. Markdown supported. | |
| sort_by | No | Sort order for list: 'date' (newest first) or 'key' (alphabetical). | |
| user_id | No | User namespace. Default: 'default'. | |
| inclusive | No | For replace_section: if False (default) preserve markers and replace only between them. If True, replace markers along with the content. | |
| max_chars | No | For get: max chars to return from offset. 0 = all remaining. Response includes _total_chars and _next_offset if more data exists. | |
| separator | No | For append: string inserted between existing text and new fragment. Default '\n\n'. Pass '' for butt-join. | |
| end_marker | No | For replace_section: closing marker. Convention: '<!-- name:end -->'. Must follow start_marker in the document. | |
| new_content | No | For replace_section: replacement content for the region between markers. Falls back to 'message' if not provided. | |
| start_marker | No | For replace_section: opening marker. Convention: '<!-- name:start -->' (HTML comment, invisible in rendered markdown). | |
| create_if_missing | No | For append (default True) and replace_section (default False): if True, create the key/section when it doesn't exist instead of erroring. |