Skip to main content
Traditional RAG forces every retrieval decision into application code: you pick the index, choose the similarity metric, set the top-k, decide which documents to stuff into the prompt, and wire it all together before the model ever sees the query. When requirements change you re-engineer the pipeline. MuBit takes the opposite approach. The agent decides the retrieval mode and the memory compartment at query time. You call control.query with mode: "agent_routed", and the runtime selects the best retrieval lane — semantic search, temporal scan, sparse recall, SDM, graph traversal, or a combination — based on the query and the data it already holds. You don’t hard-code the retrieval path; the agent routes itself.

What this looks like in practice

# One call. The runtime picks the lane.
response = client.control.query({
    "run_id": "support:agent:ticket-42",
    "query": "What did the customer say about billing last week?",
    "mode": "agent_routed",
})
Compare with a typical RAG setup where you would write: embed the query → hit a vector store → rank results → truncate to context window → inject into prompt template → call LLM. Each step is a place where retrieval quality can silently degrade, and every step is your code to maintain.

How this works

ConcernRAG pipeline (you own it)MuBit agent-routed (runtime owns it)
Which index to queryHard-coded per endpointRuntime selects lane from query semantics
Top-k and rankingFixed or tuned per use-caseAdaptive per memory compartment
Context assemblyYour prompt-stuffing logicRuntime returns ranked results; agent consumes
Adding a new retrieval modeNew code path + deployAlready available — runtime routes when useful
ObservabilityYou instrument each hopBuilt-in: lane, latency, and match metadata in response

When to override

Agent-routed retrieval is the right default. Override it when you have an explicit reason:
  • direct_lane: "semantic_search" — force pure vector similarity when you know the answer is a nearest-neighbor match.
  • Explicit RAG — when you need to assemble context from multiple external sources before calling MuBit, or when your compliance rules require auditable retrieval steps. In this case, use control.ingest / control.batch_insert to load data and control.query with a specific direct_lane to retrieve it.

Failure modes and troubleshooting

SymptomRoot causeFix
Inconsistent answers across requestsSwitching between agent-routed and hard-coded lanesPick one default mode and stick with it
Hard incident triageRetrieval path not loggedInspect lane and match_metadata fields in query response
Missing deterministic relationshipsRelying on similarity for structured factsIngest explicit facts and use control filters or graph-aware recall
Context window overflowReturning too many resultsSet limit on query; let the agent prune

Next steps