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 moonlight-lupin/agent-skills --skill portable-rag-pergit clone --depth 1 https://github.com/moonlight-lupin/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/moonlight-lupin/agent-skills/portable-rag-per)<a href="https://agentmods.dev/skills/moonlight-lupin/agent-skills/portable-rag-per"><img src="https://agentmods.dev/badge/skills/moonlight-lupin/agent-skills/portable-rag-per/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/moonlight-lupin/agent-skills/portable-rag-per"><img src="https://agentmods.dev/badge/skills/moonlight-lupin/agent-skills/portable-rag-per.svg" alt="Reviewed on agentmods" width="80" 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.00029 | $0.03061 |
| Opus 5 | $0.00015 | $0.01530 |
| Sonnet 5 | $0.00006 | $0.00612 |
| Haiku 4.5 | $0.00003 | $0.00306 |
Grade A, and why
portable-rag-per-skill 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 7d 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 — 304 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Portable RAG: Per-Skill Standalone Index
The default library-rag setup uses a shared DB at ~/.hermes/library/rag_index.db
with an MCP server registered in config.yaml. This is good for a permanent library
but creates two problems for skills that should be self-contained:
- Not portable — moving the skill to another machine breaks the DB path
- MCP dependency — requires config.yaml registration, not self-contained
The Portable Pattern
Instead of the shared DB + MCP approach, create a standalone RAG index inside
the skill's own references/ directory:
Key Differences from Library RAG
| Aspect | Library RAG | Portable RAG |
|---|---|---|
| DB location | ~/.hermes/library/rag_index.db |
<skill>/references/rag_index.db |
| Path resolution | Hardcoded LIBRARY_ROOT |
Path(__file__).resolve().parent.parent |
| DB override | None | --db flag or env var |
| API key | .env only |
NVIDIA_API_KEY env var OR .env (OpenRouter key as fallback) |
| MCP server | Yes (config.yaml dependency) | No — import rag_query.search() directly |
| Chunker | Source-specific | Domain-specific (headings, sections, etc.) |
| Portable | No | Yes — zip the folder, drop on another machine, done |
Implementation: Path Resolution
# All paths resolve from the script's own location — no hardcoded paths
SKILL_DIR = Path(__file__).resolve().parent.parent
REFERENCES_DIR = Path(os.environ.get('SKILL_REFERENCES_DIR', SKILL_DIR / 'references'))
DB_PATH = Path(os.environ.get('SKILL_RAG_DB', REFERENCES_DIR / 'rag_index.db'))
ENV_PATH = os.environ.get('HERMES_ENV', os.path.expanduser('~/.hermes/.env'))
Implementation: API Key Loading
def load_api_key():
# Prefer NVIDIA NIM key; fall back to legacy OpenRouter key
for env_var in ('NVIDIA_API_KEY', 'OPENROUTER_API_KEY'):
key = os.environ.get(env_var)
if key:
return key
env_path = Path(ENV_PATH)
if env_path.exists():
for line in env_path.read_text().splitlines():
if line.startswith('#') or '=' not in line:
continue
name, _, value = line.partition('=')
if name.strip() in ('NVIDIA_API_KEY', 'OPENROUTER_API_KEY'):
return value.strip().strip('"').strip("'")
raise ValueError(f"No NVIDIA_API_KEY (or OPENROUTER_API_KEY) found in env or {ENV_PATH}")
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.
- 7d ago First seen · 304 lines · 29 tokens per session scan A 954ed92e2de1
portable-rag-per-skill is a skill published in the GitHub repository moonlight-lupin/agent-skills (62 stars, last pushed 4d ago), licensed MIT. It adds 29 tokens to every session and 3,061 once invoked, about $0.0001 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-04.
Other skills, from other repositories
mnemosyne-maintenance
Use when: upgrading Mnemosyne, diagnosing slow/hung consolidation (mnemosynesleep), fixing missing embeddings, or troubleshooting import/version mismatches.
rag-construction
Build RAG systems for construction knowledge bases. Create searchable AI-powered construction document systems.
vector-search
Implement semantic vector search for construction data. Build AI-powered search using embeddings and vector databases (Qdrant, ChromaDB) for intelligent querying of specifications, standards, and project documents.
semantic-search-cwicr
Semantic search in the DDC CWICR construction cost database using vector embeddings (BGE-M3, 1024-dim, per-language Qdrant collections). Find similar work items and resources for cost estimation across 8 national bases and 30 markets in 26 languages.
neurolink-guide
Guide for using the NeuroLink SDK and CLI. Invoke when users ask how to use neurolink, integrate AI providers, add MCP tools, configure RAG, set up memory, deploy servers, or work with multimodal content. Covers SDK, CLI, providers, tools, and enterprise features.
haystack
Build production search and NLP pipelines with Haystack. Pipeline DAG composition, document stores, retrievers, PromptBuilder (Jinja2), generators, evaluation, Hayhooks deployment. Use when building search pipelines or comparing NLP application frameworks. Do not use this skill for unrelated requests; route to the…