Build with Mubit
Query patterns
Use routed retrieval, direct semantic search, and control filters for structured Mubit retrieval.
Mubit provides several retrieval patterns depending on your use case:
| Pattern | When to use |
|---|---|
client.memory.recall() (control.query with mode: "agent_routed") | Default retrieval path — routes through the control plane for answer-oriented results |
control.query with entry_types, include_working_memory, agent_id, user_id through client.raw.invoke | Scoped retrieval with fine-grained filters |
client.memory.context() (/v2/loop/context, or control.context with lane="legacy") | Model-ready context block with token budgeting before an LLM call |
client.raw.invoke("core.search", ...) | Direct semantic search when you need raw core hits (policy-gated) |
Routed retrieval example
Structured control query example
Direct semantic search example
Guidance
- Prefer
client.memory.recall()for app and agent retrieval. - Prefer
client.memory.context()(orrun.context()) before an LLM step. - Use direct semantic search only for advanced compatibility cases where you need raw core hits.
- Treat
user_idas a logical sub-scope tag only. It narrows retrieval inside the authenticated actor boundary and never expands access.