Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content
Learn the basics

Associative Retrieval

Use MuBit routed retrieval and context assembly to produce grounded, scoped answers and reusable prompt context.

Associative retrieval in MuBit is not just vector similarity. It is the control-plane contract that combines scoped memory selection, evidence ranking, and answer or context synthesis.

For most applications, the primary retrieval surfaces are:

  • recall() for answer-oriented retrieval
  • getContext() / get_context() for prompt-ready context assembly
  • raw control.query when you need wire-level control

Mental model

  • Default to the routed retrieval path.
  • Keep run_id / session_id stable.
  • Use entry_types when you need only facts, lessons, or rules.
  • Use explicit context budgeting when the downstream model window matters.

Minimal helper-first example

query_payload.json
{
  "run_id": "support-thread-42",
  "query": "What customer preferences are already known?",
  "mode": "agent_routed",
  "limit": 5,
  "entry_types": ["fact", "lesson", "rule"]
}
ℹ️Note

The query/recall response includes a citations array — 0-based indices into evidence marking which items grounded final_answer (empty when the answer cites no specific evidence, such as an abstention). It is a response field, not a request parameter, and is validated server-side so every index is a valid position in evidence. Use it to render citations or audit answer grounding.

Failure modes and troubleshooting

SymptomRoot causeFix
Sparse evidenceScope mismatch or weak memory writesKeep one stable run scope and tag memory intentionally
Context is too wideNo token budget or type restrictionUse getContext() budgeting and entry_types
Retrieval still looks weakMemory quality degradedUse diagnose() and memoryHealth() / memory_health()

Next steps