Keep owner-scoped knowledge in immutable revisions and retrieve either published current content or one exact addressed version.
A Knowledge Base is a durable knowledge layer
A Knowledge Base is an owner-scoped collection of Knowledge items. Each item has a title, status, and current_revision_id pointer; each revision stores immutable canonical content, a revision number, content hash, source metadata, and provenance. Publishing a newer revision moves the item pointer while leaving the earlier revision available as an exact historical version. This separates stable reference material from event-shaped memory and makes citations reproducible.
- A base must be active for retrieval.
- A query search considers published items and only the revision named by each item's current_revision_id.
- The same server boundary can resolve a personal owner or an authenticated team-bound context; the caller cannot widen it by supplying a filter.
Choose query search or addressed read
search_knowledge has two mutually exclusive read shapes. Query search supplies query and optionally narrows to knowledge_base_id; it returns a typed knowledge_search envelope with ranked result objects. Addressed read supplies knowledge_item_id and optionally knowledge_revision_id; when the revision is omitted, the item current revision is read, and when it is supplied, that exact immutable revision is read. The handler rejects mixing query with item or revision identifiers.
{
"type": "knowledge_search",
"results": [
{
"knowledge_item_id": "<item-id>",
"knowledge_revision_id": "<current-revision-id>",
"title": "Runbook",
"content": "<ranked excerpt>",
"reference": "knowledge:<item-id>@<current-revision-id>",
"score": 3.42
}
]
}
{
"type": "knowledge",
"knowledge_item_id": "<item-id>",
"knowledge_revision_id": "<exact-revision-id>",
"content": "<bounded canonical content>",
"content_offset": 0,
"content_limit": 4000,
"content_total_chars": 12345,
"content_truncated": true
}
Select the retrieval mode for the job
hybrid is the default and combines normalized lexical and semantic signals with alpha: alpha=0.5 gives equal weight, while alpha closer to 1 favors lexical evidence and alpha closer to 0 favors semantic evidence. Choose lexical when exact terms, identifiers, or phrase overlap are the strongest signal. Choose semantic when meaning matters more than wording and embeddings are available. Choose rrf when independent lexical and vector rankings should be fused by rank rather than compared on one score scale.
- hybrid — linear weighted combination of lexical and semantic scores; the semantic side falls back to lexical when no semantic score is available.
- lexical — normalized term/phrase matching only; useful for names, IDs, and exact wording.
- semantic — vector similarity when available, with the implementation's lexical fallback when it is not.
- rrf — reciprocal rank fusion of lexical and vector rankings; the service uses its configured rank constant.
Strict currentness prevents stale search results
Query search first limits candidates to active Knowledge Bases, published Knowledge items, and the revision currently pointed to by each item. A superseded revision therefore cannot appear as a query result even if it is still present in the append-only revision chain. An addressed read is intentionally different: an explicit knowledge_revision_id asks for that exact revision, subject to owner, base, and published-item authorization, while omitting it follows the current pointer. This gives search freshness without losing historical reproducibility.
query search -> published item + current_revision_id only
addressed no pin -> published item's current revision
addressed with pin -> exact immutable revision, bounded by offset/limit_chars
The read surface is strict, bounded, and read-only
The MCP handler requires knowledge:read, accepts no caller-supplied owner or scope, emits no audit event, and bounds addressed content with offset and limit_chars. Query results are bounded by max_results. The committed OpenAPI contract also contains the authenticated REST companion POST /api/v1/knowledge/search; its full request/response reference and the separate Knowledge authoring routes remain outside this tool-focused slice.
search_knowledge(
query="deployment runbook",
mode="hybrid",
alpha=0.5,
max_results=10
)
search_knowledge(
knowledge_item_id="<item-id>",
knowledge_revision_id="<revision-id>",
offset=0,
limit_chars=4000
)
GA availability still follows the runtime switch
Knowledge Base is documented here as a normal GA capability under Han's 2026-09-02 production enablement confirmation, not as Preview. The repository's knowledge_runtime_enabled default remains false, so an environment that has not enabled the runtime returns knowledge_unavailable with code knowledge_runtime_disabled. That operational check is separate from the tool's read-only contract and does not make a disabled environment silently return stale or unauthorized content.
Persona flows
ChatGPT user
Give ChatGPT durable access to your XMemo preferences, project facts, decisions, and TODOs without pasting bearer tokens into a chat.
Save a synthetic preference or project note, start a new chat, then ask ChatGPT to recall it through XMemo before continuing work.
Copilot / Codex developer
Carry repo decisions, coding conventions, bug-fix notes, and task history between IDE and CLI agents.
Record a codebase decision or bug fix, then ask the next IDE or CLI agent to recall the relevant XMemo context before editing.
Team / enterprise pilot owner
Evaluate shared memory with account controls, source attribution, export/delete workflows, and reviewer-safe setup evidence.
Have a pilot member save a synthetic team memory, confirm source attribution in XMemo, then review delete/export and support paths.