Agent skill · AI & Agents

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.

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

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

Facts
Files in the skill folder: 2
SKILL.md size: 7 KB
Bundled scripts: none
Version: 1.0.0
Declared author: SkillForge
Path: skills/ai-llm/rag-retrieval/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 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:

What's inside
Steps it walks through
  1. Basic RAG Pattern
  2. RAG with Citations
  3. Hybrid Search (Semantic + Keyword)
  4. Context Window Management
  5. Context Sufficiency Check (2026 Best Practice)
  6. Key Decisions
  7. Common Mistakes
  8. Advanced Patterns
  9. Related Skills
  10. Capability Details
  11. retrieval-patterns
  12. hybrid-search
  13. chatbot-example
  14. pipeline-template
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
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.

Keep going