param087/agent-ml-skills/rag-pipeline
Claude Code and agent skill by param087/agent-ml-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when building retrieval-augmented generation. Covers chunking strategy, embedding choice, vector stores, hybrid + reranking retrieval, prompt assembly, and evaluating retrieval and answer quality.
Install
npx vskill@latest install param087/agent-ml-skills/rag-pipelineSKILL.md
The same SKILL.md was published earlier as param087/agent-ml-skills/rag-pipeline.
RAG Pipeline
Overview
RAG grounds an LLM in your data by retrieving relevant context at query time. Most RAG quality problems are retrieval problems, not generation problems — if the right chunk isn't retrieved, no prompt can save the answer. Optimize retrieval first.
When to use
- The model must answer over private/large/changing documents.
- You need citations and reduced hallucination.
- Fine-tuning is overkill or data changes too often.
Pipeline stages
- Ingest & chunk documents.
- Embed chunks → vector store.
- Retrieve (dense + sparse) for a query.
- Rerank top candidates.
- Assemble prompt with context + citations.
- Generate and evaluate.
Chunking
- Start at ~500-1000 tokens with ~10-15% overlap.
- Prefer semantic/structural boundaries (headings, paragraphs) over fixed char counts.
- Keep metadata (source, title, section, URL) on every chunk for citations and filtering.
Embeddings & store
- Choose an embedding model by your domain + the MTEB leaderboard; match it at query and index time.
- Normalize vectors; use cosine similarity.
- Vector stores: pgvector (already have Postgres), Qdrant/Weaviate/Milvos (scale), FAISS (local/offline).
Hybrid retrieval + reranking (the biggest quality lever)
Prompt assembly
- Insert only the top-k reranked chunks; respect the context window.
- Instruct: "Answer only from the context; if it's not there, say you don't know."
- Require inline citations to chunk metadata so answers are auditable.
Evaluation (measure both halves)
- Retrieval: recall@k, MRR, hit-rate on a labeled query→chunk set.
- Answer: faithfulness/groundedness, answer-relevance, context-precision (e.g., RAGAS).
- Keep a fixed eval set; track scores via experiment-tracking as you tune chunking/k.
Pitfalls
- Dense-only retrieval misses exact keywords/IDs — add BM25.
- Chunks too large dilute relevance; too small lose context.
- Mismatched embedding models at index vs query time.
- No reranker → low precision context → confident wrong answers.
- No retrieval eval → you tune blind.
Hand-off
A retriever + generator with a measured retrieval/answer score that model-serving exposes behind an API.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/rag-pipeline/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/param087/agent-ml-skills/rag-pipeline)