wiki_search
Search all wiki pages with full-text keyword search, returning ranked results with snippets. Filter by type or tags, get inline content, or combine search with reading top pages in one call.
Instructions
Full-text keyword search across all wiki pages. Returns paths, scores, and snippets sorted by relevance. Uses BM25 by default; switches to hybrid BM25+vector re-ranking when search.hybrid: true is set in .agent-wiki.yaml (requires wiki_admin action:rebuild to build the vector index first). Set include_content=true for simple inline content (with optional inline_budget cap). Set read_top_n to additionally read the top N unique matching pages (deduplicated) — enables combined search+read in one call; returns a pages array with full content and nextReads for unread matches. Use type or tags to narrow results without a separate wiki_list call. When no results are found, returns a knowledge_gap field with a suggested page slug, title, type, and tags — use it to decide what to create with wiki_write.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query (keywords) | |
| limit | No | Max results (default: 10) | |
| type | No | Filter results to a specific entity type (person, concept, event, artifact, code, comparison, summary, how-to, note, synthesis). Applied after BM25 ranking. | |
| tags | No | Filter results to pages that have at least one of these tags. Applied after BM25 ranking. | |
| include_content | No | If true, include page content inline in results. When a section matched, returns that section; otherwise returns first 200 lines. Saves a follow-up batch read. Default: false. | |
| inline_budget | No | Max total characters of inlined content across all results (only with include_content=true). Greedy — top-scoring results get content first; lower-scoring ones fall back to snippet-only when budget is exhausted. Omit for no limit. | |
| read_top_n | No | How many unique top-scoring pages to read in full (default: unset). When set, activates combined search+read mode: deduplicates search hits, reads up to N unique pages, and returns a `pages` array alongside `results`. Max: 10. | |
| section | No | Section heading filter applied to all page reads when read_top_n is set (e.g. '## Installation'). Case-insensitive partial match. | |
| per_page_limit | No | Max lines per page when read_top_n is set (default: 200, max: 500). Pages exceeding this are truncated with metadata. | |
| include_toc | No | Include table of contents for truncated pages when read_top_n is set (default: false). |