home / skills / a5c-ai / babysitter / langchain-retriever
This skill enables building and optimizing LangChain retriever strategies for RAG workloads, improving recall and filtering across vector stores.
npx playbooks add skill a5c-ai/babysitter --skill langchain-retrieverReview the files below or copy the command above to add this skill to your agents.
---
name: langchain-retriever
description: LangChain retriever implementation with various retrieval strategies for RAG applications
allowed-tools:
- Read
- Write
- Edit
- Bash
- Glob
- Grep
---
# LangChain Retriever Skill
## Capabilities
- Implement various LangChain retriever types
- Configure vector store retrievers
- Set up multi-query retrievers for improved recall
- Implement contextual compression retrievers
- Design ensemble retrievers combining multiple strategies
- Configure self-query retrievers for structured filtering
## Target Processes
- rag-pipeline-implementation
- advanced-rag-patterns
## Implementation Details
### Retriever Types
1. **VectorStoreRetriever**: Basic similarity search
2. **MultiQueryRetriever**: Generates query variations
3. **ContextualCompressionRetriever**: Filters and compresses results
4. **EnsembleRetriever**: Combines multiple retrievers
5. **SelfQueryRetriever**: Structured metadata filtering
6. **ParentDocumentRetriever**: Returns parent chunks
### Configuration Options
- Search type (similarity, mmr, similarity_score_threshold)
- Number of documents to retrieve (k)
- Score thresholds
- Metadata filtering
- Compression settings
### Dependencies
- langchain
- langchain-community
- Vector store client
This skill provides a LangChain retriever implementation with multiple retrieval strategies tailored for RAG (retrieval-augmented generation) applications. It exposes configurable retriever types, vector store options, and ensemble patterns to improve recall and relevance. The goal is to make it straightforward to swap or combine retrievers to match different data and application needs.
The skill wires common LangChain retriever classes to your vector store client and exposes configuration for search type, k (number of docs), score thresholds, and metadata filters. It supports multi-query generation for broader recall, contextual compression to reduce noise, and ensemble patterns that merge results from multiple retrievers. Self-query and parent-document modes allow structured metadata filtering and returning original parent chunks for traceability.
Which retriever should I try first?
Begin with VectorStoreRetriever and tune k and search type, then add MultiQuery or compression if recall or noise is an issue.
How do I handle metadata filtering?
Use the SelfQueryRetriever to map structured filters to your vector store or apply metadata filters directly in the retriever config.