feat(mcp): hybrid search + progressive disclosure + timeline retrieval#15
Conversation
Covers progressive disclosure, hybrid keyword+semantic search, timeline navigation, and stable citation IDs.
…ndex, hybrid source
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Review Summary by QodoHybrid search, progressive disclosure, timeline retrieval, and stable citation IDs
WalkthroughsDescription• Hybrid search merges keyword (full-text index) and vector results via Reciprocal Rank Fusion (k=60), catching exact-string matches vector-only missed • Progressive disclosure: search_thoughts returns compact index (id, summary, 240-char snippet, type, topics, score) instead of full content, ~10× smaller payload • New get_thoughts tool hydrates full content for specific IDs on demand, enabling selective detail fetching after search • New timeline_thoughts tool navigates temporal neighbors around a seed thought or timestamp (up to 5 before/after by default, capped at 50 each) • Stable citation IDs surfaced in all retrieval tools with cite guidance (thought:<id>, insight:<id>) in descriptions • Removed dead searchByVector internal action after migration to hybrid search Diagramflowchart LR
A["search_thoughts<br/>keyword + vector"] -->|RRF merge| B["Compact index<br/>id, summary, snippet"]
B -->|user selects IDs| C["get_thoughts<br/>batch detail fetch"]
C -->|full content| D["Claude response<br/>with citations"]
B -->|temporal anchor| E["timeline_thoughts<br/>neighbors by time"]
E -->|compact index| D
File Changes1. packages/convex/convex/schema.ts
|
Code Review by Qodo
1.
|
- Remove % match badge from ThoughtCard (RRF scores aren't cosine similarity) - Fix listAroundTime off-by-one: strict <, splice seed in timeline action - Replace hybridSearch N+1 reads with batch getByIds (Qodo) - Lazy code-point iteration in truncateSnippet (Qodo) - Push _creationTime bounds into index builder (Qodo) Co-Authored-By: Claude <noreply@anthropic.com>
|
Addressed all three issues from this review in 68235c2: 1. Hybrid search N+1 reads → Fixed. 2. Snippet truncation O(n) → Fixed. Rewrote 3. Timeline time bounds pushed into index → Fixed. All four branches of |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 68235c2. Configure here.

Summary
Overhauls AI Brain's retrieval layer to make stored memories more discoverable and cheaper to consume from MCP clients.
search_thoughtsnow merges keyword (Convex search index) and vector hits via Reciprocal Rank Fusion (k=60), replacing the prior vector-only path. Catches exact-string matches that pure cosine similarity missed.search_thoughtsreturns a compact index (id, summary, 240-char snippet, type, topics, score) instead of full content, cutting payload size roughly 10×. Newget_thoughtstool hydrates full content for specific IDs on demand.timeline_thoughtsMCP tool returns temporal neighbors around a seed thought or timestamp. Lets the model explore what was captured alongside a relevant result.thought:<id>,insight:<id>).publicActions.searchto hybrid and removed the now-deadsearchByVectorinternal action.Plan:
docs/superpowers/plans/2026-04-20-memory-retrieval-upgrades.md(13 tasks, all landed or correctly skipped).Test Plan
pnpm --filter @repo/web check-typespasses (verified locally)pnpm --filter @repo/db deploy:devsearch_thoughts("COPA Commander remodel")returns compact index rows ordered by hybrid scoreget_thoughts(ids=[...])returns full content for IDs from the prior searchtimeline_thoughts(seedId=<recent>)returns chronological neighbors (up to 5 before + 5 after by default, capped at 50 each)thought:<id>/insight:<id>citationsNotes
🤖 Generated with Claude Code
Note
Medium Risk
Touches core retrieval/query logic and changes
search_thoughts/Convex action argument+return shapes, which can break existing MCP clients and affect ranking/results quality.Overview
Overhauls thought retrieval for MCP and the app’s search path by adding a Convex full-text
searchIndexand switching search from vector-only to hybrid keyword + semantic ranking via Reciprocal Rank Fusion (RRF), with optional thoughttypefiltering.Implements progressive disclosure:
search_thoughtsnow returns compact index rows (id,summary,snippet,type,topics,score,createdAt) and drops the oldthresholdarg; a newget_thoughtstool/action batch-fetches full documents by ID with ownership filtering. Adds timeline retrieval viatimeline_thoughts(and backing queries/actions) to fetch thoughts around a seed or timestamp, and updates MCP outputs/descriptions to consistently include IDs + citation guidance. Also removes the UI “match %” display and adjusts the web UI to stop passingscore.Reviewed by Cursor Bugbot for commit 8f769a1. Bugbot is set up for automated code reviews on this repo. Configure here.