agentsclimarketplace

Rag pipeline

Skill goharabbas321/zeoel-framework/all-skills/rag-pipeline

23-agent AI development team for Claude Code, Cursor, and Gemini CLI. Multi-agent orchestration framework with strict TDD, sprint planning, 420+ skills, and automated QA/security/SEO audits. Stop vibe-coding — start shipping production-grade software.

Install
npx -y skills add goharabbas321/zeoel-framework --skill rag-pipeline

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Retrieval-Augmented Generation (RAG) pipeline patterns. Covers document ingestion, chunking, embeddings, vector search, and answer generation.

SKILL.md

4.2 KB, as published. Nobody here has run it

RAG Pipeline Patterns

Overview

Retrieval-Augmented Generation (RAG) combines retrieval of relevant documents with LLM generation to produce accurate, grounded answers. This skill covers the complete pipeline: document ingestion → chunking → embedding → vector storage → retrieval → generation.

When to Use

  • Building chatbots that answer questions about your documentation
  • Creating search over private/proprietary data
  • Reducing LLM hallucination by grounding responses in real data
  • Knowledge bases, support bots, internal tools

Pipeline Architecture

Documents → Chunking → Embedding → Vector DB → Retrieval → LLM → Answer

Implementation

1. Document Ingestion & Chunking

// Recursive character text splitter
function chunkDocument(text: string, options: { chunkSize: number; overlap: number }) {
  const { chunkSize, overlap } = options
  const chunks: string[] = []
  let start = 0

  while (start < text.length) {
    const end = Math.min(start + chunkSize, text.length)
    // Find natural break point (paragraph, sentence)
    let breakPoint = end
    if (end < text.length) {
      const lastParagraph = text.lastIndexOf('\n\n', end)
      const lastSentence = text.lastIndexOf('. ', end)
      breakPoint = Math.max(lastParagraph, lastSentence, start + chunkSize / 2)
    }

    chunks.push(text.slice(start, breakPoint).trim())
    start = breakPoint - overlap
  }

  return chunks
}

// Usage
const chunks = chunkDocument(document, { chunkSize: 512, overlap: 50 })

2. Embedding & Storage

import { OpenAI } from 'openai'

const openai = new OpenAI()

// Generate embeddings
async function embed(texts: string[]): Promise<number[][]> {
  const response = await openai.embeddings.create({
    model: 'text-embedding-3-small',
    input: texts,
  })
  return response.data.map(d => d.embedding)
}

// Store in Supabase (pgvector)
async function storeChunks(chunks: string[], metadata: any) {
  const embeddings = await embed(chunks)
  
  for (let i = 0; i < chunks.length; i++) {
    await supabase.from('documents').insert({
      content: chunks[i],
      embedding: embeddings[i],
      metadata: { ...metadata, chunkIndex: i },
    })
  }
}

3. Retrieval & Generation

async function ragQuery(question: string, topK = 5) {
  // 1. Embed the question
  const [questionEmbedding] = await embed([question])

  // 2. Vector similarity search
  const { data: results } = await supabase.rpc('match_documents', {
    query_embedding: questionEmbedding,
    match_threshold: 0.7,
    match_count: topK,
  })

  // 3. Build context from retrieved chunks
  const context = results.map(r => r.content).join('\n\n---\n\n')

  // 4. Generate answer with context
  const response = await openai.chat.completions.create({
    model: 'gpt-4o',
    messages: [
      {
        role: 'system',
        content: `Answer the user's question based ONLY on the following context. 
If the context doesn't contain the answer, say "I don't have information about that."

Context:
${context}`
      },
      { role: 'user', content: question },
    ],
  })

  return {
    answer: response.choices[0].message.content,
    sources: results.map(r => r.metadata),
  }
}

Guidelines

  1. Chunk size matters — 256-512 tokens is a good default, adjust based on content type
  2. Use overlap (50-100 chars) to preserve context across chunk boundaries
  3. Include metadata with each chunk (source URL, page number, section title)
  4. Use hybrid search (vector + keyword) for better recall
  5. Cite sources — return which documents were used to generate the answer
  6. Re-rank results — use a cross-encoder to reorder retrieved chunks by relevance

Anti-Patterns

  • ❌ Chunking too aggressively (losing context)
  • ❌ Not including metadata (can't cite sources)
  • ❌ Stuffing entire documents into context (exceeds token limits)
  • ❌ Skipping re-ranking (first retrieval results may not be the most relevant)
  • ❌ Not handling "I don't know" cases (leads to hallucination)

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.