Conditional RAG Agentic Skill
Route each request at runtime through exactly one of three retrieval strategies: lexical, semantic, or hybrid.
Slot Binding
Bind the slots as follows:
classifier: selectcomponent-classifier.rewriter: optionally selectcomponent-hyde-rewriter.lexical_retriever: selectcomponent-bm25-retriever.semantic_retriever: selectcomponent-vector-retriever.reranker: optionally selectcomponent-bge-reranker.generator: selectcomponent-grounded-generator.
Do not exchange the lexical and semantic Retriever bindings.
Routing
Call classifier first with the original query and routing constraints.
lexical: do not call the Rewriter. Send the original query only tolexical_retriever.semantic: if a Rewriter is bound, send its non-emptyrewritten_queryonly tosemantic_retriever; otherwise send the original query.hybrid: send the original query tolexical_retriever; send the optional rewritten query, or the original query when no Rewriter is bound, tosemantic_retriever; fuse the two ranked lists with reciprocal rank fusion.
Reject any classifier route other than lexical, semantic, or hybrid.
Evidence Safety
The Classifier result and Rewriter output control routing and retrieval only. They are never evidence documents.
Always use the original query for optional reranking and final generation. Pass only real documents returned by the Retriever slots to the Reranker and Generator.
Execution
Run scripts/workflow.py:run(request, components) after every required slot is bound. Record classification, rewriting, retrieval, fusion, reranking, and generation decisions in the returned trace.