#10001: fix(memory-lancedb): support partial ID matching in memory_forget
extensions: memory-lancedb
stale
## Problem
The `memory_forget` tool displays truncated IDs when listing memories (e.g. `[36880d07]`) but requires full UUIDs to delete. This creates a frustrating UX where the displayed ID can't be used directly.
## Solution
Add prefix matching support, similar to the pattern used in #9641 for exec approvals:
- Add `findByIdPrefix()` method to `MemoryDB` class that searches for memories matching a partial ID
- When `memoryId` param is < 36 chars, treat it as a prefix and look up the full ID
- Also show full IDs in the deletion candidate list for clarity
## Testing
Manually verified against local LanceDB instance — partial IDs now successfully resolve and delete the correct memory entries.
## Notes
AI-assisted: planned by Kai (Kimi K2.5), implemented by Edwin (Claude Opus 4.5). Happy to address any feedback.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
- Adds `MemoryDB.findByIdPrefix()` to resolve truncated memory IDs to full IDs during `memory_forget`.
- Updates `memory_forget` to accept prefix IDs (< 36 chars), returning explicit not-found / ambiguous-prefix responses.
- Changes candidate listing output to show full memory IDs instead of 8-char truncation for easier copy/paste.
<h3>Confidence Score: 4/5</h3>
- Mostly safe to merge once input validation around prefix IDs is tightened.
- Changes are localized to the memory-lancedb tool and add explicit handling for not-found/ambiguous prefixes. Main remaining concern is that prefix mode currently accepts arbitrary short strings, which can bypass the existing UUID-format guard and produce confusing behavior; tightening validation would reduce surprises.
- extensions/memory-lancedb/index.ts
<!-- greptile_other_comments_section -->
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#21016: Fix memory_forget candidate IDs to prevent deletion retry loop
by natustx · 2026-02-19
77.8%
#15896: fix(memory-lancedb): capture even with injected recall context
by aelaguiz · 2026-02-14
72.1%
#3401: fix(memory-lancedb): improve autoCapture with turn-by-turn processing
by mike-nott · 2026-01-28
71.0%
#11179: fix(memory): replace confusing "No API key" errors in memory tools ...
by liuxiaopai-ai · 2026-02-07
69.8%
#16669: feat(memory-lancedb): add memory_search/memory_get compatibility re...
by ciberponk · 2026-02-15
69.7%
#9624: fix(memory): resolve QMD search returning empty results [AI-assisted]
by kowshik24 · 2026-02-05
69.5%
#6362: fix(memory): add ignore patterns to chokidar file watcher
by Glucksberg · 2026-02-01
69.0%
#6060: feat(onboarding): add Memory Optimization step to onboarding wizard
by GodsBoy · 2026-02-01
69.0%
#16657: feat(memory-lancedb): add memory CLI command alias
by ciberponk · 2026-02-15
68.8%
#9026: fix(session-memory): sanitize content to prevent binary data in mem...
by Flamrru · 2026-02-04
67.8%