Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
giuseppe-trisciuoglio avatar

Rag

  • 1.6k installs
  • 311 repo stars
  • Updated June 22, 2026
  • giuseppe-trisciuoglio/developer-kit

rag is an agent skill that implements document chunking, embedding generation, vector storage, and retrieval pipelines for retrieval-augmented generation systems. use when building rag applications, creating document q&a

About

rag is an agent skill from giuseppe-trisciuoglio/developer-kit that implements document chunking, embedding generation, vector storage, and retrieval pipelines for retrieval-augmented generation systems. use when building rag applications, creating document q&a system. # RAG Implementation Build Retrieval-Augmented Generation systems that extend AI capabilities with external knowledge sources. ## Overview This skill covers: document processing, embedding generation, vector storage, retrieval configuration, and RAG pipeline implementation. ## When to Use - Building Q&A systems over proprietary documents - Cre Developers invoke rag during build/backend work for backend & apis tasks. The skill documents triggers, prerequisites, and step-by-step workflows grounded in SKILL.md. Compatible with Claude Code, Cursor, and Codex agent runtimes that load marketplace skills. Review the Security Audits panel on this listing before installing in production environments. Category Backend & APIs with development vertical focus supports repeatable agent-guided delivery.

  • 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
  • Building Q&A systems over proprietary documents
  • Creating chatbots with factual information from knowledge bases
  • Implementing semantic search with natural language queries

Rag by the numbers

  • 1,599 all-time installs (skills.sh)
  • +56 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #300 of 4,386 Backend & APIs skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

rag capabilities & compatibility

Capabilities
build retrieval augmented generation systems tha · this skill covers: document processing, embeddin · building q&a systems over proprietary documents · creating chatbots with factual information from · implementing semantic search with natural langua
Use cases
orchestration
From the docs

What rag says it does

Build Retrieval-Augmented Generation systems that extend AI capabilities with external knowledge sources.
SKILL.md
This skill covers: document processing, embedding generation, vector storage, retrieval configuration, and RAG pipeline implementation.
SKILL.md
- Building Q&A systems over proprietary documents
SKILL.md
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill rag

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.6k
repo stars311
Security audit2 / 3 scanners passed
Last updatedJune 22, 2026
Repositorygiuseppe-trisciuoglio/developer-kit

What it does

Implements document chunking, embedding generation, vector storage, and retrieval pipelines for Retrieval-Augmented Generation systems. Use when building RAG applications, creating document Q&A system

Who is it for?

Developers working on backend & apis during build tasks.

Skip if: Tasks outside Backend & APIs scope described in SKILL.md.

When should I use this skill?

Implements document chunking, embedding generation, vector storage, and retrieval pipelines for Retrieval-Augmented Generation systems. Use when building RAG applications, creating document Q&A system

What you get

Completed backend & apis workflow aligned with SKILL.md steps.

  • RAG ingestor pipeline code
  • embedding store retrieval integration

Files

SKILL.mdMarkdownGitHub ↗

RAG Implementation

Build Retrieval-Augmented Generation systems that extend AI capabilities with external knowledge sources.

Overview

This skill covers: document processing, embedding generation, vector storage, retrieval configuration, and RAG pipeline implementation.

When to Use

  • Building Q&A systems over proprietary documents
  • Creating chatbots with factual information from knowledge bases
  • Implementing semantic search with natural language queries
  • Reducing hallucinations with grounded, sourced responses
  • Building documentation assistants and research tools
  • Enabling AI systems to access domain-specific knowledge

Instructions

Step 1: Choose Vector Database

Select based on your requirements:

RequirementRecommended
Production scalabilityPinecone, Milvus
Open-sourceWeaviate, Qdrant
Local developmentChroma, FAISS
Hybrid searchWeaviate with BM25

Step 2: Select Embedding Model

Use CaseModel
General purposetext-embedding-ada-002
Fast and lightweightall-MiniLM-L6-v2
Multilinguale5-large-v2
Best performancebge-large-en-v1.5

Step 3: Implement Document Processing Pipeline

