Recipes
Lane-Scoped Multi-Agent Memory
Isolate agent memory into named lanes so specialists see only their relevant context while sharing a common run.
When multiple agents share a run, not every agent should see every piece of memory. Lanes partition the memory space so each agent reads only what it needs while still operating within the same session.
Prerequisites
- MuBit client initialized with a valid API key
- A multi-agent system where agents have distinct responsibilities
Flow
- Register each agent with
shared_memory_lanesdeclaring which lanes it participates in. - Ingest data with
lane=to tag items to a specific lane. - Query with
lane_filter=to retrieve only lane-scoped entries. - Context assembly respects the same
lane_filterfor token-budgeted prompts.
Minimal implementation example
How lanes interact with scopes
Lanes and scopes are independent filtering mechanisms that compose:
| Mechanism | What it filters | Set at |
|---|---|---|
Lane (lane / lane_filter) | Which memory partition an item belongs to | Ingest time / query time |
Scope (read_scopes / write_scopes) | Which entry types an agent can read or write | Agent registration time |
| User isolation | Which authenticated user owns the data | Authentication time |
An agent with read_scopes=["fact", "lesson"] and lane_filter="planning" sees only facts and lessons tagged with the planning lane.
ℹ️Note
lane (MAS memory isolation) is distinct from the core data-plane retrieval lane concept (direct_lane). They serve different purposes and do not interact.
Failure modes and troubleshooting
| Symptom | Root cause | Fix |
|---|---|---|
| Lane-filtered query returns nothing | Lane name mismatch between ingest and query | Verify the exact lane string matches at both ends |
| Agent sees data from other lanes | Querying without lane_filter | An empty lane_filter returns all entries including unscoped ones |
| Items without lanes are invisible to lane queries | Items ingested without lane are unscoped (lane "") | Unscoped items are not returned by a lane-filtered query — "" never equals a named lane. Tag the item with that lane, or place shared data on an explicit shared lane and query that lane (as the example does). Only an empty lane_filter returns unscoped items. |
| Context assembly ignores lanes | lane_filter not passed to get_context() | Pass lane_filter explicitly in context requests |
Next steps
- Review the full HTTP contract at Control HTTP reference.
- See Multi-Agent Shared State for scope-based coordination without lanes.
- See Step-Level Outcomes for per-step reward recording.