Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Build Retrieval-Augmented Generation (RAG) systems for LLM applications with vector databases and semantic search. Use when implementing knowledge-grounded AI, building document Q&A systems, or integrating LLMs with external knowledge bases.
.claude/skills/itamarzand88-rag-implementation/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-06 | ✗→✓ | ▲ Improved | 1% | 0% |
| case-10 | ✗→✓ | ▲ Improved | -12% | 0% |
| case-25 | ✗→✓ | ▲ Improved | 95% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 69% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 15% | 0% |
<!-- source: wshobson-rag-implementation — https://raw.githubusercontent.com/wshobson/agents/main/plugins/llm-application-dev/skills/rag-implementation/SKILL.md -->
Master Retrieval-Augmented Generation (RAG) to build LLM applications that provide accurate, grounded responses using external knowledge sources.
Purpose: Store and retrieve document embeddings efficiently
Options:
Purpose: Convert text to numerical vectors for similarity search
Models (2026): | Model | Dimensions | Best For | |-------|------------|----------| | voyage-3-large | 1024 | Claude apps (Anthropic recommended) | | voyage-code-3 | 1024 | Code search | | text-embedding-3-large | 3072 | OpenAI apps, high accuracy | | text-embedding-3-small | 1536 | OpenAI apps, cost-effective | | bge-large-en-v1.5 | 1024 | Open source, local deployment | | multilingual-e5-large | 1024 | Multi-language support |
Approaches:
Purpose: Improve retrieval quality by reordering results
Methods:
pythonfrom langgraph.graph import StateGraph, START, END from langchain_anthropic import ChatAnthropic from langchain_voyageai import VoyageAIEmbeddings from langchain_pinecone import PineconeVectorStore from langchain_core.documents import Document from langchain_core.prompts import ChatPromptTemplate from langchain_text_splitters import RecursiveCharacterTextSplitter from typing import TypedDict, Annotated class RAGState(TypedDict): question: str context: list[Document] answer: str # Initialize components llm = ChatAnthropic(model="claude-sonnet-4-6") embeddings = VoyageAIEmbeddings(model="voyage-3-large") vectorstore = PineconeVectorStore(index_name="docs", embedding=embeddings) retriever = vectorstore.as_retriever(search_kwargs={"k": 4}) # RAG prompt rag_prompt = ChatPromptTemplate.from_template( """Answer based on the context below. If you cannot answer, say so. Context: {context} Question: {question} Answer:""" ) async def retrieve(state: RAGState) -> RAGState: """Retrieve relevant documents.""" docs = await retriever.ainvoke(state["question"]) return {"context": docs} async def generate(state: RAGState) -> RAGState: """Generate answer from context.""" context_text = "\n\n".join(doc.page_content for doc in state["context"]) messages = rag_prompt.format_messages( context=context_text, question=state["question"] ) response = await llm.ainvoke(messages) return {"answer": response.content} # Build RAG graph builder = StateGraph(RAGState) builder.add_node("retrieve", retrieve) builder.add_node("generate", generate) builder.add_edge(START, "retrieve") builder.add_edge("retrieve", "generate") builder.add_edge("generate", END) rag_chain = builder.compile() # Use result = await rag_chain.ainvoke({"question": "What are the main features?"}) print(result["answer"])
Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 13,140 | 8,370 | -36% | 1 | 1 | 0% | 3,042 | 3,338 | +10% | 0 | 0 | — |
case-02 | fail→fail | 19,873 | 15,356 | -23% | 1 | 1 | 0% | 3,933 | 4,619 | +17% | 0 | 0 | — |
case-03 | pass→pass | 16,630 | 21,391 | +29% | 1 | 1 | 0% | 3,852 | 6,499 | +69% | 0 | 0 | — |
case-04 | pass→pass | 15,549 | 11,795 | -24% | 1 | 1 | 0% | 3,684 | 4,236 | +15% | 0 | 0 | — |
case-05 | pass→pass | 15,806 | 18,628 | +18% | 1 | 1 | 0% | 3,940 | 6,029 | +53% | 0 | 0 | — |
case-06 | fail→pass | 7,059 | 1,929 | -73% | 1 | 1 | 0% | 1,548 | 1,565 | +1% | 0 | 0 | — |
case-07 | pass→pass | 4,912 | 2,918 | -41% | 1 | 1 | 0% | 1,024 | 1,762 | +72% | 0 | 0 | — |
case-08 | pass→pass | 5,591 | 3,258 | -42% | 1 | 1 | 0% | 1,202 | 1,733 | +44% | 0 | 0 | — |
case-09 | pass→pass | 8,675 | 2,657 | -69% | 1 | 1 | 0% | 2,132 | 1,652 | -23% | 0 | 0 | — |
case-10 | fail→pass | 8,266 | 1,681 | -80% | 1 | 1 | 0% | 1,708 | 1,509 | -12% | 0 | 0 | — |
case-11 | pass→pass | 8,692 | 3,924 | -55% | 1 | 1 | 0% | 1,811 | 1,974 | +9% | 0 | 0 | — |
case-12 | pass→pass | 8,283 | 2,807 | -66% | 1 | 1 | 0% | 1,540 | 1,686 | +9% | 0 | 0 | — |
case-13 | pass→pass | 8,475 | 4,081 | -52% | 1 | 1 | 0% | 1,844 | 2,013 | +9% | 0 | 0 | — |
case-14 | pass→pass | 8,301 | 2,902 | -65% | 1 | 1 | 0% | 1,579 | 1,676 | +6% | 0 | 0 | — |
case-15 | pass→pass | 10,025 | 2,738 | -73% | 1 | 1 | 0% | 2,175 | 1,730 | -20% | 0 | 0 | — |
case-16 | pass→pass | 7,277 | 4,935 | -32% | 1 | 1 | 0% | 1,594 | 2,142 | +34% | 0 | 0 | — |
case-17 | pass→pass | 11,493 | 5,864 | -49% | 1 | 1 | 0% | 2,477 | 2,460 | -1% | 0 | 0 | — |
case-18 | pass→pass | 6,272 | 7,209 | +15% | 1 | 1 | 0% | 1,433 | 2,740 | +91% | 0 | 0 | — |
case-19 | pass→pass | 12,797 | 11,312 | -12% | 1 | 1 | 0% | 2,450 | 3,709 | +51% | 0 | 0 | — |
case-20 | pass→pass | 11,291 | 10,325 | -9% | 1 | 1 | 0% | 2,363 | 3,446 | +46% | 0 | 0 | — |
case-21 | pass→pass | 4,456 | 4,109 | -8% | 1 | 1 | 0% | 939 | 2,059 | +119% | 0 | 0 | — |
case-22 | pass→pass | 8,364 | 6,038 | -28% | 1 | 1 | 0% | 1,861 | 2,606 | +40% | 0 | 0 | — |
case-23 | pass→pass | 6,662 | 2,894 | -57% | 1 | 1 | 0% | 1,559 | 1,807 | +16% | 0 | 0 | — |
case-24 | pass→pass | 8,935 | 5,303 | -41% | 1 | 1 | 0% | 1,700 | 2,272 | +34% | 0 | 0 | — |
case-25 | fail→pass | 3,308 | 1,485 | -55% | 1 | 1 | 0% | 748 | 1,459 | +95% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted. The headline lift of +12 percentage points is the difference between those two pass rates over the 25 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.