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 j4flmao/agent-skills --skill rag-architecturegit clone --depth 1 https://github.com/j4flmao/agent-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/j4flmao/agent-skills/rag-architecture)<a href="https://agentmods.dev/skills/j4flmao/agent-skills/rag-architecture"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/rag-architecture/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/rag-architecture"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/rag-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00168 | $0.02295 |
| Opus 5.5 | $0.00067 | $0.00918 |
| Sonnet 5.5 | $0.00034 | $0.00459 |
| Haiku 4.5 | $0.00017 | $0.00230 |
Grade A, and why
llm-rag-retrieval-internals 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 today.
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.
How it starts
The opening of the file, as written. The whole thing — 155 lines — stays where its author put it; the contents beside it link to each section on GitHub.
RAG Retrieval Internals
Purpose
Retrieval quality caps RAG quality: the generator cannot use a passage that was never retrieved. This skill explains how approximate nearest neighbour (ANN) indexes trade recall for speed and memory, how to tune them, and how to build the repo-standard pipeline: hybrid retrieval (dense + BM25), fusion, cross-encoder reranking, and measured end-to-end evaluation.
Agent Protocol
Trigger
"HNSW", "IVF", "product quantization", "efSearch", "nprobe", "ANN recall", "hybrid search", "reciprocal rank fusion", "reranker", "Self-RAG", "DSPy".
Input Context
- Corpus size (vectors), embedding dimension, update rate.
- Latency SLO, memory budget, required recall@k.
- Current pipeline and failure examples (missed passages, wrong answers).
Output Artifact
Index choice and parameters, hybrid/rerank pipeline, evaluation plan with retrieval and answer metrics.
Response Format
Corpus: {N} vectors × {d} dims Memory budget: {GB}
Index: {HNSW|IVF-Flat|IVF-PQ|flat} params: {M, efConstruction, efSearch | nlist, nprobe, m, nbits}
Hybrid: dense top-{k1} + BM25 top-{k2} -> RRF(k=60) -> rerank top-{n}
Metrics: recall@{k} vs exact, nDCG@{n}, answer faithfulness
Completion Criteria
- ANN recall measured against exact (flat) search on a sample.
- Hybrid retrieval and reranking in place (repo rule).
- Chunking is structure-aware or parent-child, not blind fixed-size (repo rule).
- Labeled eval set for retrieval and generation.
Index Families
| Index | Memory | Build | Query | Updates | Use when |
|---|---|---|---|---|---|
| Flat (exact) | N·d·4 B | None | O(N·d) | Trivial | < ~100k vectors, ground truth |
| HNSW | Vectors + graph (~M·2 links/node at layer 0) | Slow-ish | Sub-linear, empirically ~log N hops | Inserts OK, deletes awkward | Default for low-latency, high recall in RAM |
| IVF-Flat | Vectors + centroids | k-means training | Scans nprobe/nlist of data | Needs retraining on drift | Large corpora, batch updates |
| IVF-PQ | m·nbits/8 bytes per vector | Training | Fast table lookups (ADC) | Retrain on drift | Billion-scale, memory-bound |
| DiskANN-style | Graph on SSD | Slow | Few SSD reads | Varies | Larger than RAM |
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.
- today Changed · +99 lines · +168 tokens per session f8f87cd6a5fd
- 1mo ago First seen · 56 lines · 0 tokens per session scan A 816bcd328fa9
llm-rag-retrieval-internals is a skill published in the GitHub repository j4flmao/agent-skills (34 stars, last pushed today), licensed MIT. It adds 168 tokens to every session and 2,295 once invoked, about $0.0007 per session on Opus 5.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-30.
Other skills, from other repositories
rag-expert
Design retrieval-augmented generation systems: chunking, embeddings, vector and hybrid search, reranking, grounding and evaluation. Use when the user mentions RAG, retrieval, semantic search, embeddings, vector databases, pgvector, Chroma, Qdrant, Pinecone, chunking or reranking, wants an assistant answering over…
vector-databases
Vector database engineering covering Pinecone, Weaviate, Chroma, Qdrant, pgvector, and FAISS — including embedding pipeline design, HNSW index parameter tuning, hybrid dense+sparse (BM25) search, metadata filtering, namespace and tenant sharding, and RAG retrieval patterns for production knowledge systems.
rag
Use when building grounded Q&A over your own corpus — chunk, retrieve hybrid, rerank, ground, cite chunk ids, refuse when the sources fall short — or when the right document is retrieved but the answer is still wrong, invented, or unmeasured. NOT operating the store itself — collection schema, HNSW efsearch…
faiss
Facebook's library for efficient similarity search and clustering of dense vectors. Supports billions of vectors, GPU acceleration, and various index types (Flat, IVF, HNSW). Use for fast k-NN search, large-scale vector retrieval, or when you need pure similarity search without metadata. Best for high-performance…
faiss
Facebook's library for efficient similarity search and clustering of dense vectors. Supports billions of vectors, GPU acceleration, and various index types (Flat, IVF, HNSW). Use for fast k-NN search, large-scale vector retrieval, or when you need pure similarity search without metadata. Best for high-performance…
rag-retrieval-audit
Diagnose missing evidence in a RAG pipeline with labeled queries, chunk/trace inspection, Recall@K/MRR/nDCG, and stage-isolated failure taxonomy. Use when retrieval looks fine but answers fail, or when index/chunk/filter/rerank changes need before/after proof.