```python from langchain.retrievers import EnsembleRetriever
Scanned 9/2/2026
Install to Claude Code
npx -y skills add majiayu000/claude-skill-registry --skill retrieval-patterns-skill --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Retrieval Patterns Skill?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/majiayu000-retrieval-patterns-skill)More formats (shields.io, HTML) on the badges page.
---
name: retrieval-patterns
version: 1.0
triggers: ["hybrid search", "MMR", "reranking", "retrieval"]
---
# Retrieval Patterns SKILL
## 1. Hybrid Search (BM25 + Semantic)
```python
from langchain.retrievers import EnsembleRetriever
ensemble = EnsembleRetriever(
retrievers=[bm25_retriever, semantic_retriever],
weights=[0.5, 0.5]
)
```
## 2. MMR (Maximal Marginal Relevance)
```python
retriever = vector_store.as_retriever(
search_type="mmr",
search_kwargs={"k": 5, "lambda_mult": 0.5}
)
```
## 3. Cross-Encoder Reranking
```python
from langchain.retrievers.document_compressors import CrossEncoderReranker
compressor = CrossEncoderReranker(
model_name="cross-encoder/ms-marco-MiniLM-L-6-v2"
)
```
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!