What this means in practice
Recall-oriented flows include:- semantic recall — find memories by semantic similarity
- recent-message continuity — access recent conversation context
- topic scans — broad topic understanding across memories
- decision archaeology — trace past decisions and reasoning
- ownership lookups — find who owns or manages entities
- dependency tracing — understand what depends on what
- preflight retrieval — gather context before an action
crystal_recall — Semantic memory search
The primary semantic recall tool. Retrieves memories by embedding similarity, with optional filtering by store, category, tags, and mode. Recall is graph-backed and source-role aware. The vector search produces candidates, then the backend reranks with memory strength/confidence, relationship evidence, category/mode fit, scope, recency, and knowledge-basesourceRole when KB evidence is present. Use direct KB lookup for explicit manual/reference questions; use recall when the agent needs a blended memory view.
Parameters
For OpenClaw/plugin-backed sessions,
agentId is threaded automatically when available so the backend can resolve shared vs peer-scoped knowledge-base access correctly.
For coding agents, pass either projectId or repoSlug whenever the working repository is known. That keeps one repository’s recall from being muddied by unrelated repositories, while still allowing account-wide recall when no project scope is appropriate.
Returns
Examples
Basic semantic search:When to use vs alternatives
crystal_recall (semantic similarity)
Use when: You want to find memories related to a topic by semantic meaning. Best for open-ended exploration and context building. Example: “What have I learned about database architecture?” PassagentId for client/agent-specific recall and projectId/repoSlug for repo-specific coding sessions.
crystal_search_messages (exact transcript match)
Use when: You need to find exact messages or phrasing from recent conversations. Better for recent continuity than long-term patterns. Example: “Find the exact conversation where we discussed X.” Tool:crystal_search_messages
crystal_what_do_i_know (broad topic scan)
Use when: You want a comprehensive overview of everything about a topic without specifying a query. Returns facts, decisions, lessons, workflows, and goals all at once. Example: “What do I know about Memory Crystal architecture?” Tool:crystal_what_do_i_know
crystal_recent (time-ordered continuity)
Use when: You need the most recent messages in order, not by relevance. Useful for session continuity and understanding what just happened. Example: “What did we just discuss?” Tool:crystal_recent
Decision guide
Recall modes explained
Error handling
Confidence and scoring
Recall results include semantic and memory-quality scores:score— semantic similarity (0–1), where 1 is a perfect semantic matchconfidence— the system’s confidence in the memory itself (varies by age, access count, strength)sourceRole— optional KB/source classification such asvoice_style,persona_guardrail,canonical_reference, orclient_contextscope— optional tenant, peer, channel, or project scope used for visibility and ranking
[HIGH CONFIDENCE] (≥0.8) should be referenced in your response, especially for factual queries.
Graph enrichment status can affect ranking, but skipped deterministic rows are not always a problem. KB child chunks are usually skipped because their parent chunk carries the graph context for the whole KB.
How it actually works
Key repo surfaces:convex/crystal/recall.ts— main recall query logicconvex/crystal/recallRanking.ts— ranking and scoring algorithmconvex/crystal/messages.ts— message search and retrievalconvex/crystal/mcp.ts— tool registration and HTTP routingmcp-server/src/tools/recall.ts— MCP tool definition
Shared vs peer-scoped recall
The shipped recall path supports both:- peer/client sessions like
peer-coach:511172388 - shared/open sessions like
peer-team:main
- private client memories stay peer-scoped
- shared training KBs can be exposed through
scope: "...:main"pluspeerScopePolicy: "permissive"when you intentionally want them available to multiple agents/chats under one key
Common mistakes
- Treating recall as a single feature instead of a family of related retrieval flows
- Assuming vector search alone explains the final ranking (it’s combined with strength, recency, and scope)
- Treating knowledge-base lookups and recall as interchangeable. KB lookup is the right tool for a named reference corpus; recall is the right tool for blended memory.
- Ignoring the role of recent-message and scope-aware filtering
- Not using modes to guide recall toward specific memory types
- Forgetting that
crystal_recentandcrystal_search_messagesserve different purposes than semantic recall
Source of truth
Primary files behind this page:mcp-server/src/tools/recall.ts— tool definitionconvex/crystal/recall.tsconvex/crystal/recallRanking.tsconvex/crystal/messages.tsconvex/crystal/mcp.ts
Notes
Peer-first fallback (new in 0.7.15)
Whenchannel is omitted on a peer-facing call, recall now fails-closed on any knowledge base with a concrete peer scope instead of silently upgrading to management-level visibility. If you’re integrating recall from a peer session and expect KB results, always pass the peer channel (e.g. peer-coach:511172388). Omit channel only when you intend a deliberately unscoped (management) read.