kb_search
Ask the knowledge base a question or search it to retrieve governing requirements, linked facts, ADRs, scenarios, and tests before changing behavior; low-confidence queries abstain.
Instructions
Ask the KB a question or search it. Default intent-v1 ranking accepts questions, host-agent semantic facets and changed-code source locations, returns evidence, abstains below its confidence threshold and adds an answer layer: the current requirements that govern the topic, what must stay true (linked facts), why (ADRs) and what verifies it (scenarios, tests). A weak answer may add queryAnalysis.hints from a search-hints plugin: requirements the question may mean, to re-ask with. Use before changing behavior, then kb_query for exact follow-up. No mutation side effects.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Optional entity type filter to narrow discovery. Example: 'req'. | |
| hints | No | Intent-v1 only, first page only. When true (default) and the project activates a kibi.search-hints.v1 plugin, a weak or abstained answer adds queryAnalysis.hints: requirements the question may mean, to re-ask with. Hints never change results or the answer layer. | |
| limit | No | Optional max rows to return after ranking. Default: 10; raise it or page with offset when the answer layer is not enough. | |
| query | Yes | Free-text query for metadata and markdown body discovery. Example: 'OAuth login flow'. | |
| answer | No | Intent-v1 only, first page only. When true (default) the result includes an answer layer: current governing requirements with their linked facts, scenarios, tests and ADRs, superseded requirements listed separately, and observation facts labelled as notes. Bounded in size; discovery, not proof. | |
| fields | No | Optional result detail. 'summary' returns identifying metadata plus the match snippet for discovery. Use 'full' to include complete entity bodies, or follow up with kb_query for the exact entities you need. | |
| offset | No | Optional zero-based pagination offset. Default: 0. | |
| minScore | No | Intent-v1 acceptance threshold between 0 and 1. Low-confidence queries abstain instead of returning misleading matches. | |
| rankingMode | No | Optional deterministic ranking mode. Default intent-v1: question-aware ranking with semantic facets, source-aware evidence, graph boosts, superseded demotion and abstention. Use legacy for the older lexical ranking. | |
| workspaceRoot | No | Optional absolute path of the workspace this call is about when it differs from the one the server started in, for example the git worktree you are working in. The server answers from that workspace's knowledge base when it is a worktree of the same repository or lies under the client's MCP roots; otherwise it answers from its own workspace and adds a workspace_mismatch diagnostic. Host hooks fill this in automatically where available. | |
| semanticFacets | No | Optional host-agent semantic interpretation. Kibi uses these strings as deterministic aliases/facets; ranking never calls a model. | |
| sourceLocations | No | Optional changed-code locations. Results are matched to source-linked symbols/entities and include source evidence. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | ||
| error | No | ||
| status | Yes | ||
| effects | Yes | ||
| operation | Yes | ||
| diagnostics | Yes | ||
| nextActions | Yes | ||
| kibiProtocol | Yes | ||
| resultVersion | Yes |