| Pattern | When to use |
|---|---|
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 | Scoped retrieval with fine-grained filters |
control.context | Model-ready context block with token budgeting before an LLM call |
client.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
control.queryfor app and agent retrieval. - Prefer
control.contextbefore 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.