Source-linked AI summary
SchemaRouter: Field-Aware Tool Routing for Efficient Heterogeneous Agentic RAG
Yong-eun Cho
TL;DR
Heterogeneous agentic RAG must route queries across tools, endpoints, parameters, and response fields without the cost of exposing complete schemas or the incompleteness of vector-only selection. SchemaRouter uses a schema graph with field-aware, alias-supported deterministic projection to produce executable, provenance-annotated plans. It matches top answer accuracy while reducing retrieval and latency costs and improving metadata grounding, although evaluation relies on a strong same-family reader and a single benchmark run.
Problem
Heterogeneous agentic RAG systems must select tools, endpoints, parameters, and response fields, while prompt-all inflates routing cost and vector-only retrieval may produce invalid or incomplete plans.
Method
SchemaRouter represents tools and their fields, concepts, units, provenance, and licenses in a schema graph, combining small-LLM intent extraction with deterministic field projection and concept aliases.
Results
SchemaRouter reaches the top answer-accuracy group while leading or tying on efficiency and metadata fidelity; recall-preserving routing achieves 0.71 answer accuracy and 62% provenance/license grounding.
Takeaways & Limitations
Retrieved-context tokens, latency, and metadata fidelity matter more than minimizing selected-field count, because recall-preserving projection maintains accuracy while field-count parsimony sacrifices it.
Takeaways & Limitations
Answer-accuracy results come from a single run with overlapping bootstrap confidence intervals, and a fully blinded cross-family judge over the entire benchmark remains future work.
Abstract
from arXiv · showhide
Heterogeneous agentic retrieval-augmented generation (RAG) systems increasingly orchestrate external APIs, internal databases, vector stores, and graph stores. Exposing all tool descriptions to an LLM agent, or selecting tools only by vector similarity, causes two costly failures: over-fetching, which increases payload size, token use, and latency, and under-fetching, which omits fields needed to answer the query. We present SchemaRouter, a lightweight routing layer that represents tools, endpoints, parameters, response fields, domain concepts, units, provenance, and license policies as a schema graph. Given a query, SchemaRouter emits an executable tool plan specifying which tools to call and which fields to retrieve. A small LLM extracts intent, concepts, and source constraints, while field selection is deterministic over the graph through intent-group projection and concept-field matching with an alias layer. On a materials-science benchmark of 110 queries, SchemaRouter achieves answer accuracy of 0.71, matching fetch-everything within overlapping confidence intervals and exceeding prompt-all's 0.66, though their intervals overlap. It uses 227 retrieved-context tokens versus 2,066 for fetch-everything and achieves 2.7x lower end-to-end latency than prompt-all. It also obtains the best tool-exact rate of 0.93 and parameter validity of 1.0. SchemaRouter grounds provenance and license information in 62 percent of answers, compared with approximately 0 percent for all baselines. We also find that minimizing selected-field count is counterproductive: it reduces answer accuracy to 0.56 with negligible token savings, while recall-preserving projection restores top accuracy. SchemaRouter improves efficiency, schema-size-independent scaling, and verifiable provenance/license-grounded answering at competitive accuracy.
1 Introduction
SchemaRouter addresses heterogeneous agentic RAG routing by selecting executable tools and response fields rather than exposing entire schemas or relying only on vector similarity. It targets lower retrieval cost while preserving answer quality and supporting provenance-aware answering.
- Prompt-all inflates routing cost and can exceed context limits, while vector-only retrieval does not reliably produce executable plans with valid parameters and fields.
- The system is designed to fetch only needed tools and fields, reducing unnecessary data, context size, searches, tokens, and time while preserving answer quality.
- SchemaRouter represents tools, endpoints, parameters, response fields, concepts, and metadata in a schema graph for field-aware routing.The formulation selects at response-field granularity and uses aliases to bridge natural-language concepts with canonical schema fields.
- The evaluation measures planning quality alongside retrieved-context tokens, end-to-end latency, and final-answer accuracy.
- Recall-preserving routing reaches the top accuracy group at near-minimal context cost and grounds verifiable provenance and license information, while field-count minimization harms downstream accuracy.
2 Related Work
SchemaRouter extends tool-planning and schema-linking ideas to heterogeneous APIs by combining a schema graph with lightweight intent extraction and deterministic field selection. Its plans are executable, field-aware, and metadata-complete by construction.
- Related tool-use work: Prior tool-use systems evaluate API calling, whereas SchemaRouter additionally evaluates endpoint, parameter, and response-field selection and downstream RAG effects.
- Schema linking and structured tool calling: SchemaRouter generalizes schema linking from columns in one database to fields across heterogeneous APIs, with deterministic selection and unit, provenance, and license metadata.
- Schema graph: The schema graph connects tools, endpoints, parameters, fields, concepts, units, source types, licenses, field groups, and intents, and is frozen for reproducibility.
- Routing: A small LLM extracts intent, concepts, parameters, source constraints, and named tools before routing candidates and projecting response fields deterministically.
- Routing: Candidate ranking uses concept matches, schema priority, and fewest total fields, while aliases normalize concepts such as “bulk modulus” to canonical fields.
- Design properties: Plans remain valid, minimal, and metadata-complete because fields and parameters are drawn from the schema graph rather than generated freely.
5 Benchmark
The benchmark evaluates SchemaRouter and baselines on frozen, structured materials-science fixtures with planning and downstream RAG metrics. It covers heterogeneous tools and query categories while measuring both efficiency and answer quality.
- Benchmark setup: The frozen inventory contains 19 heterogeneous tools exposing 166 response fields, and the benchmark includes 110 queries across nine categories.
- Evaluation protocol: Gold plans are grounded in the frozen schema, while deterministic fixtures assign values to every field and use unrequested fields as distractors.
- Planning evaluation: Planning metrics include tool and field precision, recall, F1, parameter validity, executable-plan rate, over-fetch, and metadata completeness.
- Downstream evaluation: Downstream RAG evaluation reports answer accuracy, retrieved-context tokens, and end-to-end latency using an identical LLM judge with bootstrap confidence intervals.
6 Experiments
SchemaRouter preserves competitive answer accuracy while sharply reducing retrieved context and improving latency, provenance grounding, and license grounding. Experiments also show that recall-preserving field selection is preferable to minimizing field count, while scalability claims beyond the evaluated inventory remain analytical.
- 0.71 answer accuracy matches fetch-all within overlapping confidence intervals and exceeds prompt-all’s 0.66, though their intervals overlap.
- 227 retrieved-context tokens are 9× fewer than fetch-all, while end-to-end latency is approximately 2.7× lower than prompt-all.
- 62% of answers ground provenance and per-database license information, versus approximately 0% for baselines.The evaluation uses schema-sourced strings and a deterministic string check; schema-only license strings are unavailable from parametric knowledge.
- Prompt-all routing cost grows with inventory size, whereas SchemaRouter uses a schema-independent routing prompt; extrapolation beyond 19 tools is analytical, not measured.At 19 tools, the schema segment is approximately 1,260 tokens for prompt-all, while SchemaRouter’s fixed instruction is approximately 360 tokens.
- The LLM-judge accuracy values require caution because the judge is the same Qwen-3.5-122B family, although the trustworthiness gap is judge-independent.A hybrid review with an independent Claude-family model qualitatively confirmed the trustworthiness direction on a stratified sample of 40 answers; fully blinded cross-family judging remains future work.
- Recall-preserving field selection raises downstream accuracy from 0.56 to 0.71 while increasing retrieved-context tokens only from 188 to 227.The minimal-field point has over-fetch ratio 0.16 and field-F1 0.75, whereas the recall-preserving point has over-fetch ratio 0.46; both share identical tool selection.
7 Discussion and Error Analysis
SchemaRouter’s remaining answer errors arise from ambiguous tool selection and reader mistakes, while aliasing and recall-preserving projection resolve field-recall misses. Under a strong reader, precise and bloated retrievals achieve the same top accuracy, making efficiency and metadata fidelity more informative than over-fetching.
- Tool-selection misses on ambiguous entities and reader errors account for SchemaRouter’s residual answer errors.
- The alias layer plus recall-preserving intent-group projection resolve the field-recall misses that previously dominated the error decomposition.
- Under a strong reader, precise and bloated retrievals reach the same top accuracy, so over-fetching adds cost without improving accuracy.This equivalence may not hold for weaker readers, where context pollution could degrade accuracy.
- Tokens, latency, scalability, and metadata fidelity become the informative comparison axes when retrieval accuracy is equivalent.
8 Threats to Validity and Limitations
The evaluation’s statistical and experimental setup limits how broadly its absolute accuracy and fine-grained rankings should be interpreted. The authors emphasize cross-router comparisons under a controlled protocol and identify replication and realistic retrieval as open needs.
- N=110 with overlapping bootstrap 95% CIs prevents an answer-accuracy superiority claim among the top routers.The study reports only efficiency and trustworthiness advantages with non-overlapping intervals.
- Results come from a single run with scheduler nondeterminism, so fine-grained accuracy orderings remain unsupported.Multi-seed and multi-model replication remain future work.
- A strong 122B reader may mask context-pollution effects that weaker readers or prose retrieval could reveal.Over-fetching does not measurably degrade accuracy here except on ambiguous multi-source queries.
- Frozen structured fixtures control confounds and enable exact judging but understate context pollution in real unstructured document retrieval.Absolute accuracy is setup-specific; comparisons under the identical protocol are the intended interpretation.
- The materials-science benchmark uses author-constructed, partly template-generated gold plans with a single annotator.
9 Conclusion
SchemaRouter uses schema-aware, field-aware routing to retrieve only the tools and fields needed for scientific queries. In materials-science evaluation, it combines competitive accuracy with lower retrieval cost, latency, and stronger provenance and license grounding.
- ∼2.7× lower end-to-end latency than prompt-all supports more efficient routing at schema-independent scale.
- Minimizing field count reduces downstream accuracy to 0.56 at negligible token savings, whereas recall-preserving projection restores top accuracy.
Reproducibility
The paper releases its evaluation materials and frozen schema artifacts for reproducibility, while retaining the production schema-graph agent as proprietary. The released export preserves the schema signals used by SchemaRouter.
- The released package includes the evaluation harness, frozen 19-tool schema inventory, 110 benchmark queries with gold plans, deterministic fixtures, and router implementations.
- A documented single command sequence reproduces all paper results from the repository.
- The production Kuzu-backed schema-graph agent remains proprietary and unreleased.
- The frozen JSON export preserves nodes, edges, the alias layer, provenance, and license signals used by SchemaRouter.
Use of AI Tools
The authors used large language models as writing assistants for prose editing, LaTeX formatting, and consistency checking, while retaining responsibility for the research and substantive claims.
- Large language models assisted with prose editing, LaTeX formatting, and consistency checking during manuscript preparation.
- The authors conducted the problem formulation, method design, benchmark construction, experiments, analysis, interpretation, and citation verification.
A Ablation Detail
The ablations show that field projection controls field-level precision and over-fetch, while provenance metadata depends on the provenance layer; category results reveal strengths and limitations across query types.
- Ablation Detail: 0.16→0.73 over-fetch and 0.59→0.31 F1 follow removal of field projection, showing the collapse caused by disabling field-aware selection.Tool-exact and executable-plan rates remain preserved across variants, while field-level metrics deteriorate.
- Ablation Detail: 0 completeness results for provenance and license follow removal of the provenance layer, with no other metric change.The provenance layer attaches source-type and license metadata in the schema graph.
- Category-wise Results: SchemaRouter is strongest on provenance-sensitive queries and competitive on chemical, literature, and multi-field lookups.
- Category-wise Results: Ambiguous single-entity queries favor prompt-all because the concept–field matcher cannot determine the intended source without a name.
- Category-wise Results: Negative queries have Field F1=0 by construction, so executable-plan rate and tool accuracy are the meaningful evaluation signals.Both routers correctly return empty plans in most negative cases.
- Ablation Detail: 1.00 provenance and license completeness is achieved by full SchemaRouter, versus approximately 0 for every baseline.
C Routing-cost Scaling
Prompt-all routing cost grows with the tool inventory because it injects the entire schema, whereas SchemaRouter uses a fixed, schema-independent prompt and deterministic graph processing after query understanding.
- Routing-cost Scaling: ≈66 tokens per additional tool describes prompt-all’s routing-cost growth, measured at ≈1,260 tokens for the 19-tool inventory.The reported extrapolation is analytical and based on the measured per-tool cost.
- Routing-cost Scaling: O(1) inventory scaling characterizes SchemaRouter’s routing prompt, which contains a fixed instruction and the query rather than tool or field descriptions.
- Routing-cost Scaling: Prompt-all saturates practical context budgets past a few hundred tools, while SchemaRouter remains inventory-independent.
- Routing-cost Scaling: A small LLM outputs intent, domain concepts, parameters, target APIs, and source constraints as JSON for query understanding.
- Routing-cost Scaling: The remaining candidate selection, field projection, and metadata attachment operate deterministically on the schema graph.