Toon Memory

v4.5.0
io.github.LuiggiVal08/toon-memory Checked 1 hour ago Published 4 days ago

Offline persistent memory for AI coding agents — 42 tools, 80% fewer calls, no LLM

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

memory_remember Save to Memory

Save a fact to the project's persistent memory (decisions, patterns, bugs, knowledge). Persists between sessions. Tags: 'private' excludes from context injection; 'superseded' marks as obsolete.

ParameterTypeDescription
category *stringCategory of the fact. 'warning' = negative memory ('NO hacer esto, rompe X') — recalled with a boost so past mistakes surface first.
content *stringDetailed content of the fact
key *stringShort title in kebab-case (e.g. risk-engine-priority)
filestringRelated file or line (e.g. spec.md:145)
importancestringExplicit importance level — critical/high entries surface first in recall, low last. Omit for auto (recency + frequency).
linksstringRelated entry keys, separated by space or ';' (e.g. risk-spec engine-arch). Builds graph edges.
originstringWho created this entry.
path_scopestringGlob pattern to scope this entry (e.g. src/**.ts). Empty = global.
tagsstringSemicolon-separated tags (e.g. risk;spec)
ttlstringTime to live (e.g. 7d, 2026-07-17). Empty = no expiration

memory_recall Search Memory

Search the project's persistent memory. Returns relevant entries. Use BEFORE reading files. Pattern: recall → context_diff for recent changes → capture to save observations.

ParameterTypeDescription
as_ofstringTemporal view (YYYY-MM-DD): return entries valid on that date. Superseded entries still appear if they were active then.
biasstring'session': boost entries whose file matches current session files. 'none': no bias (default).
budgetstring'tiny': key+1 line (~50 tokens). 'normal': compact with tags/edges. 'deep': all fields (default). Overrides 'compact'.
budget_tokensintegerDeterministic token budget: include entries until the estimated output reaches ~N tokens (overrides limit).
categorystringFilter by category (empty = all)
compactbooleanToken-efficient output: numeric indices (1, 2), omits id/date/file (keeps tags). Does not mutate .toon file.
explainbooleanAppend a 'why this entry' line to each result (relevance %, times used, last used, importance). No LLM — pure heuristics.
from_datestringStart date filter (YYYY-MM-DD or relative like 'ayer', 'la semana pasada', '7d')
hopsintegerGraph depth in 'graph' mode (1 or 2). Default 1.
idsstringBatch fetch: comma/space/;-separated entry ids or keys, rendered in the given order (unknown entries skipped). Complements mode:'index' — layer 2 of progressive disclosure. Overrides mode.
limitintegerMaximum entries returned. Default 6 (15 in 'index' mode). Keeps token cost low.
modestring'flat' = keyword search (default). 'graph' = graph-based recall: expands the related-entry subgraph from matches (more precise, fewer tokens). 'index' = one line per entry (key, id, category, date, re…
path_scopestringGlob pattern to filter entries by path scope (e.g. 'src/**.ts').
querystringText to search for (optional when mode:'index' or ids is given)
rrfbooleanUse Reciprocal Rank Fusion (BM25x3 + centrality ranks, adaptive k=sqrtN) instead of weighted linear scoring. Weight-free: reaches parity with the tuned linear scorer on scripts/bench-rrf.mjs.
sessionBiasbooleanAlias of bias:'session' (documented in older READMEs).
sincestringAlias of from_date with natural-language dates.
to_datestringEnd date filter (YYYY-MM-DD)
todaystringAlias of as_of (documented in older changelogs).

memory_forget Forget from Memory

Lifecycle operations for a memory entry: soft (default) marks it obsolete and hides it from recalls, hard permanently removes it, restore brings it back to active, supersede retires it with a typed superseded_by edge to a newer entry.

ParameterTypeDescription
key *stringKey or id of the entry
actionstringsoft: mark obsolete (default). hard: permanently remove. restore: bring an obsolete entry back to active. supersede: mark obsolete with a superseded_by link to new_key.
new_keystringReplacement entry key or id (only used with action: supersede).
reasonstringOptional note appended to the old entry (only used with action: supersede).

memory_smart_recall Smart Recall (Unified)

Unified retrieval: combines BM25 + graph + decay + quality in a single call. Use at the START of each task to get all relevant memory context. Then use context_diff for recent changes, context_focus for deep dives.

ParameterTypeDescription
intent *stringDescribe what you need to know (e.g. 'database schema for backend')
biasstring'session': boost entries whose file matches current session files. 'none': no bias (default).
budget_tokensintegerDeterministic token budget: include entries until the estimated output reaches ~N tokens (overrides limit).
categorystringFilter by category (empty = all)
explainbooleanAppend a 'why this entry' line to each result (relevance %, times used, last used, importance). No LLM — pure heuristics.
limitintegerMaximum entries to return
rrfbooleanUse Reciprocal Rank Fusion (BM25x3 + centrality ranks, adaptive k=sqrtN) instead of weighted linear scoring. Weight-free: reaches parity with the tuned linear scorer on scripts/bench-rrf.mjs.

memory_summary File Summary

Save or retrieve a summary of a large file to save tokens.

ParameterTypeDescription
action *stringget to read, set to save
file *stringFile path
summarystringFile summary (only for set)

memory_captured List Captured Activity

Show activity log captured automatically by hooks (only if capture is enabled). Useful for promoting observations to memory with memory_remember.

ParameterTypeDescription
clearbooleanIf true, clears the capture log
filestringFilter by file
limitintegerMaximum observations to show
toolstringFilter by tool name

context_brief Context Briefing

Generate a compact context briefing: relevant memory + active sessions + project health. Single call instead of 5-6 separate calls. Zero LLM, pure deterministic logic.

ParameterTypeDescription
budgetintegerToken ceiling for the handoff packet when handoff=true.
handoffbooleanPrepend the compact handoff packet with identity, freshness, directives, traps and file pointers.
limitintegerMaximum relevant entries to show
taskstringCurrent agent task. If provided, entries are ranked by relevance to this task. If empty, shows top entries by importance.

context_compile Compile Task Context

Compile a task into a tiny context packet: directives, constraints, relevant memory, decisions, retrieval queries, hydrate keys, files and sessions. Deterministic, zero LLM, feedback-aware. Prefer this over context_brief when a task is known.

ParameterTypeDescription
task *stringCurrent agent task or question
budgetintegerToken ceiling for the compiled packet

context_hydrate Hydrate Compressed Context

Expand hydrate keys emitted by context_compile into full memory entries. Layer 2 of progressive disclosure.

ParameterTypeDescription
keys *arrayKeys or ids from context_compile's Hydrate section

memory_checkpoint Session Checkpoint

Save or update a session checkpoint with 7-day TTL. Creates a knowledge entry snapshot of the current session state. Same session = upsert (single checkpoint per session). Auto-expires.

ParameterTypeDescription
notestringOptional summary of what was accomplished in this session.

memory_feedback Feedback on recalled memory

Tell toon-memory whether a recalled entry was useful, irrelevant, outdated or wrong. Explicit feedback adjusts learned utility; 'wrong' also flags evidence as conflict. Use this after acting on a recalled memory.

ParameterTypeDescription
key *stringKey or id of the entry you used
signal *stringuseful | irrelevant | outdated | wrong
taskstringShort description of the task where the memory was used

memory_promote Promote Observations

Heuristic auto-promote from the capture log (no LLM). Each observation gets a deterministic confidence score; high-confidence ones promote as active entries, low-confidence (≤ minConfidence) become reviewable drafts. Opt-in: run with dryRun: true first.

ParameterTypeDescription
daysintegerOnly consider observations from the last N days.
dryRunbooleanIf true, only preview what would be promoted (no writes).
maxintegerMaximum observations to promote.
minConfidencenumberObservations at or below this confidence become drafts; above it become active entries.