一键导入
agentic-rag-routing
Route each query to the right retrieval strategy, data source, or tool with an LLM-driven router.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Route each query to the right retrieval strategy, data source, or tool with an LLM-driven router.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use this skill when building, debugging, or improving Retrieval-Augmented Generation systems, including chunking, vector database selection, hybrid search, reranking, multimodal RAG, code documentation RAG, retrieval latency, and production RAG architecture.
Chunk nested documents into parent-child levels so retrieval can move from broad sections to fine-grained passages.
Use semantic boundaries and embedding similarity to chunk text for higher-relevance retrieval.
Route RAG chunking decisions across semantic, hierarchical, sliding-window, contextual-header, and framework-selection strategies.
Use overlapping windows to preserve context across chunk boundaries while controlling retrieval size.
Reduce retrieval latency with caching, batching, and index-level optimization.
| name | agentic-rag-routing |
| title | Agentic RAG Routing |
| description | Route each query to the right retrieval strategy, data source, or tool with an LLM-driven router. |
| allowed-tools | ["Read","Grep","Glob","Bash"] |
| category | rag-agents |
| tags | ["routing","tool-use","query-classification","agentic-rag"] |
Agentic routing puts a decision step in front of retrieval: the agent classifies the query and chooses whether to retrieve, which source or index to hit, and which tool to call. This turns a one-size-fits-all pipeline into one that adapts per query.
Different queries need different handling. A definitional question, a multi-hop question, and a live-data question all fail under a single fixed retrieval path. Without routing, the pipeline over-retrieves for simple queries and under-serves complex ones.
Enumerate the concrete routes available, such as no-retrieval, vector search, keyword search, web search, or a structured-data tool.
Why: A router can only choose from routes you have defined; an open-ended router is unpredictable and hard to evaluate.
Use an LLM or a lightweight classifier to map each query to a route, returning a structured decision rather than free text.
Why: Structured routing decisions are testable and can be logged, replayed, and evaluated.
Define a default route for low-confidence decisions and cap how many tools or hops a single query may trigger.
Why: Guardrails prevent runaway tool loops and keep latency and cost bounded.
For patterns, see the LangGraph agentic RAG guide and the LlamaIndex router query engine.