Agentic RAG Routing
Designs an agentic RAG architecture where an LLM agent acts as a dynamic router, semantically selecting the correct domain-specific vector database per query over registered retriever tools, with a s…
Designs an agentic RAG architecture where an LLM agent acts as a dynamic router, semantically selecting the correct domain-specific vector database per query over registered retriever tools, with a strict three-layer separation and an explicit overlapping-domains limitations analysis. Use when build
What this Claude Code skill does
Designs an agentic RAG architecture where an LLM agent acts as a dynamic router, semantically selecting the correct domain-specific vector database per query over registered retriever tools, with a strict three-layer separation and an explicit overlapping-domains limitations analysis. Use when building, debugging, or extending a multi-database RAG pipeline where static routing is insufficient or a
Agentic RAG Routing is a packaged skill for Claude Code: a SKILL.md plus references and a runnable test that drops into .claude/skills/, so your agent can run this workflow reliably instead of you re-explaining it each time. Install it via MCP, run it as a CLI, or fork it into your own.
Inside the SKILL.md
<h1>Agentic RAG Routing (LLM Agent as Dynamic Router)</h1>
<h2>Why This Is Hard</h2>
<p>When a RAG system contains multiple domain-specific vector databases, static
code cannot reliably decide which database to query for a given input — leading
to irrelevant context and degraded answers. Three failure modes make naive
approaches unworkable:</p>
<ul>
<li><strong>Brittle keyword routing.</strong> Hand-written if/else logic fails to generalize
to paraphrased or semantically equivalent queries and needs constant
maintenance as domains grow.</li>
<li><strong>Single combined database.</strong> Merging all domains into one vector store makes
unrelated chunks compete for top-k slots, diluting the most relevant context.</li>
<li><strong>Wrong-database routing.</strong> A query dispatched to the wrong domain returns
low-relevance context that actively misleads the generation step into a
confidently wrong answer.</li>
</ul>
<p>The hard part is not retrieval — it is the <em>runtime decision</em> of where to
retrieve from, made on the semantic content of a query that may not contain any
of the keywords a static router would look for.</p>
<hr />
<h2>Core Framework: Retriever-Tool Agent Routing</h2>
<p>Each domain-specific vector database is wrapped as a <strong>named retriever tool</strong>.
…
Frequently asked questions
When should I use agentic-rag-routing?
When should I NOT use agentic-rag-routing?
Related skills
Build a skill like this from your own source
Paste a YouTube link, an article, a PDF — or describe your workflow. Loreto turns it into a production-ready Claude Code skill in minutes.