Enrich-Retrieve-Rank: Scaling Capability Discovery Beyond In-Context Routing
Organizations: Amazon AGI Seattle, WA, USA
Abstract
Agent ecosystems now include thousands of MATS components (Models, Agents, Tools, and Skills), yet their discovery still relies on in-context routing. These systems read a registry (names, hints, or descriptions, as context budget permits), pick a candidate, invoke it, and retry on failure. This pattern degrades with scale, and registries are growing fast. We recast capability discovery as search over a registry by defining an offline enrichment step that turns sparse metadata into searchable profiles, and an online retrieve-then-rank pipeline that returns a ranked shortlist without invoking any candidates online. We show that from N=10 to 7,278 capabilities, in-context routing's top-1 accuracy (Match@1) collapses (0.85 to 0.12), while retrieve-then-rank degrades more gently (0.81 to 0.39) because its reranker still ranks the right capability first 0.70-0.87 of the time once retrieval finds it. In the Nova Micro sweep, the crossover is around N=500. We compare against two in-context baselines. Full-Ctx puts the whole registry in the prompt and asks the LLM to pick. Search&Pick gives the LLM a search tool to narrow candidates before it picks. At full scale the pipeline leads Search&Pick by 6.5 percentage points (pp) on Match@1 at about half the cost. It reduces cost 70x versus Full-Ctx. We use a fixed configuration (same enrichment, retriever, and scorer weights) across agent, tool, and skill registries. The pipeline runs in production as the default capability-discovery layer of a large-scale multi-agent platform.
Figures & tables
| Type | Benchmark | Reg. | Queries |
|---|---|---|---|
| Tools | ToolRet | 7,278 | 7,961 |
| Tools | AppWorld | 332 | 147 |
| Agents | ToolRet | 5,885 | 7,961 |
| Agents | AppWorld | 8 | 147 |
| Skills | MCP | 859 | 1,627 |
| Row ( n / q ) | Regex | Full Ctx | Search &Pick | Trial &Err | BM25 | BGE 5f | Ours +BM25 | Ours +BGE | Ours +Titan |
|---|---|---|---|---|---|---|---|---|---|
| Tools / ToolRet (7,278 / 7,961) | 0.231 | 0.166 | 0.332 | 0.054 | 0.311 | 0.346 | 0.388 | 0.389 | 0.397 |
| Tools / AppWorld (332 / 147) | 0.408 | 0.762 | 0.476 | 0.061 | 0.483 | 0.429 | 0.741 | 0.735 | 0.741 |
| Agents / ToolRet (5,885 / 7,961) | 0.228 | 0.148 | 0.341 | 0.045 | 0.336 | 0.360 | 0.418 | 0.412 | 0.397 |
| Agents / AppWorld (8 / 147) | 0.993 | 0.986 | 0.973 | 0.014 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| Skills / MCP, leaky (859 / 1,627) | 0.648 | 0.968 | 0.829 | 0.624 | 0.880 | 0.892 | 0.807 | 0.806 | 0.942 |
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
| Row | Method | M@1 | Tok-in/q | Tok-out/q | $/1k q | p50 (ms) | Source |
|---|---|---|---|---|---|---|---|
| Tools — ToolRet | Full-Ctx | 0.166 | 128,067 | 8 | 4.4835 | 5,841 | real |
| Search&Pick | 0.332 | 3,141 | 48 | 0.1166 | 1,556 | real | |
| Trial&Err | 0.054 | 1,875 | 29 | 0.0697 | 1,532 | real | |
| Ours+BM25 | 0.388 | 1,597 | 75 | 0.0664 | 1,290 | est. | |
| Ours+BGE-5f | 0.389 | 1,586 | 75 | 0.0660 | 1,116 | est. | |
| Tools — AppWorld | Full-Ctx | 0.762 | 6,997 | 10 | 0.2463 | 447 | real |
| Row | Reranker | M@1 | p50 (ms) |
|---|---|---|---|
| Tools–ToolRet ( ) | Nova Micro | 0.682 | 750 |
| Nova Lite | 0.678 | 1,316 | |
| Cl. 3.5 Haiku | 0.496 | 11,196 | |
| Cl. Sonnet 4 | 0.722 | 3,775 | |
| Tools–ToolRet (full) | Nova Micro | 0.389 | 807 |
| Nova Lite | 0.395 | 1,453 |
| Row | Ranker LLM | Search &Pick | Ours +BM25 | Ours +BGE |
|---|---|---|---|---|
| Tools– ToolRet | Nova Micro | 0.332 | 0.388 | 0.389 |
| Qwen3 Next | 0.368 | 0.416 | 0.419 | |
| Mistral L3 | 0.365 | 0.408 | 0.415 | |
| Agents– ToolRet | Nova Micro | 0.341 | 0.418 | 0.412 |
| Qwen3 Next | 0.385 | 0.451 | 0.452 | |
| Mistral L3 | 0.388 | 0.451 | 0.458 |
| Benchmark | Cond. | M@1 | M@3 | R@ |
|---|---|---|---|---|
| AppWorld (332) | Raw | 0.782 | 0.884 | 0.420 |
| Enriched | 0.782 | 0.918 | 0.400 | |
| ToolRet (1,000) | Raw | 0.124 | 0.137 | 0.135 |
| Enriched | 0.125 | 0.139 | 0.138 | |
| MCP Skills (859) | Raw | 0.929 | 0.977 | 0.988 |
| Enriched | 0.885 | 0.939 | 0.951 |
| Row | Metric | Regex | BM25 | BGE-5f | Ours+BM25 | Ours+BGE-5f | Ours+Titan |
|---|---|---|---|---|---|---|---|
| Tools — ToolRet | M@3 | 0.314 | 0.423 | 0.472 | 0.493 | 0.502 | 0.523 |
| M@5 | 0.354 | 0.464 | 0.520 | 0.523 | 0.539 | 0.558 | |
| MRR | 0.285 | 0.378 | 0.424 | 0.446 | 0.454 | 0.467 | |
| Tools — AppWorld | M@3 | 0.687 | 0.728 | 0.721 | 0.884 | 0.898 | 0.918 |
| M@5 | 0.755 | 0.837 | 0.823 | 0.898 | 0.932 | 0.946 | |
| MRR | 0.576 | 0.631 | 0.594 | 0.820 | 0.819 | 0.832 |
| Row | BM25 M@15 | BGE-5f M@15 | Titan M@15 | Ours+BM25 R@15 | Ours+BGE-5f R@15 |
|---|---|---|---|---|---|
| Tools — ToolRet | 0.549 | 0.618 | 0.625 | 0.485 | 0.517 |
| Tools — AppWorld | 0.952 | 0.966 | 0.993 | 0.262 | 0.261 |
| Agents — ToolRet | 0.569 | 0.626 | 0.616 | 0.508 | 0.538 |
| Agents — AppWorld | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| Skills — MCP | 0.991 | 0.992 | 0.994 | 0.951 | 0.992 |
| Input level | Raw | Enriched | R@15 raw enr. |
|---|---|---|---|
| Full description | 0.720 | 0.778 | |
| First-sentence hint | 0.685 | 0.776 | |
| Name-only | 0.085 | 0.341 |
| Source | Ours+Titan | S&Pick | ||
| Tools — ToolRet | ||||
| toolbench | 1,100 | 0.518 | 0.490 | |
| apigen | 1,000 | 0.702 | 0.611 | |
| toolace | 1,000 | 0.694 | 0.620 | |
| toolink | 497 | 0.579 | 0.348 | |
| apibank | 101 | 0.614 | 0.426 | |
| Row | Retriever | Standalone | Standalone | E2E |
|---|---|---|---|---|
| M@1 | R@15 | M@1 | ||
| Tools | BM25 | 0.311 | 0.549 | 0.388 |
| ToolBench-IR | 0.354 | 0.608 | 0.378 | |
| Titan V2 | 0.358 | 0.625 | 0.397 | |
| Agents | BM25 | 0.336 | 0.569 | 0.418 |
| ToolBench-IR | 0.362 | 0.596 | 0.381 |
| Metric | Four-signal minus two-signal |
|---|---|
| Match@1 | pp |
| Match@3 | pp |
| Recall@15 | pp |
LLM Agent Routing
LLM agent routing selects models, tools, skills, or collaboration workflows for each task or step to balance capability, cost, latency, and reliability.
See all 98 papers