Agent-facing index-first knowledge-base retrieval (PLT-283)
POST/api/kb/query
Agent-facing index-first knowledge-base retrieval (PLT-283). Runs the same queryKnowledgeBase read the coordinator brain uses, under the calling agent’s own auth, so the wiki RLS + an UNCLASSIFIED classification cap scope every read to what the caller may see. Returns the rendered KB section (index + recent synthesis pages, capped to the coordinator context budget) plus a citations array. Backs the query_knowledge_base MCP tool and the pt query-kb CLI.
Request
Responses
- 200
- 400
- 401
- 403
- 502
- 503
Successful response
Validation failure (empty question, malformed spaceSlug).
Caller is not authenticated.
The wiki backend rejected the forwarded caller credentials (HTTP 401/403) — WIKI_BACKEND_FORBIDDEN.
The wiki backend was unreachable or errored (5xx / timeout / malformed body) — WIKI_BACKEND_UNAVAILABLE.
The wiki backend is not configured on this deployment (WIKI_ZONE_URL unset).