rag-retrieval
Retrieval-Augmented Generation patterns for grounded LLM responses. Use when building RAG pipelines, constructing context from retrieved documents, adding citations, or implementing hybrid search.
npx skills add majiayu000/claude-skill-registry --skill rag-retrieval --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# RAG Retrieval Combine vector search with LLM generation for accurate, grounded responses. ## Basic RAG Pattern ```python async def rag_query(question: str, top_k: int = 5) -> str: """Basic RAG: retrieve then generate.""" # 1. Retrieve relevant documents docs = await vector_db.search(question, limit=top_k) # 2. Construct context context = "\n\n".join([ f"[{i+1}] {doc.text}" for i, doc in enumerate(docs) ]) # 3. Generate with context response = await llm.chat([ {"role": "system", "content": "Answer using ONLY the provided context. " "If not in context, say 'I don't have that information.'"}, {"role": "user", "content": f"Context:\n{context}\n\nQuestion: {question}"} ]) return response.content ``` ## RAG with Citations ```python async def rag_with_citations(question: str) -> dict: """RAG with inline citations [1], [2], etc.""" docs = await vector_db.search(question, limit=5) context = "\n\n".join([ f"[{i+1}] {doc.text}\nSource: {doc.metadata['source']}" for i, doc in enumerate(docs) ]) response = await llm.chat([ {"role": "system", "content": "Answer with inline citations like [1], [2]. " "End with a Sources section."}, {"role": "user", "content": f"Context:\n{context}\n\nQuestion:
- Basic RAG Pattern
- RAG with Citations
- Hybrid Search (Semantic + Keyword)
- Context Window Management
- Context Sufficiency Check (2026 Best Practice)
- Key Decisions
- Common Mistakes
- Advanced Patterns
- Related Skills
- Capability Details
- retrieval-patterns
- hybrid-search
- chatbot-example
- pipeline-template
What does the rag-retrieval skill do?
Retrieval-Augmented Generation patterns for grounded LLM responses. Use when building RAG pipelines, constructing context from retrieved documents, adding citations, or implementing hybrid search.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill rag-retrieval --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.
