Search Vault
searchFind documents matching a query in a Markdown vault with keyword, semantic, or hybrid search. Filter by folder or frontmatter fields and get snippet results for quick scanning.
Instructions
Find documents matching a query using full-text or semantic search.
Search the vault. Omit 'mode' for the best mode this vault can serve — hybrid when embeddings are configured, keyword when they are not. Pass mode="keyword" for exact terms, operators, or filenames, where FTS5/BM25 beats fusion. Use mode="semantic" for pure vector similarity.
The 'content' field in each result is a snippet by default, not the full document. Use read(path, section=heading) to retrieve the full text of a specific section.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | "keyword" uses FTS5/BM25 for exact terms. "semantic" uses vector similarity (requires embeddings). "hybrid" fuses both via reciprocal rank fusion — best quality when available. Omit it (the default) to follow the vault's configured DEFAULT_SEARCH_MODE, which ships as "auto": hybrid where embeddings exist, keyword otherwise. Any configured default degrades to "keyword" when it needs embeddings the vault lacks; an explicit "semantic"/"hybrid" still errors when unconfigured. | |
| limit | No | Maximum results to return (default 10). | |
| query | Yes | Natural language or keyword query string. | |
| folder | No | Restrict to documents under this folder path (e.g. "Journal"). Must match a value from 'list_folders'. Use folder="" for root-level (top-level) documents only. | |
| filters | No | Filter by indexed frontmatter field values, e.g. {"cluster": "craft", "tags": "pacing"}. Only fields listed in indexed_frontmatter_fields (see 'stats') can be filtered. Multiple filters are ANDed. For list fields (e.g. tags), this checks membership — {"tags": "pacing"} matches any document where "pacing" appears in the tags list. On an OKF bundle three keys carry OKF semantics: status ("draft"/ "stable"/"deprecated"; "stable" also matches notes without a status field), stale ("true"/"false" — stale_after passed), and trust_tier ("unverified"/"machine-confirmed"/ "human-reviewed"); "type" filters normally, e.g. {"type": "Playbook", "stale": "false"}. | |
| snippet_words | No | Width of the snippet window in words. Omit to use the server default. Set to 0 to return full chunk content. Use read(path, section=heading) for full section recovery. | |
| chunks_per_file | No | Maximum number of sections to return per file (default 2). Set to 1 to get only the top-ranked section per file. Must be >= 1. | |
| wait_for_pending_writes | No | When True, wait until your recent document mutations have been applied to the index before answering, so the results reflect those changes. Use it right after modifying notes when this read must see them (e.g. right after a document mutation whose effect this read should reflect). Default False answers immediately from the current index — almost always already up to date; inspect the response's ``_meta.index_stale`` field to tell whether a write was still in flight. Bounded by a server timeout (default 60s); on timeout it answers from the current index rather than waiting longer. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |