RCR-Router: Efficient Role-Aware Context Routing for Multi-Agent LLM Systems with Structured Memory
Organizations: Carnegie Mellon University · Northeastern University · Harvard University · Fujitsu Research of America ·
Abstract
Large language model (LLM) agents are increasingly organized into multi-agent systems for complex reasoning and decision-making tasks. However, scaling such systems can substantially increase inference cost, especially when multiple agents repeatedly process overlapping or role-irrelevant context. Many existing multi-agent frameworks focus on orchestration and role specialization, but still rely on full-context sharing or static context routing, leading to redundant token consumption, increased runtime, and inefficient memory utilization. We present Role-Conditioned Context Routing (RCR), an execution-time layer that allocates role-relevant shared-memory items to agents under token budgets. Given a structured shared memory and a set of role-specialized agents, RCR selectively routes task-relevant memory items to each agent according to its role, optional task-stage metadata, and token budget. RCR integrates role-conditioned relevance scoring, token-budgeted memory selection, and iterative memory updates to reduce redundant context exposure during multi-agent execution. Experiments on multi-hop QA, embodied reasoning (ALFWorld), and web-based decision-making (WebShop) show that RCR reduces token usage by 35% on average and runtime by 38% on average relative to Full-Context, while maintaining or improving task performance.
Figures & tables
| Benchmark | Method | Avg Runtime (s) | Token (K) | Primary Metric |
|---|---|---|---|---|
| HotPotQA (F1, 0–100) | Full-Context | 150.65 | 5.10 | 74.6 0.6 |
| Static Routing | 128.29 | 3.85 | 76.1 0.6 | |
| Self-RAG | 118.44 | 3.92 | 78.4 0.5 | |
| End-to-End Retrieval | 110.12 | 3.80 | 79.0 0.5 | |
| Multi-Agent Debate | 105.33 | 4.06 | 80.0 0.4 | |
| RCR (Ours) | 91.58 | 3.63 | 83.6 0.5 |
| Method | HotPotQA | ALFWorld | WebShop | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Tok. | Run. | F1 | Tok. | Run. | Succ. | Tok. | Run. | Reward | |
| BM25 Retrieval | |||||||||
| Semantic Retrieval | |||||||||
| Role-only Routing | |||||||||
| Stage-only Routing | |||||||||
| Fixed Budget | |||||||||
| Benchmark | T | Avg Rt (s) | Tok (K) | Metric |
|---|---|---|---|---|
| HotPotQA (F1, 0–100) | 1 | 91.6 | 3.73 | 83.6 |
| 2 | 115.8 | 5.92 | 85.0 | |
| 3 | 141.7 | 7.68 | 85.8 | |
| ALFWorld (Success Rate, %) | 1 | 94.5 | 4.30 | 67.3 |
| 2 | 118.5 | 6.28 | 70.9 | |
| 3 | 143.9 | 7.85 | 71.7 |
| Variant | Rt (s) | Tok (K) | F1 |
|---|---|---|---|
| Single-pass RCR ( ) | 91.6 | 3.73 | 83.6 |
| Static memory rerouting ( ) | 109.4 | 5.48 | 84.1 |
| Extra rounds w/o update ( ) | 112.7 | 5.61 | 83.5 |
| Full-Context same rounds ( ) | 196.4 | 8.74 | 81.2 |
| IRF w/ memory update ( ) | 115.8 | 5.92 | 85.0 |
| Setting | Traj. Len | Mem Gro | Tok (K) | Rt (s) |
|---|---|---|---|---|
| Normal | 1x | 1x | 3.63 | 91.6 |
| +Retry-1 | 1.25x | 1.25x | 4.12 | 103.5 |
| +Retry-2 | 1.5x | 1.5x | 4.67 | 116.8 |
| Component | Latency (s) | Percentage |
|---|---|---|
| Scorer | 1.2 | 1.3% |
| TBA + Memory Selection | 0.8 | 0.9% |
| Agent LLM Inference | 89.6 | 97.8% |
| Total | 91.6 | 100% |
| Benchmark | Configuration | Avg Runtime (s) | Token (K) | Primary Metric |
|---|---|---|---|---|
| HotPotQA (F1) | Full (TBA + IS + SFR) | 91.58 | 3.63 | 83.6 |
| w/o TBA | 101.8 | 3.92 | 79.4 | |
| w/o IS (Recency only) | 96.9 | 3.84 | 78.0 | |
| w/o SFR (FC-in-B) | 108.7 | 3.77 | 76.5 | |
| ALFWorld (Success %) | Full (TBA + IS + SFR) | 94.5 | 4.30 | 67.3 |
| w/o TBA | 107.3 | 4.56 | 64.4 |
| Benchmark | Strategy | Avg Runtime (s) | Token (K) | Primary Metric |
|---|---|---|---|---|
| HotPotQA (F1) | MMR Retrieval | 94.8 1.2 | 3.72 0.06 | 81.8 0.6 |
| Learned Reranker | 93.6 1.1 | 3.70 0.05 | 82.5 0.5 | |
| Prompt Compression | 89.7 1.0 | 3.10 0.04 | 81.5 0.7 | |
| RCR | 91.6 1.3 | 3.63 0.05 | 83.6 0.5 ∗ | |
| ALFWorld (Success %) | MMR Retrieval | 101.2 1.8 | 4.40 0.08 | 66.7 0.8 |
| Learned Reranker | 99.8 1.6 | 4.37 0.07 | 67.0 0.7 |
| Level | Role Decom | Rol | Rt (s) | Tok | F1 |
|---|---|---|---|---|---|
| Coarse | Reasoner; Executor | 2 | 93.1 | 3.75 | 82.4 |
| Default | Planner; Searcher; Rec | 3 | 91.6 | 3.63 | 83.6 |
| Fine | Planner; Searcher; Checker; Composer; Verifier | 5 | 96.2 | 4.02 | 83.8 |
Appendix figures & tables20 assets
Supplementary material from the paper’s appendix.
Appendix
| Benchmark | Train/Val/Test | Router Traj. | Test Inst. | Mem Items | Mem Tokens |
|---|---|---|---|---|---|
| HotPotQA | 90,447 / 7,405 / 7,405 (fullwiki) | 1,000 | 7,405 | 18.6 | 3.2K |
| ALFWorld | 3,553 / 140 / 134 | 800 | 134 | 24.3 | 4.1K |
| WebShop | 10,587 / 1,000 / 500 | 1,000 | 500 | 31.7 | 5.6K |
| F1 | Token (K) | Runtime (s) | ||
|---|---|---|---|---|
| 0.01 | 0.01 | 83.4 | 3.91 | 96.8 |
| 0.05 | 0.01 | 83.6 | 3.63 | 91.6 |
| 0.10 | 0.01 | 83.1 | 3.41 | 88.9 |
| 0.05 | 0.05 | 83.2 | 3.58 | 89.7 |
| 0.05 | 0.10 | 82.7 | 3.49 | 87.5 |
| Component | Specification |
|---|---|
| Agent interface | Same role descriptions, task prompts, tool interfaces, round limits, and stopping rules are used across controlled multi-agent methods. |
| Role metadata | Roles are treated as metadata provided by the underlying agent framework or decomposition module. RCR does not require a fixed role taxonomy. |
| Stage metadata | Stage descriptors are used as optional routing metadata. Baselines that do not use stage-conditioned routing ignore this metadata. |
| Memory pool | All controlled methods use the same shared-memory pool within each benchmark. |
| Routing policy | The only varied component is how memory items are selected and routed to agents. |
| Evaluation | QA benchmarks use Precision/Recall/F1. ALFWorld and WebShop use their benchmark-specific success or task-score metrics. Runtime and token usage are reported across all benchmarks. |
| Benchmark | Traj. | Items | Pos. | Hard Neg. | Soft Neg. | Unlabeled |
|---|---|---|---|---|---|---|
| HotPotQA | 1,000 | 48.2K | 18.6% | 31.4% | 17.3% | 32.7% |
| ALFWorld | 800 | 39.5K | 16.9% | 29.8% | 16.6% | 36.7% |
| WebShop | 1,000 | 56.7K | 15.4% | 33.1% | 17.0% | 34.5% |
| Benchmark | Memory item | Label type | Reason |
|---|---|---|---|
| HotPotQA | Retrieved passage cited by the Searcher and later used by the Synthesizer in a successful answer trajectory. | Positive | Linked to the logged evidence chain used in the successful trajectory. |
| HotPotQA | Entity-overlapping passage retrieved for the same question but contradicted by the later accepted evidence. | Hard negative | Same-role–stage candidate whose content conflicts with the logged successful evidence. |
| HotPotQA | Unused passage with partial entity overlap but no clear support or contradiction in the trajectory. | Unlabeled | Relevance cannot be reliably inferred; masked out from the scorer loss to avoid false-negative noise. |
| ALFWorld | Action/state trace: open fridge; put apple in fridge . | Positive | Appears in a successful logged action trajectory satisfying the goal condition. |
| ALFWorld | Action/state trace: put apple on counter when the target goal requires storing the apple in the fridge. | Hard negative | Contradicts the target state observed in the successful trajectory. |
| ALFWorld | Unused navigation observation from a different room with weak lexical overlap to the goal. | Soft negative | Likely irrelevant due to role–stage mismatch, but not contradicted with full confidence; included with reduced loss weight. |
| Benchmark | Backbone | Method | Avg Runtime (s) | Token (K) | Primary Metric |
|---|---|---|---|---|---|
| HotPotQA (F1, 0–100) | GPT-5-mini | Full-Context | 150.65 | 5.10 | 74.6 0.6 |
| GPT-5-mini | Static Routing | 128.29 | 3.85 | 76.1 0.6 | |
| GPT-5-mini | RCR | 91.58 | 3.63 | 83.6 0.5 | |
| Qwen3-Max | Full-Context | 162.8 | 5.07 | 70.9 0.8 | |
| Qwen3-Max | Static Routing | 137.6 | 3.86 | 72.4 0.7 | |
| Qwen3-Max | RCR | 101.7 | 3.64 | 78.6 0.7 |
| Benchmark | Method | Avg Runtime (s) | Token (K) | Precision | Recall | F1 |
|---|---|---|---|---|---|---|
| HotPotQA | Full-Context | 150.65 | 5.10 | 72.3 | 75.1 | 74.6 |
| Static Routing | 128.29 | 3.85 | 74.8 | 77.5 | 76.1 | |
| Self-RAG | 118.44 | 3.92 | 77.5 | 79.3 | 78.4 | |
| End-to-End Retrieval | 110.12 | 3.80 | 78.0 | 80.1 | 79.0 | |
| Multi-Agent Debate | 105.33 | 4.06 | 79.1 | 81.0 | 80.0 | |
| RCR (Ours) | 91.58 | 3.63 | 81.8 | 84.4 | 83.6 |
| Benchmark | Budget Strategy | Runtime | Token (K) | Metric |
|---|---|---|---|---|
| HotPotQA (F1, 0–100) | Uniform static | 95.4 | 3.69 | 81.2 |
| Dev-oracle static per-role | 99.8 | 4.21 | 83.8 | |
| Learned TBA (RCR) | 91.6 | 3.63 | 83.6 | |
| ALFWorld (Success Rate, %) | Uniform static | 98.9 | 4.34 | 66.3 |
| Dev-oracle static per-role | 103.6 | 4.86 | 67.6 | |
| Learned TBA (RCR) | 94.5 | 4.30 | 67.3 |
| Benchmark | Ave Runtime (s) | Token (K) | Primary Metric | |
|---|---|---|---|---|
| HotPotQA (F1) | 512 | 75.1 | 2.42 | 71.1 |
| 1024 | 86.7 | 3.12 | 76.8 | |
| 2048 | 91.6 | 3.63 | 83.6 | |
| 4096 | 126.4 | 5.85 | 82.0 | |
| ALFWorld (Success %) | 512 | 71.3 | 2.21 | 60.5 |
| 1024 | 83.8 | 3.13 | 64.6 |
| Token (K) | Runtime (s) | F1 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Method | ||||||||||||
| Full-Context | 5.10 | 6.82 | 8.49 | 10.18 | 150.7 | 201.2 | 251.3 | 301.8 | 74.6 | 75.8 | 75.2 | 74.3 |
| Static Routing | 3.85 | 5.14 | 6.40 | 7.65 | 128.3 | 171.4 | 213.8 | 256.2 | 76.1 | 77.2 | 76.9 | 76.5 |
| RCR (Ours) | 3.63 | 4.53 | 5.31 | 5.98 | 91.6 | 109.5 | 124.3 | 137.6 | 83.6 | 84.8 | 85.3 | 85.7 |
| Role | Stage | Time | Memory item |
|---|---|---|---|
| Planner | Decompose | Sub-query 1: find the oldest university in the English-speaking world. | |
| Planner | Decompose | Sub-query 2: find rivers sharing a name with a U.S. state. | |
| Searcher | Evidence | Oxford University was founded around 1096–1167 and is located in Oxford, England. | |
| Searcher | Evidence | River Thames flows through Oxford; River Mississippi shares a name with a U.S. state. | |
| Searcher | Evidence | River Ohio flows through Oxford, Ohio, giving a candidate river–state match. | |
| Searcher | Stale | [Stale] Cambridge was also considered; this is contradicted by later evidence. |
| Planner receives | Searcher receives | Recommender receives |
| Sub-query 1: oldest English-speaking university. | Oxford University was founded around 1096–1167 and is located in Oxford, England. | Oxford University was founded around 1096–1167 and is located in Oxford, England. |
| Sub-query 2: river sharing a U.S. state name. | River Thames flows through Oxford; River Mississippi shares a name with a U.S. state. | River Ohio flows through Oxford, Ohio, giving a candidate match. |
| Reasoning trace: verify whether the candidate city satisfies both constraints. | River Ohio flows through Oxford, Ohio, giving a candidate match. | Synthesis note: the Oxford candidate needs revision on the river-name condition. |
| Filtered item: the stale Cambridge item is suppressed. The Planner receives reasoning traces without raw evidence overload; the Searcher receives evidence-heavy memory; and the Recommender receives evidence plus synthesis signals rather than all planning traces. | ||
| Resulting outputs: The Planner decomposes the task into university identification and river–state verification. The Searcher flags that Oxford, England satisfies the university condition, while Oxford, Ohio provides the river–state match. The Recommender revises the initial candidate and avoids relying on the stale Cambridge memory. | ||
| Planner receives | Searcher receives | Recommender receives |
| Sub-query 1: oldest English-speaking university. | Oxford University was founded around 1096–1167 and is located in Oxford, England. | Oxford University was founded around 1096–1167 and is located in Oxford, England. |
| Sub-query 2: river sharing a U.S. state name. | [Stale] Cambridge was also considered. | Synthesis note: the river condition needs revision. |
| Reasoning trace: verify both constraints. | River Thames flows through Oxford. | Missing key evidence: River Ohio match is absent. |
| Dropped item: the River Ohio evidence is not routed to the Searcher because the stale Cambridge item consumes part of the budget. The Recommender therefore lacks the key river–state evidence needed to complete verification. | ||
| Resulting outputs: The Planner still produces the correct decomposition, but the Searcher reports Oxford/Cambridge as competing university candidates and fails to retrieve the River Ohio evidence. The Recommender returns an incomplete or incorrect answer because the river condition remains unresolved. | ||
| Memory Type | Planner | Searcher | Recommender |
|---|---|---|---|
| Reasoning traces | 61% | 12% | 24% |
| Retrieved evidence | 8% | 71% | 45% |
| Sub-plans | 28% | 9% | 18% |
| Tool outputs | 3% | 8% | 13% |
| Agent | Mixed context window |
|---|---|
| Planner | Current goal: decompose the question into two sub-queries ; earlier brainstorming suggested Cambridge but was later contradicted ; identify the oldest English-speaking university ; duplicate raw evidence from a previous search ; verify whether the candidate city also satisfies the river-name condition ; unrelated notes about university rankings and old search attempts. |
| Searcher | Oxford University was founded around 1096–1167 and is located in Oxford, England ; stale snippet about Cambridge as a possible oldest university ; River Ohio flows through Oxford, Ohio and shares its name with a U.S. state ; duplicate search results about the River Thames ; retrieve evidence linking each candidate city to the relevant constraint ; broken links, unrelated pages, and outdated retrieval keywords. |
| Recommender | The answer must satisfy both the university condition and the river-name condition ; unused draft answer: Oxford, England ; verified evidence supports revising the initial candidate ; repeated evidence fragments and obsolete summaries ; final synthesis should use only verified evidence ; irrelevant meeting notes and superseded reasoning traces. |
| Agent | RCR routed context |
|---|---|
| Planner | Current goal: decompose the question into two sub-queries. Identify the oldest English-speaking university. Verify whether the candidate city also satisfies the river-name condition. |
| Searcher | Oxford University was founded around 1096–1167 and is located in Oxford, England. River Ohio flows through Oxford, Ohio and shares its name with a U.S. state. Retrieve evidence linking each candidate city to the relevant constraint. |
| Recommender | The answer must satisfy both the university condition and the river-name condition. Verified evidence supports revising the initial candidate. Final synthesis should use only verified evidence. |
| Agent | Mixed context window |
|---|---|
| Planner | Current goal: find a lightweight running shoe under $100 ; earlier plan suggested formal leather shoes but was abandoned ; decompose the task into price, category, size, and review constraints ; duplicate notes from previous searches for hiking boots ; prioritize products matching the user’s stated budget and use case ; unrelated browsing history about office chairs and phone cases. |
| Searcher | Product result: lightweight running shoe, size 10, price $79.99, average rating 4.5 ; stale result: out-of-stock running shoe from an earlier page ; retrieved attribute: breathable mesh upper and suitable for daily running ; duplicate search result from the same seller with a different thumbnail ; compare price, availability, rating, and shipping constraints ; unrelated product snippets for dress shoes, sandals, and backpacks. |
| Recommender | The selected item should satisfy category, price, availability, and user preference constraints ; unused draft recommendation for a leather loafer ; verified evidence supports the lightweight running shoe as the best match ; repeated product descriptions and obsolete cart candidates ; final recommendation should cite price, rating, and matching attributes ; irrelevant notes about previously rejected products and unrelated categories. |
| Agent | RCR routed context |
|---|---|
| Planner | Current goal: find a lightweight running shoe under 100, size = 10, preference = lightweight and well-reviewed. Prioritize candidates matching the user’s stated budget and use case. |
| Searcher | Candidate product: lightweight running shoe, size 10, price $79.99, average rating 4.5. Retrieved attributes: breathable mesh upper, daily running use, available stock. Compare price, availability, rating, and shipping constraints. |
| Recommender | Verified evidence supports the lightweight running shoe as the best match. The item satisfies category, price, size, availability, and user preference constraints. Final recommendation should cite price, rating, and matching attributes. |
| Agent | Mixed context window |
|---|---|
| Planner | Current goal: put a clean mug on the coffee table ; earlier plan searched the bathroom sink but was abandoned ; decompose the task into locating a mug, cleaning it, and moving it to the target receptacle ; duplicate notes about opening already-checked drawers ; track unresolved constraints: mug must be clean and placed on the coffee table ; unrelated observations about a knife, apple, and bedroom lamp. |
| Searcher | Observation: a dirty mug is on the kitchen counter ; stale observation: mug might be in the cabinet, contradicted by later observation ; useful receptacles: sink can clean the mug, coffee table is the target location ; repeated action log: open drawer, close drawer, open drawer ; retrieve next actionable locations for washing and placing the mug ; unrelated room-state traces from the bedroom and pantry. |
| Recommender | The next action should move toward satisfying both conditions: clean the mug and place it on the coffee table ; unused draft action: put mug in cabinet ; verified trace supports the sequence: pick up mug, go to sink, clean mug, go to coffee table ; obsolete action candidates from failed drawer exploration ; final action proposal should avoid revisiting checked locations ; irrelevant object notes about the knife, apple, and lamp. |
| Agent | Routed context type | RCR routed context |
|---|---|---|
| Planner | Reasoning state and sub-plan | Current goal: put a clean mug on the coffee table. Decompose the task into: locate mug, clean mug, and move it to the coffee table. Track constraints: the mug must be clean and the final receptacle must be the coffee table. |
| Searcher | Evidence and actionable observations | Observation: a dirty mug is on the kitchen counter. Useful receptacle: the sink can be used to clean the mug. Target location: the coffee table. Next actionable locations: kitchen counter, sink, and coffee table. |
| Recommender | Verified action trace and next action | Verified trace: pick up mug, go to sink, clean mug, go to coffee table. Avoid revisiting checked drawers or unrelated rooms. Recommended next step: continue the action sequence that satisfies both the clean-mug and target-placement constraints. |
LLM Context Management
Large language model context management studies how to select, compress, retrieve, and organize information within bounded model inputs.
See all 246 papers