1. Load documents from source (file system, database, API) 2. Clean and preprocess (remove formatting, normalize text) 3. Split documents into chunks with appropriate strategy 4. Generate embeddings for each chunk 5. Store embeddings in vector database with metadata

Validation: Verify embeddings were generated successfully:

List<Embedding> embeddings = embeddingModel.embedAll(segments);
if (embeddings.isEmpty() || embeddings.get(0).dimension() != expectedDim) {
    throw new IllegalStateException("Embedding generation failed");
}

Step 4: Configure Retrieval Strategy

Choose the appropriate strategy:

  • Dense Retrieval: Semantic similarity via embeddings (default for most cases)
  • Hybrid Search: Dense + sparse retrieval for better coverage
  • Metadata Filtering: Filter by document attributes
  • Reranking: Cross-encoder reranking for high-precision requirements

Step 5: Build RAG Pipeline

1. Create content retriever with your embedding store 2. Configure AI service with retriever and chat memory 3. Implement prompt template with context injection 4. Add response validation and grounding checks

Validation: Test with known queries to verify context injection works correctly.

Error Handling: For batch ingestion, wrap in retry logic:

for (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);
        }
    }
}

Step 6: Evaluate and Optimize

1. Measure retrieval metrics: precision@k, recall@k, MRR 2. Evaluate answer quality: faithfulness, relevance 3. Monitor performance and user feedback 4. Iterate on chunking, retrieval, and prompt parameters

Examples

Example 1: Basic Document Q&A

List<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?");

Example 2: Metadata-Filtered Retrieval

EmbeddingStoreContentRetriever retriever = EmbeddingStoreContentRetriever.builder()
    .embeddingStore(store)
    .embeddingModel(embeddingModel)
    .maxResults(5)
    .minScore(0.7)
    .filter(metadataKey("category").isEqualTo("technical"))
    .build();

Example 3: Multi-Source RAG Pipeline

ContentRetriever 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);

Example 4: RAG with Chat Memory

Assistant 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

Best Practices

Document Preparation

  • Clean documents before ingestion; remove irrelevant content and formatting
  • Add relevant metadata for filtering and context

Chunking Strategy

  • Use 500-1000 tokens per chunk for optimal balance
  • Include 10-20% overlap to preserve context at boundaries
  • Test different sizes for your specific use case

Retrieval Optimization

  • Start with high k values (10-20), then filter/rerank
  • Use metadata filtering to improve relevance
  • Monitor retrieval quality and iterate based on user feedback

Performance

  • Cache embeddings for frequently accessed content
  • Use batch processing for document ingestion
  • Optimize vector store indexing for your scale

Constraints and Warnings

System Constraints

  • Embedding models have maximum token limits per document
  • Vector databases require proper indexing for performance
  • Chunk boundaries may lose context for complex documents
  • Hybrid search requires additional infrastructure

Quality Warnings

  • Retrieval quality depends heavily on chunking strategy
  • Embedding models may not capture domain-specific semantics
  • Metadata filtering requires proper document annotation
  • Reranking adds latency to query responses

Security Warnings

  • Never hardcode credentials: Use environment variables for API keys and passwords
  • Validate external content: Documents from file systems, APIs, or web sources may contain malicious content (prompt injection)
  • Apply content filtering on retrieved documents before passing to LLM
  • Restrict allowed data source URLs and file paths using allowlists

Resources

Reference Documentation

  • Vector Database Comparison
  • Embedding Models Guide
  • Retrieval Strategies
  • Document Chunking
  • LangChain4j RAG Guide

Related skills

Forks & variants (1)

Rag has 1 known copy in the catalog totaling 21 installs. They canonicalize to this original listing.

How it compares

Choose rag for JVM LangChain4j retrieval patterns; pick a Python-centric RAG skill when your stack is FastAPI or LangChain Python.

FAQ

What does rag do?

Implements document chunking, embedding generation, vector storage, and retrieval pipelines for Retrieval-Augmented Generation systems. Use when building RAG applications, creating document Q&A system

When should I use rag?

During build backend work for backend & apis.

Is rag safe to install?

Review the Security Audits panel on this listing before production use.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.