Agent skill · Testing & QA

rag-patterns

Retrieval-Augmented Generation patterns and best practices. Implement chunking, embedding, retrieval, reranking, and generation pipelines. Use for knowledge-grounded AI, document QA, and semantic search applications.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill rag-patterns --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 9 KB
Bundled scripts: none
Path: skills/ai-llm/rag-patterns/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# RAG Patterns Expert guidance for Retrieval-Augmented Generation systems. ## Basic RAG Pipeline ```python from openai import OpenAI from sentence_transformers import SentenceTransformer import chromadb # Initialize client = OpenAI() embedder = SentenceTransformer('all-MiniLM-L6-v2') chroma = chromadb.Client() collection = chroma.create_collection("documents") # Index documents def index_documents(documents: list[str]): embeddings = embedder.encode(documents) collection.add( documents=documents, embeddings=embeddings.tolist(), ids=[f"doc_{i}" for i in range(len(documents))] ) # Retrieve and generate def rag_query(query: str, top_k: int = 5) -> str: # Embed query query_embedding = embedder.encode([query])[0] # Retrieve results = collection.query( query_embeddings=[query_embedding.tolist()], n_results=top_k ) # Format context context = "\n\n".join(results['documents'][0]) # Generate response = client.chat.completions.create( model="gpt-4o", messages=[ {"role": "system", "content": f"Answer based on context:\n\n{context}"}, {"role": "user", "content": query} ] ) return response.choices[0].message.content ``` ## Chunking Strategies ### Fixed Size Chunking ```python def chunk_fixed_size

What's inside
Steps it walks through
  1. Basic RAG Pipeline
  2. Chunking Strategies
  3. Fixed Size Chunking
  4. Semantic Chunking
  5. Sentence-Based Chunking
  6. Document Structure Chunking
  7. Embedding Strategies
  8. Hybrid Embeddings
  9. Multi-Vector Embeddings
  10. Retrieval Strategies
  11. Query Expansion
  12. HyDE (Hypothetical Document Embeddings)
  13. Reranking
  14. Cross-Encoder Reranking
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the rag-patterns skill do?

Retrieval-Augmented Generation patterns and best practices. Implement chunking, embedding, retrieval, reranking, and generation pipelines. Use for knowledge-grounded AI, document QA, and semantic search applications.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill rag-patterns --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going