search_knowledge
Find relevant document chunks by topic or keyword using hybrid semantic and BM25 search, with category and folder filters for targeted knowledge-base lookups.
Instructions
Hybrid search combining semantic search + BM25 keyword search with cross-encoder reranking.
Read-only. No side effects.
Args:
query: Search query text (1–3 keywords recommended; phrase queries also work)
max_results: Maximum number of results (default: 5, capped by search.max_results).
category: Optional category filter — one of: security, ctf, logscale, development, general,
redteam, blueteam. Call list_categories() first to see available categories and counts.
hybrid_alpha: Balance between semantic and keyword search. 0.0 = keyword-only (best for exact
technical terms like CVE IDs or tool names), 0.3 = balanced default, 1.0 = semantic-only
(best for conceptual or natural-language queries).
min_score: Minimum normalized relevance score (0.0–1.0) to include a result. Results scoring
below this threshold are discarded. Default 0.0 returns all results. Use 0.2–0.4 to cut
low-relevance noise.
snippet_mode: When true (default), truncates content to ~500 characters at a natural break
point and adds a content_length field with the original size. Use get_document() to
fetch full content when needed. Set to false to return full chunk content.
search_method: Dispatch selector (v4.8.2+). One of "auto" (router picks FTS5 fast-path
for lexical queries when enabled, hybrid otherwise), "hybrid" (force hybrid path —
kill switch for suspected router misclassification), or "fts5" (force FTS5 fast-path
— debug/testing; errors out when the feature is disabled or the index is not ready).
Default "auto" preserves pre-v4.8.2 behavior byte-for-byte when the fast-path is
disabled in config.
include_folders: Optional list of directories relative to documents_dir, recursively included
before candidate selection (e.g. ["manuals/product-a", "runbooks"]). Omit for all folders.
exclude_folders: Optional recursive directory exclusions, applied before candidate selection.
Exclusions override inclusions. Paths use / or , have exact component boundaries,
and cannot be absolute, contain '..', or resolve outside documents_dir. Maximum 32 each.
Returns: JSON string with results including content chunks, source filepath, relevance score, and search method used. Returns chunks, not full document content.
Usage: Primary search tool — use for any topic or keyword lookup. Prefer search_similar() when you already have a reference document and want more like it. Prefer get_document() when you already know the exact filepath and need the full content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| category | No | ||
| min_score | No | ||
| max_results | No | ||
| hybrid_alpha | No | ||
| snippet_mode | No | ||
| search_method | No | auto | |
| exclude_folders | No | ||
| include_folders | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |