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.00000 | $0.00907 |
| Opus 5 | $0.00000 | $0.00453 |
| Sonnet 5 | $0.00000 | $0.00181 |
| Haiku 4.5 | $0.00000 | $0.00091 |
Grade A, and why
rag-architecture 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 10d 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.
How it starts
The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Advanced RAG Architecture: Algorithmic Foundations and Compilational Paradigms
1. Vector Database Indexing Mechanics
1.1 Hierarchical Navigable Small World (HNSW) Graphs
HNSW operates as a multi-layered proximity graph where each layer constitutes a skip-list-esque representation of the vector space. The construction involves stochastic insertion with an exponentially decaying probability of promotion to higher layers.
- Search Complexity: O(log N)
- Routing Paradigm: Search initiates at the topmost layer $L$, identifying the local minimum (nearest neighbor) using greedy search. This node serves as the entry point for layer $L-1$. The search progresses iteratively down to layer 0 (containing all elements).
- Edge Heuristics: To prevent exponential edge growth and maintain small-world properties, neighborhood pruning is employed based on distance heuristics rather than strict K-NN, ensuring diverse connectivity.
1.2 Inverted File Index with Product Quantization (IVF-PQ)
IVF-PQ relies on two distinct mechanisms: space partitioning (IVF) and vector compression (PQ).
- IVF (Coarse Quantization): The vector space is partitioned into $K$ Voronoi cells using k-means clustering. A query is first routed to the nearest $nprobe$ centroids, drastically reducing the search space from $N$ to $N \times (nprobe/K)$.
- PQ (Fine Quantization): Sub-vector decomposition. A $D$-dimensional vector is split into $M$ sub-vectors of dimension $D/M$. Each sub-space is independently clustered into $2^B$ sub-centroids (typically $B=8$). Distances are approximated using pre-computed lookup tables (Asymmetric Distance Computation), enabling exhaustive search within Voronoi cells at high throughput.
2. Dynamic Retrieval Paradigms: Self-RAG and DSPy
2.1 Self-RAG (Self-Reflective Retrieval-Augmented Generation)
An LM is explicitly trained (or prompted) to output reflection tokens alongside the generative sequence.
- [Retrieve] Token: Determines necessity of exogenous context (on-demand retrieval).
- [ISREL] Token: Evaluates the relevance of retrieved passages to the context.
- [ISSUP] Token: Verifies if the generated proposition is directly entailed by the retrieved passage, preventing hallucination.
- [ISUSE] Token: Assesses overall utility. Inference involves a critique-guided decoding strategy where trajectories with optimal reflection token probabilities are prioritized.
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.
- 10d ago First seen · 56 lines · 0 tokens per session scan A 816bcd328fa9
rag-architecture is a skill published in the GitHub repository j4flmao/agent-skills (22 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 907 tokens. 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
agent-platform-rag-engine-management
Manage and query Agent Platform RAG Engine Corpora and retrieve grounded contexts using the Google GenAI SDK. Use when listing RAG corpora or files, inspecting a corpus, retrieving contexts, or generating content grounded in a RAG corpus. Do not use for standard database queries (use SQL/Spanner skills), Google…
llm-app-patterns
Production-ready patterns for building LLM applications. Covers RAG pipelines, agent architectures, prompt IDEs, and LLMOps monitoring. Use when designing AI applications, implementing RAG, building agents, or setting up LLM observability.
9router-embeddings
Generate vector embeddings via 9Router /v1/embeddings using OpenAI / Gemini / Mistral / Voyage / Nvidia / GitHub embedding models for RAG, semantic search, similarity. Use when the user wants embeddings, vectors, RAG, semantic search, or to embed text.
azure-search-documents-dotnet
Azure AI Search SDK for .NET (Azure.Search.Documents). Use for building search applications with full-text, vector, semantic, and hybrid search. Covers SearchClient (queries, document CRUD), SearchIndexClient (index management), and SearchIndexerClient (indexers, skillsets). Triggers: "Azure Search .NET"…
browserwing-admin
Manage and operate BrowserWing — an intelligent browser automation platform. Install dependencies, configure LLM, create/manage/execute automation scripts, use AI-driven exploration to generate scripts, browse the script marketplace, and troubleshoot issues.
embedding-strategies
Select and optimize embedding models for semantic search and RAG applications. Use when choosing embedding models, implementing chunking strategies, or optimizing embedding quality for specific domains.