Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Implements document chunking, embedding generation, vector storage, and retrieval pipelines for Retrieval-Augmented Generation systems. Use when building RAG applications, creating document Q&A systems, or integrating AI with knowledge bases.
.claude/skills/giuseppe-trisciuoglio-rag/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -2% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 10% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 9% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 24% | 0% |
| case-20 | ✓→✗ | ▼ Worse | 19% | 0% |
Build Retrieval-Augmented Generation systems that extend AI capabilities with external knowledge sources.
This skill covers: document processing, embedding generation, vector storage, retrieval configuration, and RAG pipeline implementation.
Select based on your requirements:
| Requirement | Recommended | |-------------|-------------| | Production scalability | Pinecone, Milvus | | Open-source | Weaviate, Qdrant | | Local development | Chroma, FAISS | | Hybrid search | Weaviate with BM25 |
| Use Case | Model | |----------|-------| | General purpose | text-embedding-ada-002 | | Fast and lightweight | all-MiniLM-L6-v2 | | Multilingual | e5-large-v2 | | Best performance | bge-large-en-v1.5 |
Validation: Verify embeddings were generated successfully:
javaList<Embedding> embeddings = embeddingModel.embedAll(segments); if (embeddings.isEmpty() || embeddings.get(0).dimension() != expectedDim) { throw new IllegalStateException("Embedding generation failed"); }
Choose the appropriate strategy:
Validation: Test with known queries to verify context injection works correctly.
Error Handling: For batch ingestion, wrap in retry logic:
javafor (Document doc : documents) { int attempts = 0; while (attempts < 3) { try { store.add(embeddingModel.embed(doc).content(), doc.toTextSegment()); break; } catch (EmbeddingException e) { attempts++; if (attempts == 3) throw new RuntimeException("Failed after 3 retries", e); } } }
javaList<Document> documents = FileSystemDocumentLoader.loadDocuments("/docs"); InMemoryEmbeddingStore<TextSegment> store = new InMemoryEmbeddingStore<>(); EmbeddingStoreIngestor.ingest(documents, store); DocumentAssistant assistant = AiServices.builder(DocumentAssistant.class) .chatModel(chatModel) .contentRetriever(EmbeddingStoreContentRetriever.from(store)) .build(); String answer = assistant.answer("What is the company policy on remote work?");
javaEmbeddingStoreContentRetriever retriever = EmbeddingStoreContentRetriever.builder() .embeddingStore(store) .embeddingModel(embeddingModel) .maxResults(5) .minScore(0.7) .filter(metadataKey("category").isEqualTo("technical")) .build();
javaContentRetriever webRetriever = EmbeddingStoreContentRetriever.from(webStore); ContentRetriever docRetriever = EmbeddingStoreContentRetriever.from(docStore); List<Content> results = new ArrayList<>(); results.addAll(webRetriever.retrieve(query)); results.addAll(docRetriever.retrieve(query)); List<Content> topResults = reranker.reorder(query, results).subList(0, 5);
javaAssistant assistant = AiServices.builder(Assistant.class) .chatModel(chatModel) .chatMemory(MessageWindowChatMemory.withMaxMessages(10)) .contentRetriever(retriever) .build(); assistant.chat("Tell me about the product features"); assistant.chat("What about pricing for those features?"); // Maintains context
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 30,219 | 20,681 | -32% | 1 | 1 | 0% | 5,916 | 5,816 | -2% | 0 | 0 | — |
case-02 | pass→pass | 21,191 | 12,726 | -40% | 1 | 1 | 0% | 3,190 | 3,444 | +8% | 0 | 0 | — |
case-03 | fail→pass | 17,485 | 9,202 | -47% | 1 | 1 | 0% | 2,678 | 2,958 | +10% | 0 | 0 | — |
case-04 | pass→pass | 15,909 | 5,214 | -67% | 1 | 1 | 0% | 2,548 | 2,403 | -6% | 0 | 0 | — |
case-05 | pass→pass | 16,590 | 6,526 | -61% | 1 | 1 | 0% | 2,679 | 2,632 | -2% | 0 | 0 | — |
case-06 | fail→pass | 13,466 | 7,317 | -46% | 1 | 1 | 0% | 2,196 | 2,398 | +9% | 0 | 0 | — |
case-07 | fail→pass | 17,070 | 11,126 | -35% | 1 | 1 | 0% | 2,673 | 3,310 | +24% | 0 | 0 | — |
case-08 | pass→pass | 14,405 | 8,968 | -38% | 1 | 1 | 0% | 2,285 | 3,037 | +33% | 0 | 0 | — |
case-09 | pass→pass | 9,934 | 2,770 | -72% | 1 | 1 | 0% | 1,642 | 1,929 | +17% | 0 | 0 | — |
case-10 | fail→fail | 30,004 | 13,026 | -57% | 1 | 1 | 0% | 2,390 | 3,496 | +46% | 0 | 0 | — |
case-11 | pass→pass | 13,158 | 7,565 | -43% | 1 | 1 | 0% | 2,550 | 2,931 | +15% | 0 | 0 | — |
case-12 | fail→fail | 16,913 | 9,714 | -43% | 1 | 1 | 0% | 2,839 | 3,201 | +13% | 0 | 0 | — |
case-13 | pass→pass | 14,821 | 10,636 | -28% | 1 | 1 | 0% | 2,904 | 3,711 | +28% | 0 | 0 | — |
case-14 | pass→pass | 29,389 | 13,357 | -55% | 1 | 1 | 0% | 2,805 | 4,173 | +49% | 0 | 0 | — |
case-15 | pass→pass | 14,598 | 9,013 | -38% | 1 | 1 | 0% | 2,262 | 2,993 | +32% | 0 | 0 | — |
case-16 | pass→pass | 12,639 | 8,276 | -35% | 1 | 1 | 0% | 1,881 | 2,825 | +50% | 0 | 0 | — |
case-17 | pass→pass | 28,889 | 17,041 | -41% | 1 | 1 | 0% | 2,669 | 4,206 | +58% | 0 | 0 | — |
case-18 | pass→pass | 15,528 | 13,288 | -14% | 1 | 1 | 0% | 2,642 | 3,661 | +39% | 0 | 0 | — |
case-19 | pass→pass | 10,582 | 5,674 | -46% | 1 | 1 | 0% | 1,668 | 2,461 | +48% | 0 | 0 | — |
case-20 | pass→fail | 20,260 | 13,140 | -35% | 1 | 1 | 0% | 3,269 | 3,894 | +19% | 0 | 0 | — |
case-21 | pass→pass | 7,618 | 6,926 | -9% | 1 | 1 | 0% | 1,424 | 2,808 | +97% | 0 | 0 | — |
case-22 | pass→pass | 12,556 | 11,368 | -9% | 1 | 1 | 0% | 1,865 | 3,384 | +81% | 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. 22 cases were attempted. The headline lift of +14 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
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.