Skip to content

managed-memory: search-first recall via the new entries:search tool#248

Draft
kevinyan122 wants to merge 1 commit into
databricks:mainfrom
kevinyan122:feat/managed-memory-search-first
Draft

managed-memory: search-first recall via the new entries:search tool#248
kevinyan122 wants to merge 1 commit into
databricks:mainfrom
kevinyan122:feat/managed-memory-search-first

Conversation

@kevinyan122

Copy link
Copy Markdown
Contributor

What

Adds search_memory as a sixth tool to the managed-memory skill and makes it the primary recall path, replacing the previous list_memoriesget_memory flow (which was documented as a stopgap until search shipped). Synced to all 5 templates that carry the skill.

  • New tool prompt documents the query contract for the lexical (BM25) entries:search API: a natural-language question or keywords both work, phrased with the words you'd expect to appear in the memory itself; top_k default 10, max 50; results come back ranked with full contents inlined, so recall is a single call with no get_memory follow-up.
  • get_memory / list_memories demoted to fallbacks (exact-path reads of [has_contents] entries; full-inventory asks like "what do you remember about me?").
  • Save dedup now searches first instead of listing.
  • MEMORY_INSTRUCTIONS rewritten to match: search-first recall, empty-result semantics (nothing matched those words ≠ nothing stored), raise top_k or fall back to list_memories for very broad questions.
  • Limits/troubleshooting: BM25 scores are unbounded (ranking only); newly written entries take a few seconds to become searchable (list/get see them immediately); fallback guidance for workspaces where entries:search hasn't rolled out yet.

Testing

Dogfooded on agent-langgraph-advanced against a staging workspace (store kevinyan.default.kevin_test), locally and deployed to Databricks Apps with OBO scope resolution:

  • 19-conversation eval in a fresh scope: all 7 save-side cases clean (dedup, update-in-place on contradiction, no saving of transient chatter); recall probes confirmed single-call search recall, honest misses on unstored facts, list_memories for inventory asks.
  • Verified the write→searchable index lag and the unbounded-score behavior documented here.

🤖 Generated with Claude Code

Add search_memory as the sixth tool and make it the primary recall path,
replacing list_memories -> get_memory. The tool prompt documents the
lexical (BM25) query contract (question or keywords, words expected to
appear in the memory itself, top_k default 10 / max 50) and that results
inline full contents. get_memory and list_memories are demoted to
fallbacks; save dedup now searches first. MEMORY_INSTRUCTIONS rewritten
to match. Document unbounded scores, the write->searchable index lag,
and a fallback for workspaces where entries:search hasn't rolled out.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant