3.4 KiB
3.4 KiB
name, description
| name | description |
|---|---|
| keep | Explicit immediate memory. Use when user says "keep X", "zapamatuj si X", "ulož si X", "pamatuj si X", "/keep X". Adds, deduplicates, and compacts entries in workspace/keep.md. Separate from MEMORY.md / Dream pipeline. |
Keep
Explicit memory store. User says "keep X" → reformulate, write to
/home/nanobot/.nanobot/workspace/keep.md, dedup, compact when too long.
File
workspace/keep.md. Flat bullet list. One entry = one line: - <terse fact>.
No dates. Date adds noise, has no value for keep/discard decisions.
Write protocol
- Extract the core fact. Drop filler ("you know", "important is that", "watch out for", "remember please").
- Rewrite as a 5–15 word terse fact. Telegraphic style. Dashes / parentheses
for context. Preserve the language of the input — never translate. Czech
input → Czech entry, English input → English entry.
- Input: "you know, Honza from marketing is allergic to peanuts"
- Entry:
Honza (marketing) — peanut allergy - If the entry is a decision, preference, or dead-end (not a plain fact),
append the reason inline on the same line:
<fact> — because <terse why>. Plain facts (allergy, deploy window, name) get no reason. - If it is a decision/preference/dead-end but the input gives no reason, ask the user once for the why before storing. If they supply it → append it. If they decline or it is self-evident → store without it.
- Read
workspace/keep.md(create if missing). - Read
workspace/memory/MEMORY.mdand check if a semantically similar fact already exists there (Dream may have already distilled it).- If similar fact in MEMORY.md → tell the user (
"Already in MEMORY.md: <existing fact>. Keep anyway?") and act on their answer. Default: skip.
- If similar fact in MEMORY.md → tell the user (
- Check duplicates: case-insensitive substring match against existing lines.
- If duplicate → ask user: replace, append as variant, or skip.
- Append the new line.
- If line count > 150 → run compaction (below) before responding.
- Confirm:
Kept: <terse fact>. Respond in the user's language (the model localizes the confirmation itself).
Compaction
Trigger: line count > 150, or user says "keep compact" / "udělej compaction".
- Read full
keep.md. - Rewrite under ~120 lines (headroom). Strategies:
- Merge duplicates and near-duplicates.
- Drop stale one-shot info (past meetings, transient states, expired notes).
- Shorten verbose entries.
- Write the new file in one go.
- Report:
Compaction: 151 → 117 lines.
Edge cases
/keepwith no content → ask "What should I remember?".- Vague input ("remember this", "that thing") → ask for the concrete fact; do not store a placeholder.
- File missing → create it on first write.
- Multi-line input → collapse newlines to spaces; one entry = one line.
Rules
- Never store the verbatim input. Always reformulate.
- Reason (why) only for decisions / preferences / dead-ends — never for plain facts. Always terse and inline on the same line; never a separate Why: block.
- Preserve input language; never translate.
- Do not store smalltalk or meta-commentary about memory itself.
- Keep is separate from MEMORY.md and Dream. Read MEMORY.md only for the dedup check (step 4); never edit it or any Dream file from this skill.
- Touch
keep.mdonly via this skill. Other agent paths should read it (per USER.md reference) but not edit it.