| name | description | user_invocable |
|---|---|---|
semantic-search |
Search the vault using semantic query expansion and intelligent result ranking. Use when the user asks questions about vault contents, searches for topics, or needs to find related notes. |
true |
Search using LLM-powered query expansion and intelligent result synthesis. No vector database required.
/search <query>- Search and answer a question/search add-mapping- Add a new semantic mapping/search config- Review or edit search configuration
The skill uses two configuration files in System/Search/:
| File | Purpose |
|---|---|
System/Search/Config.md |
Directory structure, source hints, temporal patterns |
System/Search/Semantics.md |
Term variations, synonyms, domain-specific mappings |
If these files don't exist, the skill will bootstrap by analyzing the directory structure and asking setup questions.
If System/Search/Config.md does not exist:
Run these commands to understand the vault:
# List top-level directories
ls -d */
# Count files by directory
find . -name "*.md" -type f | cut -d'/' -f2 | sort | uniq -c | sort -rn | head -20
# Find deepest nested paths to understand structure
find . -name "*.md" -type f | head -50Present these questions to the user using AskUserQuestion:
-
Content types: "What types of content do you store? (e.g., notes, journal, projects, references)"
-
Time-based content: "Do you have dated entries like a journal or daily notes? If so, where and what format?"
-
Key topics: "What main topics or domains does this vault cover?"
-
Important entities: "Are there people, projects, or concepts that go by multiple names?"
-
Excluded areas: "Are there directories that should be excluded from search? (e.g., templates, archives)"
Create System/Search/Config.md and System/Search/Semantics.md based on the analysis and answers.
Read both config files:
System/Search/Config.md— Directory mappings, temporal patternsSystem/Search/Semantics.md— Term expansions
If either is missing, run bootstrapping first.
Determine from the query:
Temporal relevance (from Config.md patterns):
recent— Sort newest first (--sortr modified)older— Sort oldest first (--sort modified)chronological— Sample across time rangenone— Sort by relevance
Source hints (from Config.md mappings):
- Match query patterns to likely directories
- Apply as path filter if confident
Generate 5-15 search terms by combining:
- Semantic mappings — Direct substitutions from Semantics.md
- Synonyms — Related words the LLM knows
- Variations — Compound forms, abbreviations
Do NOT generate:
- Random typos (use
-ifor case insensitivity) - Overly broad terms
- Terms outside the vault's domain (check Config.md key entities)
Build ripgrep command:
rg -l -i "(term1|term2|term3)" --type md [--sort modified | --sortr modified] [path_filter]Exclude paths from Config.md:
rg -l -i "(terms)" --type md --glob '!System/Templates/*' --glob '!.obsidian/*'For relevance ranking:
rg -c -i "(terms)" --type md | sort -t: -k2 -nr| Query Type | Files to Read | Selection |
|---|---|---|
| Factual | 3-5 | Highest match count |
| Exploratory | 5-10 | Mix of relevance and temporal |
| Chronological | 5-10 | Earliest + latest + samples |
- Answer the question — Use content from files read
- Cite sources — Link files with
[[filename]] - Acknowledge gaps — If vault doesn't contain answer, say so
- Suggest mappings — If useful terms were missing from Semantics.md
Response format:
[Natural language answer]
**Sources:**
- [[File One]] — what it contributed
- [[File Two]] — what it contributed
[Optional: "Consider adding to Semantics.md: `term: variation1, variation2`"]
When searches miss expected results:
- Open
System/Search/Semantics.md - Add under appropriate category
- Format:
primary term: variation1, variation2, "phrase variation"
The mappings file grows through use. Don't try to be exhaustive upfront.
When vault structure changes:
- Run
/search config - Review
System/Search/Config.md - Update directory mappings, source hints, or excluded paths
User: /search How did we handle authentication in the API?
Step 1 - Load Config:
Source hints: "API" → docs/, src/
Temporal: none
Step 2 - Load Semantics:
Found: "authentication: auth, jwt, oauth, login, session"
Step 3 - Expand:
Terms: [authentication, auth, jwt, oauth, "bearer token", middleware, login]
Step 4 - Search:
rg -l -i "(authentication|auth|jwt|oauth|bearer)" --type md docs/ src/
Step 5 - Read top 5 hits by match count
Step 6 - Synthesize answer with citations
No config files: Run bootstrapping flow
No results: Broaden terms, check if mappings missing, try without source hint filter
Too many results: Add more specific terms, apply source hint, focus on highest match counts
New domain/topic: Add to Semantics.md and optionally to Config.md key entities
To use, create this in
<Your Vault>/.claude/skill/search.