- Home
- Skills
- Agents & Orchestration
- Agentic RAG Vector Search Orchestrator
Works with the AI Agents you already use
Agentic RAG Vector Search Orchestrator
Build self-reflective RAG pipelines with hybrid search, query expansion, and semantic reranking.
$15
Agentic RAG Vector Search Orchestrator
Example session with this skill installed
Create a Python pipeline for hybrid RAG search that uses query expansion and a self-reflection step to prevent hallucinations.
- Read your context and instructions
- Compiled the agentic rag vector
I have generated a self-reflective hybrid RAG pipeline in Python. This implementation includes multi-query expansion, RRF-based hybrid search, and a cross-encoder reranking layer followed by a verification check.
Agentic RAG Pipeline Implementation
import os
from typing import List
from langchain.retrievers import EnsembleRetriever
from langchain_community.retrievers import BM25Retriever
from langchain_core.prompts import ChatPromptTemplate
from langchain_openai import OpenAIEmbeddings, ChatOpenAI
# 1. Multi-Query Expansion
def expand_query(query: str):
template = "Generate 3 different versions of this search query to capture different intents: {query}"
prompt = ChatPromptTemplate.from_template(template)
# Logic to return sub-queries...
return [query, "version 1", "version 2"]
# 2. Hybrid Retrieval with RRF
def get_hybrid_retriever(documents):
vectorstore = Chroma.from_documents(documents, OpenAIEmbeddings())
vector_retriever = vectorstore.as_retriever(search_kwargs={"k": 10})
bm25_retriever = BM25Retriever.from_documents(documents)
return EnsembleRetriever(
retrievers=[bm25_retriever, vector_retriever],
weights=[0.4, 0.6]
)
# 3. Self-Reflection Step
def verify_hallucination(context: str, answer: str):
check_prompt = f"Does the following context support the answer? \nContext: {context}\nAnswer: {answer}"
# Return verification score
pass
# Main Pipeline Execution...
Next steps
- Configure your
.envfile withOPENAI_API_KEYand any reranker endpoints. - Adjust the
EnsembleRetrieverweights to favor dense or sparse results based on your data type. - Run the automated evaluation suite in
evals/eval-suite.jsonto test the reflection logic.
Connects securely to your tools. The creator never sees your data.
About this skill
Standard RAG pipelines often fail when queries are vague or retrieved documents are noisy. This skill provides the architectural patterns and code needed to build self-reflective retrieval systems that verify their own accuracy. ## What it does - **Multi-Query Expansion** decomposes complex user prompts into sub-queries to improve recall. - **Hybrid Retrieval** combines dense vector embeddings with sparse BM25 keyword matching. - **Reciprocal Rank Fusion** merges search results using RRF for balanced relevance. - **Semantic Reranking** applies cross-encoders to top candidates to prioritize the most relevant context. - **Self-Reflection** implements hallucination checks to ensure retrieved context supports the final answer. ## How it works 1. **Define Architecture** by selecting between Python or TypeScript implementations for the retrieval pipeline. 2. **Configure Retrieval** to set up dense vector search and BM25 sparse matching parameters. 3. **Implement Reranking** by integrating cross-encoder models for candidate refinement. 4. **Verify Accuracy** by adding a reflection step that checks generated outputs against source context. ## Frameworks & tools This skill outputs production-ready code for Python and TypeScript environments. It is designed for integration with vector databases, embedding models, and cross-encoder rerankers like Cohere or local alternatives. ## Why this beats prompting it yourself Writing reliable Agentic RAG logic from scratch requires complex boilerplate for query decomposition and RRF merging. This skill provides a deterministic workflow that ensures every retrieval step is followed by semantic verification, reducing hallucinations without manual prompt tuning. ## Use cases - Build enterprise search tools that handle complex, multi-part questions. - Reduce hallucinations in customer support bots by adding self-reflection checks. - Improve document retrieval accuracy using hybrid search and semantic reranking. - Implement automated query rewriting for technical documentation search. ## Known limitations The skill focuses on pipeline architecture and logic rather than managing specific vector database infrastructure or hosting. Access is confined to the local project workspace.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.
Focuses on pipeline logic and code generation. Does not manage vector database hosting or cloud infrastructure. Requires external embedding and reranking models.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 days ago
- Software
- Zero global installationorelevated privileges required.
File System Read/Write (strictly scoped to current project workspace `./`).
Permissions
Target Use Cases: - Build an Agentic RAG system with hybrid search and reranking. - Implement self-reflective RAG with hallucination verification. - Design a retrieval pipeline combining BM25 and vector embeddings.