Skip to content
Back to skills

Retrieval Patterns Skill

ASecurity

```python from langchain.retrievers import EnsembleRetriever

  • 666 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 2, 2026
ai-agentspython

Security analysis

A100/100

Scanned September 2, 2026

npx -y skills add majiayu000/claude-skill-registry --skill retrieval-patterns-skill --agent claude-code

Installs 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 with every re-scan.

Security grade badge for Retrieval Patterns Skill
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-retrieval-patterns-skill/badge)](https://www.skillsdirectory.com/skills/majiayu000-retrieval-patterns-skill)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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"
)
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.