mem_save
Save a project convention, decision, gotcha, or glossary term as persistent memory that survives across AI sessions, using type, slug, body, and scope to organize knowledge by visibility and topic for deduplication and updates.
Instructions
Save a piece of knowledge as a persistent memory that survives across AI sessions.
USE THIS WHEN you discover something worth remembering for future sessions:
A project convention (how things are done here)
An architectural decision and its rationale
A gotcha or non-obvious behavior that surprised you
A domain term and what it means in this codebase
DO NOT USE for failed approaches → use mem_tried instead (better structure). For reactive code discoveries during exploration, prefer a compact gotcha via mem_save.
PARAMETERS: type — convention | decision | gotcha | architecture | glossary | attempt slug — short kebab-case id (e.g. 'flyway-no-modify-existing') body — Markdown content with the full knowledge scope — team (shared with all devs) | personal (private) | module (component-scoped) paths — anchor to source files for staleness detection (STRONGLY recommended) topic — stable key for upsert: if a memory with same topic+scope exists, update it in-place
RETURNS: { id, scope, file_path, action: 'created'|'updated', warning?, invalid_paths? } WARNING: if paths point to non-existent files, they will be immediately stale after hivelore sync. DEDUP: identical body content within the same scope is rejected — use mem_update to modify.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | Markdown body of the memory | |
| slug | Yes | Short human-readable identifier — becomes part of the filename | |
| tags | No | Tags for filtering | |
| type | Yes | Kind of memory being saved. Use 'skill' for reusable procedures/playbooks agents should follow for recurring tasks (feedforward harness guide). Use 'attempt' for failed approaches (auto-validated). Use 'session_recap' via mem_session_end instead. | |
| paths | No | Anchor paths (file paths this memory references) | |
| scope | No | Visibility scope: personal | team | module. When omitted, falls back to defaultScope in haive.config.json (default: personal). | |
| topic | No | Stable key for this memory. If a memory with the same topic already exists in this scope, it is updated in-place (revision_count++). Use for knowledge that evolves over time. | |
| author | No | Author handle or email | |
| commit | No | Anchor commit SHA (for staleness detection later) | |
| domain | No | Domain (e.g. transactions, billing) | |
| module | No | Module name (required when scope=module) | |
| symbols | No | Anchor symbols (function/class names this memory references) | |
| activation | No | Only for type='skill'. Progressive-disclosure triggers: the skill is surfaced ONLY when a keyword matches the task or a glob matches the edited files (or always=true). Omit to keep the skill always-eligible. |