Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/tienenwu/fables/ragnpx skills add tienenwu/fables --skill raggit clone --depth 1 https://github.com/tienenwu/fablesWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/tienenwu/fables/rag)<a href="https://agentmods.dev/skills/tienenwu/fables/rag"><img src="https://agentmods.dev/badge/skills/tienenwu/fables/rag.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00115 | $0.01544 |
| Opus 5 | $0.00057 | $0.00772 |
| Sonnet 5 | $0.00023 | $0.00309 |
| Haiku 4.5 | $0.00012 | $0.00154 |
Grade B, and why
rag-playbook scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Instruction-override phrasingmediumPrompt injection
Text telling the model to disregard its earlier instructions or safety rules is the shape of a prompt injection, whoever wrote it.
- **Never splice retrieved docs directly into the prompt as trusted input**: document content may contain injections like "ignore previous instructions." Retrieved content is untrusted input — isolate it with markers and Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
How it starts
The opening of the file, as written. The whole thing — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.
🌐 繁體中文(canonical) · English mirror
RAG and Semantic Search Judgment Handbook
Currency: criteria reflect the early-2026 ecosystem. Anywhere a specific model/product name appears is marked "verified 2026-07, re-verify before selecting" — leaderboards and pricing move fast; don't treat a two-year-old ranking as current.
Core Principles
- Retrieval quality is the ceiling on generation quality: the LLM can only answer from the context you feed it. When the answer is wrong, first measure retrieval (is the correct answer even in the retrieved docs?) — don't first tune the prompt or swap in a bigger model; that's fixing the wrong layer.
- Tuning without an eval set is superstition: changing chunk size, swapping embeddings, adding rerank — each can make some queries better and others worse. Without a golden set to run recall@k, you're just gambling. The eval set comes before all optimization.
- Hybrid (BM25 + vector) is the default, not an advanced option: pure vector loses to keyword matching on proper nouns, model numbers, IDs, and codes. Unless you've already verified pure vector is enough, start from hybrid.
- First ask "do you even need RAG": if the documents fit in the context window → hand the full text straight to the LLM; if what you need to change is behavior/tone rather than facts → fine-tune; only "large body of facts, needs citation, gets updated" is RAG's turf. Don't use RAG for RAG's sake.
- Query side and index side must use the same embedding model: swapping models = re-embed everything. Computing similarity across two different models' vectors produces meaningless numbers, and it won't raise an error — the hardest silent failure to catch.
Where to Start
| Situation | Which path | Read first |
|---|---|---|
| Just starting, not yet sure whether to use RAG | Run the "do you need RAG" triage first, then discuss the pipeline | references/architecture-design.md §1 |
| Designing the whole pipeline / assigning each stage's responsibility | First draw ingest→chunk→embed→index→retrieve→rerank→generate, marking clearly what symptom each stage's error disguises itself as | references/architecture-design.md |
| Choosing vector store / embedding model / index / reranker | Use the decision tables; never introduce new infrastructure just because it "sounds professional" | references/tech-selection.md |
| Retrieval is inaccurate (finds nothing, finds wrong, bad ranking) | First locate whether it's chunk / language mismatch / should-be-hybrid, then act | references/retrieval-quality.md |
| Building an eval set / deciding whether a change can ship | golden set + recall@k baseline, run once before and once after the change | references/retrieval-quality.md §Evaluation |
| Fine in demo, blows up only in production | Run the release checklist line by line (latency p99, cost, injection, privilege escalation) | references/release-checklist.md |
What ships with it
5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 58 lines · 115 tokens per session scan B 4eb25a609a3f
rag-playbook is a skill published in the GitHub repository tienenwu/fables (4 stars, last pushed 1mo ago), licensed MIT. It adds 115 tokens to every session and 1,544 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it B with 1 finding (instruction-override phrasing). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
mem0-vercel-ai-sdk
Mem0 provider for Vercel AI SDK (@mem0/vercel-ai-provider). TRIGGER when: user mentions "vercel ai sdk", "@mem0/vercel-ai-provider", "createMem0", "retrieveMemories", "addMemories", "getMemories", "searchMemories", "mem0 vercel", "AI SDK provider", "AI SDK memory", or is using generateText/streamText with mem0. Also…
mem0-oss-to-platform
Plan and then execute a migration of a project from the mem0 open-source / self-hosted SDK (the local Memory class) to the mem0 Platform / hosted / managed SDK (the MemoryClient class). Use this whenever a developer wants to move, switch, or migrate their mem0 usage off OSS/self-hosted to the hosted API — e.g.…
docs-build
Build, preview, and validate the Uno documentation website (DocFX) locally — surface real content errors vs expected noise, drive rendered pages with Playwright, and validate external-doc commit bumps in importexternaldocs.ps1 before a PR. Use when working under doc/, editing articles/ markdown, bumping an external…
add-sample
Create a SamplesApp sample page with correct theming and attributes. Use when adding UI samples for controls.
speckit-taskstoissues
Convert existing tasks into actionable, dependency-ordered GitHub issues for the feature based on available design artifacts.
graph-mutation-plan
Cookbook for composing an applygraphmutations plan — stable entitykey patterns, the canonical label/edge vocabulary, evidence/invalidation/confidence discipline, and a worked example. Load this when building a non-trivial mutation plan.