Importing data
Bring in reference material via MCP tool or HTTP API bulk import.
KB endpoints
Full HTTP API reference for creating, importing, and querying Knowledge Bases.
How Knowledge Bases differ from conversational memory
| Conversational memory | Knowledge Bases | |
|---|---|---|
| Content | Extracted facts, decisions, and lessons from your sessions | Imported reference chunks — docs, runbooks, policies |
| Mutability | Updated continuously as you work | Stable; chunks are written once and not rewritten by conversation |
| Scope | Per-user, tied to channel and store | Scoped to a workspace, client, or agent lane |
| Recall | Searched automatically on every turn | Queried explicitly with crystal_query_knowledge_base |
Use cases
- Documentation — import your product’s API reference so your agent can cite it accurately
- Policies and rules — load compliance policies, coding standards, or style guides as a stable source of truth
- Runbooks — give your agent instant access to operational playbooks without relying on its training data
- Source material — pull in research papers, specifications, or design documents for a project
Scope and privacy
Every Knowledge Base is owned by your user account and isolated at the database level. You can further restrict a KB to a specific scope string (such as a workspace or client identifier) or to specific agent IDs. When thescope field is set, only requests with a matching channel see that KB.
Scope values are matched exactly against the channel string passed by the agent at query time. If a KB has no scope set, it is visible to all your agents.
Tools
The three Knowledge Base tools are available in every MCP-compatible host and in the OpenClaw plugin.crystal_list_knowledge_bases
Lists available Knowledge Bases. Optionally filters by scope or agent.
Filter to Knowledge Bases whose scope matches this string. Pass the channel identifier for the current workspace or client lane.
Filter to Knowledge Bases that are visible to this specific agent ID.
crystal_query_knowledge_base
Searches a specific Knowledge Base using hybrid semantic and text search. Returns ranked chunks.
The ID of the Knowledge Base to search. Obtain this from
crystal_list_knowledge_bases.The search query. Can be a natural-language question or keyword phrase.
Maximum number of chunks to return. Capped at 20.
crystal_import_knowledge
Imports reference chunks into a Knowledge Base, including embedding and graph enrichment. Use this for moderate amounts of material.
The ID of the target Knowledge Base.
Array of chunks to import. Each chunk has:
title(string, optional) — display title for the chunkcontent(string, required) — the text content to storetags(string[], optional) — tags for filtering and recall
Example: listing and querying a Knowledge Base
List your Knowledge Bases
Call The tool returns an array of KB objects, each with an
crystal_list_knowledge_bases to find the IDs of available KBs._id field you use for queries.