/polymath-ai:rag-designfrom polymath-ai
Design a retrieval-augmented generation pipeline — chunking, embeddings, retriever, reranker, prompt assembly — with the right cuts for the use case.
Ships in polymath-ai. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Design a RAG pipeline. Output is the architecture plus the cuts you'd make first if quality is low.
Mode: analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked [TBD] or [VERIFY], never filled in.
Not this when: the whole corpus fits comfortably in the model's context window — then put it in the prompt with prompt caching and skip retrieval (fewer moving parts, no recall misses). For the eval harness, polymath-ai:eval-plan; for injection defenses, polymath-ai:llm-guardrails.
<source id="3">…</source>) so the model can cite. Repeat a one-line version of the question before the context if instructions depend on it.polymath-ai:llm-guardrails).polymath-ai:eval-plan for end-to-end quality. Don't deploy without a held-out set.RAG design: <use case>
Corpus shape: <e.g. 30k internal docs, mostly Markdown, monthly updates>
Pipeline:
Chunking: 600-token chunks, 120-token overlap. Split on Markdown headings.
Embedding: <provider> (one model, version pinned).
Index: pgvector + BM25 hybrid.
Retrieval: top 20 candidates per source.
Rerank: cross-encoder reranker, keep top 6.
Access: retrieval filtered by the caller's ACL groups (metadata filter).
Prompt: <source id="N">…</source> blocks first, question last.
Model instructed to cite [source N] and abstain if unanswered.
Freshness: nightly re-index of changed docs; deletes propagate within 24h.
First-quality-cut order (if eval is low):
1. Inspect 20 wrong-answer cases: did retrieval surface a relevant chunk?
2. If no — investigate chunking + embeddings.
3. If yes — investigate prompt + reranker.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mohammadbafkar/polymath --plugin polymath-ai6 skills in this plugin
/agent-designDesign an LLM agent — architecture (ReAct, plan-execute, reflexion), tool/function-calling contract, memory, multi-agent orchestration, and the stop/budget conditions./eval-planDesign an evaluation for an LLM feature — task type, dataset shape, automated vs human rubric, regression set, decision threshold./llm-cost-latencyCut LLM cost and latency — model routing/cascade, prompt caching, batching, streaming, context trimming, output-token control, and a per-request cost/latency budget.Other plugins' skills for the same job