rag-retrieval

A skill for asking questions about a local document collection using semantic search, which finds meaning-related text rather than only exact words. It can generate answers from the retrieved documents and show their sources.

In plain words
What is it for?
Use it to search indexed documentation, answer questions about configuration or project knowledge, choose how many results to retrieve, and set a similarity threshold.
Why use it?
It helps you find relevant information when your question does not use the same wording as the documents.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/itmediatech/rag-cli/rag-retrieval
Any agent
npx skills add ItMeDiaTech/rag-cli --skill rag-retrieval
Clone the repo
git clone --depth 1 https://github.com/ItMeDiaTech/rag-cli

Made for: Claude Code, Codex.

Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 596 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00596
Opus 5 $0.00000 $0.00298
Sonnet 5 $0.00000 $0.00119
Haiku 4.5 $0.00000 $0.00060

Measured 2d ago against content hash 7cc1109e5ed7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rag-retrieval 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 2d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (__init__.py, retrieve.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

src/rag_cli_plugin/skills/rag-retrieval/SKILL.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RAG Retrieval Skill

Query your local document knowledge base using semantic search and get AI-powered answers.

Overview

This skill enables RAG (Retrieval-Augmented Generation) queries against your locally indexed documents. It uses semantic search to find relevant documents and generates answers using Claude Haiku.

Usage

/skill rag-retrieval "How to configure the API?"

Features

  • Semantic Search: Uses vector similarity to find relevant documents
  • Hybrid Retrieval: Combines vector search with keyword matching for better accuracy
  • Context-Aware Answers: Uses claude-haiku-4-5-20251001 to generate responses
  • Citation Support: Shows sources for generated answers
  • Performance Monitoring: Tracks query latency and accuracy

Arguments

  • query (required): Your question or search query
  • --top-k (optional): Number of documents to retrieve (default: 5)
  • --threshold (optional): Minimum similarity score (default: 0.7)
  • --mode (optional): Search mode - "hybrid", "vector", or "keyword" (default: "hybrid")

Examples

Basic Query

/skill rag-retrieval "What is the authentication process?"

Retrieve More Context

/skill rag-retrieval "How to handle errors?" --top-k 10

Vector-Only Search

/skill rag-retrieval "API rate limits" --mode vector

Configuration

The skill uses the following configuration from config/default.yaml:

  • retrieval.top_k: Default number of documents to retrieve
  • retrieval.hybrid_ratio: Balance between vector and keyword search (0.7 = 70% vector)
  • claude.model: LLM model for response generation
  • claude.max_tokens: Maximum response length

Performance

Typical latencies:

  • Vector search: <100ms
  • End-to-end response: <5 seconds
  • Indexing: ~0.5s per 100 documents

Requirements

  • Indexed documents in data/vectors/
  • Valid Anthropic API key in environment
  • At least 2GB RAM for vector operations

Troubleshooting

No Results Found

  • Ensure documents are indexed: python scripts/index.py --input data/documents
  • Lower the similarity threshold: --threshold 0.5
  • Try keyword mode if vector search fails

Read the full file on GitHub · 84 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 2d ago First seen · 84 lines · 0 tokens per session scan A 7cc1109e5ed7

Subscribe to this mod's changes

rag-retrieval is a skill published in the GitHub repository ItMeDiaTech/rag-cli (51 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 596 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.

Related

Other skills, from other repositories

opencode-ensemble

Use when coordinating multiple coding agents, delegating independent software work, managing OpenCode Ensemble teams, choosing teammate roles or models, reviewing teammate output, or deciding whether parallel execution is appropriate.

hueyexe/opencode-ensemble · 42 tokens

goal-loop

Loop engineering as gradient descent — a guided goal loop where an agent factory generates goal-specialized agents (implementer, verifier, diagnoser, judge) and iterates forward → loss → backward → update until the goal is provably met. Evidence is split into visible validation (the implementer's loss) and held-out…

JairoTorregrosa/jaiskills · 218 tokens

metaprompt

Generate a complete, ready-to-use prompt for a target model and harness. Triggers: metaprompt, generate a prompt for, write me a prompt, create a system prompt, prompt engineer this, optimize this prompt.

JairoTorregrosa/jaiskills · 48 tokens

codex-judge

Cross-provider LLM judge using Codex (GPT-5) to evaluate implementations written by Claude. Internal skill invoked by the insistir lead during the review loop. Not user-facing.

JairoTorregrosa/jaiskills · 42 tokens

constatar-verify

Run and interpret verification through the constatar engine — the 6-rung ladder, grounded evidence, and conformance auditing. Use when the user asks to verify work with constatar, run a constatar plan, or audit a constatar run.

JairoTorregrosa/jaiskills · 55 tokens

file-todos

File-based TODO lifecycle for tracking review findings, managing technical debt, and organizing work items. Each TODO is a standalone markdown file with YAML frontmatter, named by convention: {id}-{status}-{priority}-{description}.md. Status transitions drive the lifecycle: pending (created from review) -> ready…

JairoTorregrosa/jaiskills · 143 tokens