Adaptive Memory MCP server - SQLite-backed memory for OpenCode
th-memory-mcp demonstrates solid tool design with 16 well-named, verb-prefixed tools covering memory lifecycle (remember, recall, forget, save_lesson). All tools have descriptions (avg ~120 chars, within 10-1024 baseline). Input schemas are present and typed for all tools. However, output schemas are not documented in the visible code, LLMs cannot predict return structures. Error handling is minimal; tools lack recovery guidance. Some parameter descriptions are sparse (e.g., 'limit' lacks min/max bounds). Tool composition is strong (each does one thing), but missing idempotency guarantees and confirmation patterns for destructive ops (forget, consolidate, merge_memory). Security: plaintext SQLite at rest (acknowledged in code comment), no permission gates, no audit logging visible.
Cluster similar memories via embedding similarity and optionally create derived/consolidated memories linked via 'derived_from'. Use during periodic consolidation.
Export preferences, lessons, profile (and optionally raw interactions) to a JSON file under data/exports/. Only writes inside that directory. Returns the file path, size in bytes and a JSON preview.
Scan recent captured interactions for memory-intent phrases and propose memory candidates (deterministic, no LLM). Dry-run by default; pass apply=true to create them (source=captured).
Delete one memory row (preference, lesson or interaction) by id and sync the search index. Pass type when you know it (ids from remember are preference ids, from save_lesson are lesson ids).
Assemble relevant memories for the current task via hybrid retrieval (+ optional memory-graph expansion), with token budgeting. Use to load memory into context before a task.
Get the distilled user profile: profile sections, top preferences by confidence (max 15), and the 5 most recent lessons.
Output schemas not documented. LLMs cannot predict return structures for any tool. get_profile, recall, get_context, and export_memory return complex nested objects (profile sections, lessons, embeddings, file paths) but no schema is visible in code.
Destructive operations lack confirmation/dry-run patterns. forget, consolidate, merge_memory, and import_memory (apply=true) perform irreversible state changes without explicit confirmation or dry-run-by-default safety. Agents can accidentally delete memories.
Numeric parameters lack bounds. 'limit' appears in recall, search_history, get_recent_interactions, get_context, extract_memories but no min/max documented. Unbounded limits can cause context window exhaustion or timeout.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 61 | 2026-07-28+ | v2 |
List recently captured raw interactions (newest first) as [id] ts [kind] content lines. Optionally filter by kind. Use for auditing history or before distilling memory.
Import memories from a JSON array or a .json file inside data/exports/. Validates type, dedupes against existing memories, and never overwrites active memory blindly. Dry-run by default; pass apply=true to insert.
Create a typed relationship between two memories in the graph (supports/contradicts/supersedes/derived_from/related_to/caused_by/depends_on).
Summarize memory usage: interaction counts by kind, preference/lesson totals, DB file size, oldest/newest interaction timestamps, and profile sections.
Merge a duplicate/near-duplicate memory into a canonical one. The source becomes superseded and provenance is recorded in metadata.merged_from.
Search preferences + lessons via full-text index, plus recent matching interactions. Use before starting a new task.
Save or update a user preference (category+key upsert). Re-saving the same key increases confidence by 0.1 (cap 1.0). Returns the row id for forget().
Record a lesson learned from a correction: what situation, what mistake, what is the correct way. Call immediately after the user corrects your work.
Search past user prompts (kind='prompt') by keyword. Returns timestamped snippets truncated to 200 chars each.
Update mutable fields (summary/importance/confidence/valid_from/valid_until/metadata) in place. If content changes, a superseding memory is created by default (set supersede=false to edit in place).
No error recovery guidance. Tools return errors but do not guide LLM on next steps. E.g., if forget fails due to invalid id, no suggestion to call memory_stats or get_recent_interactions to find valid ids.
No idempotency guarantees documented. remember increments confidence on re-save; save_lesson, link_memory, and import_memory lack idempotency declarations. Agents retrying on ambiguous failures risk duplicate records.