Skip to main content
MuBit exposes two default read patterns:
  • recall() when you want MuBit to answer a question from memory
  • getContext() / get_context() when you want a context block to send to your own model
Use raw control.query when you need explicit control over low-level request fields or want to debug wire-level behavior.

Retrieval decision model

NeedRecommended method
Answer a question from stored memoryrecall()
Build a prompt-ready context blockgetContext() / get_context()
Inspect memory quality and gapsdiagnose() and memoryHealth() / memory_health()
Explicit raw control over query payloadclient.control.query(...)
Compatibility-only direct lanesclient.core.* advanced routes when explicitly enabled

Helper-first retrieval examples

retrieve_helper.py
def retrieve_helper(client, run_id: str, question: str):
    answer = client.recall(
        session_id=run_id,
        query=question,
        entry_types=["fact", "lesson", "rule"],
    )
    context = client.get_context(
        session_id=run_id,
        query=question,
        mode="summary",
        max_token_budget=400,
    )
    return answer, context

What the helper path buys you

  • recall() uses the current control-plane query contract without you assembling the raw payload manually.
  • getContext() / get_context() gives you sectioned, cache-friendly context assembly with optional budget control.
  • diagnose() and memoryHealth() / memory_health() help you understand why retrieval is weak before you start changing prompts blindly.

Failure modes and troubleshooting

SymptomRoot causeFix
Answer ignores an important lessonEntry types or context budget too broadRestrict entry types and use getContext() budgeting
Retrieval feels noisyYou are mixing compatibility-only direct lanes with routed pathsStandardize one default read path per workflow
You need wire-level parity checksHelper abstracts too muchDrop to raw client.control.query(...) for that case

Next steps