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 commands/acaprino/daodan/rag-auditgit clone --depth 1 https://github.com/acaprino/daodanWrote 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/commands/acaprino/daodan/rag-audit)<a href="https://agentmods.dev/commands/acaprino/daodan/rag-audit"><img src="https://agentmods.dev/badge/commands/acaprino/daodan/rag-audit.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.00074 | $0.00572 |
| Opus 5 | $0.00037 | $0.00286 |
| Sonnet 5 | $0.00015 | $0.00114 |
| Haiku 4.5 | $0.00007 | $0.00057 |
Grade A, and why
rag-audit 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 yesterday.
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 — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.
RAG Audit
Analyze an existing RAG implementation and produce an actionable audit report.
Instructions
-
Identify RAG components in the codebase:
- Document ingestion/chunking code
- Embedding model usage
- Vector database configuration
- Retrieval/search logic
- Re-ranking (if any)
- Prompt construction for LLM generation
- Evaluation setup (if any)
-
Audit each component against best practices:
Chunking
- Chunk size appropriate for use case (400-512 tokens default)
- Overlap configured (10-20%)
- Document preprocessing handles tables, images, headers
- Chunking strategy matches document structure
Embeddings
- Model is current (not deprecated)
- Dimensions appropriate (not over-provisioned)
- Embeddings cached at ingestion (not re-computed)
Vector Database
- Payload indexes created on filtered fields
- Quantization enabled (INT8 minimum for production)
- HNSW parameters tuned (m >= 16, ef_construct >= 100)
- On-disk storage configured for large collections
Retrieval
- Hybrid search implemented (dense + sparse)
- Re-ranking applied (cross-encoder or Cohere Rerank)
- Metadata filtering for multi-tenancy/access control
- MMR or diversity mechanism to avoid duplicate results
Generation
- Context window usage efficient (not stuffing irrelevant chunks)
- Source attribution in responses
- Streaming enabled for user experience
Production
- Evaluation metrics in place (RAGAS or equivalent)
- Observability/tracing configured
- Semantic caching for repeat queries
- Error handling for embedding API failures
- Rate limiting and cost controls
Security
- Tenant isolation enforced via mandatory filters
- PII filtering at ingestion
- Input sanitization for prompt injection
- Output validation
- Generate report with:
- Current state assessment (what's implemented)
- Risk areas (what's missing or misconfigured)
- Priority improvements (ordered by impact)
- Code examples for each recommendation
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.
- yesterday First seen · 74 lines · 74 tokens per session scan A 6536910f6a7b
rag-audit is a command published in the GitHub repository acaprino/daodan (8 stars, last pushed yesterday), licensed MIT. It adds 74 tokens to every session and 572 once invoked, about $0.0004 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-09-05.
Other commands, from other repositories
rag-debug
Walk the 9-layer RAG failure diagnostic chain against a specific failing query.
rag-failure-trace
Capture a full RAG audit trace for a query — useful for debugging or seeding a regression test.
review-code
Review code for quality, security, and maintainability. Dispatches all relevant reviewer agents in parallel and merges findings by severity.
rag-debug
Debug RAG pipeline issues with systematic retrieval and generation analysis.
querying
Query documents from a search index using type-safe filters with support for pagination, sorting, field selection, scoring, and highlighting. Count matching documents efficiently without returning results.
agent
Add an AI agent / RAG backend (@convex-dev/agent) to the Convex app.