feat: return excerpts from memory.list / memory.search, full text via memory.get #28

Merged
jknapp merged 1 commits from feat/memory-snippets-in-search-list into main 2026-11-14 19:07:11 +00:00
1 Commits
Author SHA1 Message Date
shadowdaoandClaude Opus 5.5 a1cdfae0bd feat: return excerpts from memory.list / memory.search, full text via memory.get
Both tools returned every memory's full body, so one search across a few
dozen long memories could pour thousands of words into the caller's
context. The memory.get description already promised that list/search
"return summaries"; this makes it true.

Each list/search item now carries, instead of `content`:
- `excerpt`: ~200 chars, whitespace collapsed, cut on word boundaries.
  For search it is the window matching the most distinct query terms
  (stopwords ignored); for list, or a meaning-only hit with no term in
  the text, it is the memory's opening.
- `contentLength` and `truncated`, so the caller can tell a short note
  (excerpt is the whole thing) from a long document worth a memory.get.

`full: true` on either tool restores the whole `content`. Ids, tags,
scope, project, version, timestamps and search ranks are unchanged.
memory.get is unchanged. The web UI calls searchMemories directly and is
unaffected. Named `excerpt`, not `snippet`, to avoid confusion with the
snippet.* tools.

Tool descriptions now point callers at memory.get for full bodies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 11:03:33 -08:00