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.5 | $0.00012 | $0.01224 |
| Sonnet 5.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 1mo 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.
- 1mo 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 (112 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.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
memobase
A Russian-language skill for searching a local knowledge base built from documents and other sources such as web pages, YouTube, audio, and Obsidian notes.
knowledge-graph-creation
Build structured knowledge graphs from unstructured text by extracting entities, mapping relationships, generating graph triples, and visualizing the result. Use when the user requests knowledge graph creation or provides relevant inputs for this workflow.
context-retrieval
Retrieve relevant information from a knowledge base using semantic, keyword, or hybrid search to ground a query. Use when the task starts with a corpus or index that must be searched; use context-ranking when candidate chunks already exist and only need ordering.
context-ranking
Rank an existing set of context chunks by relevance, diversity, freshness, and utility. Use when retrieval has already produced candidates that must be scored or reranked; use context-retrieval when the source corpus still needs to be searched.
chromadb
Build and operate Chroma collections for RAG: PersistentClient vs HttpClient, embedding-function contracts, metadata/where filters, and dimension-safe upsert/query paths agents routinely break.
compact-yaml-frontmatter
Write concise YAML metadata for skills and documents with clear names, descriptions, and supported routing fields.