Skip to content

docs: vault search redesign design doc#2271

Open
logancyang wants to merge 3 commits intomasterfrom
design/vault-search-redesign
Open

docs: vault search redesign design doc#2271
logancyang wants to merge 3 commits intomasterfrom
design/vault-search-redesign

Conversation

@logancyang
Copy link
Copy Markdown
Owner

Summary

Replace the monolithic localSearch tool with three focused tools that mirror Unix find / grep / cat:

Tool Analogy Purpose
vaultFind find List files by metadata (time, tags, folder, title). Returns metadata + headings, no content. Always local.
vaultSearch grep Search file contents for a topic. Returns matching passages. Delegates to Miyo/semantic/lexical.
readNote cat Read full note content. Already exists, unchanged.

Motivation

The current localSearch handles time filtering, tag matching, title matching, AND content search in one tool. This caused #2267 where timeRange was silently dropped in the Miyo code path. More fundamentally, the monolithic design prevents the agent from composing multi-step queries intelligently.

Key Design Decisions

  • vaultFind is always local — uses Obsidian's vault API and metadataCache. No Miyo, no embeddings, no Node.js dependency (mobile-safe).
  • vaultSearch has NO metadata filtering — pure content search. Time/tag/folder filtering is vaultFind's job.
  • Composition via paths parametervaultSearch accepts optional paths from a vaultFind result to scope content search to specific files.
  • Headings from metadataCachevaultFind returns headings (free from cache), giving the agent enough context to decide what to read without blowing up context.
  • Architectural invariant: Time/tag/folder filtering is ALWAYS local (vaultFind). Content search ALWAYS delegates to best backend (vaultSearch). These never cross.

Query Examples

"What did I do last week?"          → vaultFind(timeRange=...)
"Notes about machine learning"      → vaultSearch(query="machine learning")
"Notes about X from last week"      → vaultFind(timeRange=...) → vaultSearch(query="X", paths=[...])
"Summarize Q3 meeting notes"        → vaultFind(folder="Q3Meetings") → readNote each
"Meeting notes mentioning John"     → vaultFind(tags=["#meeting"]) → vaultSearch(query="John", paths=[...])

Design Doc

Full design doc with schemas, 10 query examples, agent instructions, migration plan, and implementation notes:
designdocs/VAULT_SEARCH_REDESIGN.md

logancyang and others added 3 commits March 6, 2026 16:31
…dNote)

Design doc for replacing the monolithic localSearch tool with three
focused tools: vaultFind (metadata), vaultSearch (content), readNote (unchanged).

Motivated by bug #2267 where timeRange was silently dropped in the Miyo
code path due to tangled metadata/content filtering responsibilities.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add example 11: "Summarize the budget discussions in my meeting notes
from last week under Q3Meetings" — combines time + folder + content
search, the most complex composition pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Design decisions resolved:
- Remove salientTerms from agent-facing schema (tool extracts internally)
- Remove sortBy, limit, headings from vaultFind (hardcode mtime, 200, none)
- Remove returnAll from vaultSearch schema
- Remove paths cap (no limit — paths are cheap strings)
- Miyo MUST support path-scoped search (not optional post-filter)
- Semantic search deprecated — only lexical + Miyo backends
- Add fallback guidance in agent instructions (0 results case)

Co-Authored-By: Claude Opus 4.6 <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