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/hajekim/agentic-design-patterns-extension/ragnpx skills add hajekim/agentic-design-patterns-extension --skill raggit clone --depth 1 https://github.com/hajekim/agentic-design-patterns-extensionWrote 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-extension/rag)<a href="https://agentmods.dev/skills/hajekim/agentic-design-patterns-extension/rag"><img src="https://agentmods.dev/badge/skills/hajekim/agentic-design-patterns-extension/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.04391 |
| 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 6d 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.
This is a copy
100% identical to rag — 3 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 480 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.
- 6d ago First seen · 480 lines · 421 tokens per session scan A 98362dbec31e
rag is a skill published in the GitHub repository hajekim/agentic-design-patterns-extension (1 stars, last pushed 5mo ago), licensed MIT. It adds 421 tokens to every session and 4,391 once invoked, about $0.0021 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to rag, differing in 3 lines, and is treated as a copy.
Other skills, from other repositories
help
Overview of all available Pinecone skills and what a user needs to get started. Invoke when a user asks what skills are available, how to get started with Pinecone, or what they need to set up before using any Pinecone skill.
index
Use when the user wants to index their vault for semantic search, rebuild the RAG index, or says "index", "reindex", or "rebuild index".
assistant
Create, manage, and chat with Pinecone Assistants for document Q&A with citations. Handles all assistant operations - create, upload, sync, chat, context retrieval, and list. Recognizes natural language like "create an assistant from my docs", "ask my assistant about X", or "upload my docs to Pinecone".
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…
quickstart
Interactive Pinecone quickstart for new developers. Choose between two paths - Database (create an integrated index, upsert data, and query using Pinecone MCP + Python) or Assistant (create a Pinecone Assistant for document Q&A). Use when a user wants to get started with Pinecone for the first time or wants a guided…
cli
Guide for using the Pinecone CLI (pc) to manage Pinecone resources from the terminal. The CLI supports ALL index types (standard, integrated, sparse) and all vector operations — unlike the MCP which only supports integrated indexes. Use for batch operations, vector management, backups, namespaces, CI/CD automation…