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 skills add hajekim/agentic-design-patterns-skills --skill raggit clone --depth 1 https://github.com/hajekim/agentic-design-patterns-skillsWrote 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/hajekim/agentic-design-patterns-skills/rag)<a href="https://agentmods.dev/skills/hajekim/agentic-design-patterns-skills/rag"><img src="https://agentmods.dev/badge/skills/hajekim/agentic-design-patterns-skills/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.1 | $0.00421 | $0.04390 |
| Opus 5 | $0.00211 | $0.02195 |
| Sonnet 5 | $0.00084 | $0.00878 |
| Haiku 4.5 | $0.00042 | $0.00439 |
Grade A, and why
rag scanned grade A with 0 findings 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 8d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
Copies of this mod
1 near-identical copy found in the catalogue:
- rag — 100% identical, 3 lines differ
How it starts
The opening of the file, as written. The whole thing — 479 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Retrieval-Augmented Generation (RAG) Pattern
Overview
The Retrieval-Augmented Generation (RAG) Pattern grounds agent responses in external, up-to-date knowledge by retrieving relevant documents or data before generating a response. Rather than relying solely on knowledge baked into model weights (which has a training cutoff and may hallucinate), RAG agents dynamically fetch the most relevant context and use it to produce accurate, grounded responses.
Core Principle: Don't hallucinate what you can retrieve — anchor every response in verifiable, retrieved knowledge.
When This Skill Applies
Activate this pattern when:
- The agent needs domain-specific knowledge not in the base LLM's training
- Responses must be grounded in authoritative documents (legal, medical, technical)
- Information changes frequently and training data is stale
- Users need citations and sources for claims made
- Private or proprietary knowledge must be accessed securely
- Reducing hallucination is a critical requirement
Rule of thumb: If the answer exists in a document and you need it to be accurate and verifiable — use RAG.
RAG Architecture
Standard RAG Pipeline
Query → [Embedding] → Vector Search → Retrieved Chunks
↓
LLM + Retrieved Context
↓
Grounded Response
Advanced RAG Variants
| Variant | Description | Use Case |
|---|---|---|
| Naive RAG | Embed query → retrieve → generate | Simple Q&A |
| Advanced RAG | Query expansion, reranking, filtering | High-accuracy enterprise |
| Modular RAG | Pluggable retrieval strategies | Complex, multi-source |
| Agentic RAG | Agent decides when/what to retrieve | Dynamic reasoning |
| Graph RAG | Knowledge graph + vector retrieval | Complex entity relationships |
DEFINE → PLAN → ACTION Workflow
DEFINE
Map the knowledge retrieval requirements:
- What knowledge sources need to be indexed? (PDFs, databases, APIs, web)
- What query types will users ask? (factual, comparative, analytical)
- What is the required accuracy/hallucination tolerance?
- How frequently does the knowledge change? (indexing strategy)
- What metadata is available for filtering? (date, source, category)
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.
- 8d ago First seen · 479 lines · 421 tokens per session scan A e6c71900720c
rag is a skill published in the GitHub repository hajekim/agentic-design-patterns-skills (4 stars, last pushed 5mo ago), licensed MIT. It adds 421 tokens to every session and 4,390 once invoked, about $0.0021 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
ai-llm-application
Group skill: AI/LLM application — provider selection, app patterns, RAG, agents, prompts, evaluation, safety, and monitoring.
qdrant-edge
Expert guide for building applications with Qdrant Edge — the embedded, offline-capable vector search engine for edge devices (robots, kiosks, mobile phones, IoT, home assistants). Use this skill whenever the user mentions Qdrant Edge, qdrant-edge-py, EdgeShard, on-device vector search, offline vector search, embedded…
rag
This skill should be used when the user wants to "retrieval augmented generation", "RAG", "ground agent in documents", "knowledge base search", "vector search for agents", "semantic document retrieval", "augment LLM with external knowledge", "document QA", "knowledge grounding", "enterprise knowledge agent", "PDF…
ai-engineering-toolkit
6 production-ready AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching.
ai-ml
AI and machine learning workflow covering LLM application development, RAG implementation, agent architecture, ML pipelines, and AI-powered features.
arrowspace
Spectral vector search using graph Laplacian eigenstructure. Use when cosine/L2 similarity misses latent structure in your embeddings.