Agent skill

RAG Deep Dive

by lyonzin in lyonzin/knowledge-rag

Three-step multi-tool workflow — search the corpus, fetch the most relevant document in full, then find similar documents.

MITAuto-check passedAI & LLM Engineering

Install RAG Deep Dive

skills CLI
$ npx skills add lyonzin/knowledge-rag --skill rag-deep-dive -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install lyonzin/knowledge-rag rag-deep-dive --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/lyonzin/knowledge-rag.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/workflow/rag-deep-dive .claude/skills/rag-deep-dive && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
rag-deep-dive
GitHub stars
292
Token cost
~1.6k tokens
SKILL.md length
473 words
Files
1
Skills in repo
10
Repo updated
First seen
Licence
MIT

At a glance

Three-step multi-tool workflow — search the corpus, fetch the most relevant document in full, then find similar documents.

  • Works in 3 steps: search_knowledge — find candidates → get_document — read the top match in full → search_similar — find related material
  • A single searchknowledge hit is not enough because the user asked a how does X work end to end
  • SKILL.md covers When to use this skill, What this skill commits to, Steps and Examples, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

RAG Deep Dive is an agent skill from lyonzin/knowledge-rag. Three-step multi-tool workflow — search the corpus, fetch the most relevant document in full, then find similar documents. Use when a single searchknowledge hit is not enough because the user asked a "how does X work end to end" or "explain the pattern" or "give me the full picture" question. Prevents shallow answers on complex topics.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering Retrieval-augmented generation. It works with Model Context Protocol. The repository describes itself as: Local RAG MCP server for Claude Code — hybrid search (semantic + BM25), cross-encoder reranking, 13 MCP tools, 20 format parsers. Zero external servers, zero API keys. The licence is MIT.

When your agent uses it

  • A single searchknowledge hit is not enough because the user asked a how does X work end to end
  • Explain the pattern
  • Give me the full picture question

Example prompts

  • “how does X work end to end”
  • “explain the pattern”
  • “give me the full picture”
  • “/rag-deep-dive”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. search_knowledge — find candidates
  2. get_document — read the top match in full
  3. search_similar — find related material

What it can do on your machine

Read from SKILL.md and the folder at commit df9cccb. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

RAG Deep Dive loads about 1.6k tokens when it runs. Until then it costs about 88 tokens; SKILL.md has 473 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~88
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from lyonzin/knowledge-rag at commit df9cccb, republished under its MIT licence (© lyonzin). 473 words, ~1,569 tokens.

Download SKILL.mdSave it as .claude/skills/rag-deep-dive/SKILL.md (or your agent's skills folder).
name
rag-deep-dive
description
Three-step multi-tool workflow — search the corpus, fetch the most relevant document in full, then find similar documents. Use when a single search_knowledge hit is not enough because the user asked a "how does X work end to end" or "explain the pattern" or "give me the full picture" question. Prevents shallow answers on complex topics.
metadata.type
rag-workflow
metadata.kind
workflow
metadata.target
any-mcp-client

rag-deep-dive — search + fetch + find similar

When to use this skill

Trigger this skill when the user asks something that needs breadth AND depth:

  • "How does X work end-to-end?"
  • "Walk me through the authentication flow"
  • "Explain the ingestion pipeline"
  • "Give me the full picture on X"
  • "How is X implemented across our services?"
  • Any question where a 500-char snippet is obviously not enough

Do NOT trigger for:

  • Simple factual lookups ("what port does X use") — rag-check-first alone is enough
  • User explicitly wants a short answer ("TL;DR", "one-liner")
  • Time-sensitive triage where speed matters more than depth

What this skill commits to

The agent runs a 3-tool chain in a fixed order:

  1. search_knowledge — find candidates
  2. get_document — read the top match in full
  3. search_similar — find related material

Then synthesizes an answer that pulls from all three, cites each source, and flags gaps.


Steps

  1. Search — cast a wide net:

    search_knowledge(query="<user's topic>", max_results=8, snippet_mode=true, min_score=0.15)

    Wider than usual (8 not 5) because we want candidate diversity for the similar-search step.

  2. Fetch — read the winner in full:

    get_document(filepath="<top_hit.source>")

    The full document, not just the chunk. This gives you sections that adjacent chunks did not surface.

  3. Find similar — discover the surrounding graph:

    search_similar(filepath="<top_hit.source>", max_results=5)

    These are documents ChromaDB considers semantically close to the top hit. Often surfaces the "obvious next document" that keyword search missed.

  4. Cross-reference the 3 result sets. Look for:

    • Consensus — do multiple docs describe the same thing? Cite them together.
    • Contradiction — flag it explicitly to the user, do not silently pick one.
    • Gap — if similar-search surfaces a doc you did not read yet, decide if it is worth a second get_document.
  5. Structure the answer:

    • Overview — 3-4 sentence summary drawn from the full document.
    • Details — sections/subsections quoted or paraphrased with citations.
    • Related — 2-3 bullets pointing at the similar documents with 1-line why-it-matters each.
    • Gaps — anything the corpus does NOT cover that the user might expect. Be honest.

Show full SKILL.md (162 more words)Show less

Examples

Example 1 — "How does the ingestion pipeline work?"

Agent (internal):

1. search_knowledge(query="document ingestion pipeline chunks embedding", max_results=8)
   → 6 hits: ingestion.md (0.88), parsers.md (0.72), chunker.md (0.69), embeddings.md (0.65),
             fastembed.md (0.61), watchdog.md (0.55)

2. get_document(filepath="docs/ingestion.md")
   → 4200-char full doc: 5 sections (parsing / chunking / embedding / storage / watcher)

3. search_similar(filepath="docs/ingestion.md", max_results=5)
   → 5 hits: ADR-0007-parser-choice.md, storage-format.md, chromadb-tuning.md,
             benchmark-ingestion.md, migration-v4.md

4. Synthesized reply:
   "The ingestion pipeline has 5 stages [docs/ingestion.md]:
    1. Parsing — dispatcher maps extension to parser [ingestion.py:174]
    2. Chunking — markdown-aware or code-aware per format [chunker.md]
    3. Embedding — FastEmbed ONNX lazy-loaded [embeddings.md]
    4. Deduplication — SHA256 [ingestion.md#dedup]
    5. Storage — ChromaDB with WAL mode [chromadb-tuning.md]

    The parser choice per format is documented in ADR-0007 [docs/adr/0007-parser-choice.md].
    Recent migration notes: [docs/migration-v4.md].

    Not covered by the corpus: the exact chunk-size tuning for large PDFs — you may want
    to open an ADR on this if it comes up often."

Example 2 — "Walk me through OAuth2 flow in our services"

Agent (internal):

1. search_knowledge(query="oauth2 flow authorization refresh", max_results=8)
   → 4 hits: adr/0018-auth.md, oauth-runbook.md, auth-service.md, token-storage.md

2. get_document(filepath="docs/adr/0018-auth.md")
   → Full ADR with 3 diagrams + decision + consequences

3. search_similar(filepath="docs/adr/0018-auth.md", max_results=5)
   → adr/0019-mtls.md, session-management.md, refresh-token-rotation.md,
      audit-logging.md, revocation.md

4. Reply weaves them together with explicit citations, calls out that
   adr/0019-mtls.md is about the S2S path (adjacent decision), and flags
   that "token revocation on user logout" is only mentioned in passing —
   worth clarifying with the security team.

Edge cases

  • Top hit is very short (<500 chars) — the full document may not be much larger than the chunk. Still call get_document for completeness; then either lean on similar-search or run a 2nd search with different keywords.
  • search_similar returns the same file — expected for near-unique docs; move on.
  • Time budget matters — this is 3 tool calls and reasoning between them. For quick chat, skip to rag-check-first.
  • Overlapping content across many docs — dedupe by summarizing the common thread once and citing all the sources at the end of that summary paragraph.

  • rag-check-first — the prerequisite (deep-dive is check-first + 2 more tools).
  • rag-cite-sources — even more important on deep-dive because you are quoting many sources.
  • rag-web-fallback — if the corpus does not cover the topic in depth, the deep-dive itself will surface that gap and you can chain to web search.

© lyonzin, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/workflow/rag-deep-dive of lyonzin/knowledge-rag.

Open the folder on GitHubat commit df9cccb

Compare with similar skills

RAG Deep Dive next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

RAG Deep Dive compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
RAG Deep Dive this skilllyonzin/knowledge-rag292—~1.6kAutomated safety check: PassMIT
MCP Local RAGshinpr/mcp-local-rag411—~4.4kAutomated safety check: PassMIT
Local RAG Searchnkapila6/mcp-local-rag1341 repos~1.6kAutomated safety check: PassMIT
AutoRAG Setup and RepairMarker-Inc-Korea/AutoRAG5.1k—~5.5kAutomated safety check: PassMIT
Sciverseopendatalab/Sciverse-Agent-Tools119—~3kAutomated safety check: PassCustom licence
Pgvector Semantic Searchtimescale/pg-aiguide1.9k—~3.8kAutomated safety check: PassApache-2.0

Similar skills

  • MCP Local RAG

    shinpr/mcp-local-rag

    Searches, saves, and maintains a local document index through a local RAG MCP server.

    411 GitHub stars~4.4k tokensUpdated 2 days ago
    AI & LLM EngineeringAuto-check passed
  • Local RAG Search

    nkapila6/mcp-local-rag

    Efficiently perform web searches using the mcp-local-rag server with semantic similarity ranking.

    134 GitHub starsUsed in 1 repo~1.6k tokens
    AI & LLM EngineeringAuto-check passed
  • AutoRAG Setup and Repair

    Marker-Inc-Korea/AutoRAG

    Installs, configures, and repairs AutoRAG's search model, approved folders, indexes, and datasources, and registers its Lite MCP server.

    5.1k GitHub stars~5.5k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Sciverse

    opendatalab/Sciverse-Agent-Tools

    A skill your agent uses when the user needs academic paper retrieval — searching scientific literature by author/year/journal, finding paper chunks for RAG-style citations, or expanding original…

    119 GitHub stars~3k tokensUpdated 19 days ago
    AI & LLM EngineeringAuto-check passed
  • Pgvector Semantic Search

    timescale/pg-aiguide

    A skill your agent uses for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search.

    1.9k GitHub stars~3.8k tokensUpdated 2 days ago
    AI & LLM EngineeringAuto-check passed
  • Postgres Hybrid Text Search

    timescale/pg-aiguide

    A skill your agent uses to implement hybrid search combining BM25 keyword search with semantic vector search using Reciprocal Rank Fusion (RRF).

    1.9k GitHub stars~3.1k tokensUpdated 2 days ago
    AI & LLM EngineeringAuto-check passed

More from lyonzin/knowledge-rag

All 10 skills in this repo
  • RAG Check First

    lyonzin/knowledge-rag

    Before answering any technical question, code request, architecture decision, or factual claim, call searchknowledge to check the local corpus.

    292 GitHub stars~1.4k tokensUpdated 5 days ago
    Auto-check passed
  • RAG Cite Sources

    lyonzin/knowledge-rag

    Every technical claim drawn from the local corpus must ship with a source citation formatted as path:line or path:section.

    292 GitHub stars~1.4k tokensUpdated 5 days ago
    Auto-check passed
  • RAG Code Review

    lyonzin/knowledge-rag

    When performing code review on a PR, diff, snippet, or "look at this change" request, first consult the corpus for related ADRs, coding standards, prior patterns, and similar files.

    292 GitHub stars~1.8k tokensUpdated 5 days ago
    Auto-check passed
  • RAG Troubleshoot

    lyonzin/knowledge-rag

    When the user reports a bug, error message, stack trace, unexpected behavior, or "why is this broken" question, search the corpus first for prior occurrences, known fixes, or related runbooks.

    292 GitHub stars~1.8k tokensUpdated 5 days ago
    Auto-check passed
  • RAG Evaluate Quality

    lyonzin/knowledge-rag

    Measure retrieval quality using evaluateretrieval (MRR@5 and Recall@5) and getindexstats.

    292 GitHub stars~1.4k tokensUpdated 5 days ago
    Auto-check passed
  • RAG Index Decisions

    lyonzin/knowledge-rag

    After making a non-obvious architectural decision, solving a novel bug, agreeing on a coding standard, or reaching a conclusion worth remembering, index it back into the knowledge base so the next…

    292 GitHub stars~2k tokensUpdated 5 days ago
    Auto-check passed

Questions about RAG Deep Dive

What does RAG Deep Dive do?

Three-step multi-tool workflow — search the corpus, fetch the most relevant document in full, then find similar documents. RAG Deep Dive is an agent skill from lyonzin/knowledge-rag. Three-step multi-tool workflow — search the corpus, fetch the most relevant document in full, then find similar documents.

When should I use RAG Deep Dive?

RAG Deep Dive fits situations like: A single searchknowledge hit is not enough because the user asked a how does X work end to end; explain the pattern; give me the full picture question.

How do I install RAG Deep Dive in Claude Code?

Run `npx skills add lyonzin/knowledge-rag --skill rag-deep-dive -a claude-code`. Or copy the skill folder (skills/workflow/rag-deep-dive in lyonzin/knowledge-rag) into .claude/skills/rag-deep-dive in your project. Claude Code loads it when a task matches its description.

How do I install RAG Deep Dive in Codex?

Run `npx skills add lyonzin/knowledge-rag --skill rag-deep-dive -a codex`. Or copy the skill folder (skills/workflow/rag-deep-dive in lyonzin/knowledge-rag) into .agents/skills/rag-deep-dive in your project. Codex loads it when a task matches its description.

Can I use RAG Deep Dive in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add lyonzin/knowledge-rag --skill rag-deep-dive -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rag-deep-dive, .gemini/skills/rag-deep-dive, .github/skills/rag-deep-dive and .opencode/skills/rag-deep-dive in your project.

What does RAG Deep Dive need to run?

SKILL.md names no scripts, command-line tools or credentials: RAG Deep Dive is instructions for the agent only.

Does RAG Deep Dive access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is RAG Deep Dive safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does RAG Deep Dive use?

RAG Deep Dive is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does RAG Deep Dive use?

About 1.6k tokens (SKILL.md is roughly 6.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to RAG Deep Dive?

Skills that share tags, products or a category with RAG Deep Dive: MCP Local RAG (shinpr/mcp-local-rag, 411 stars), Local RAG Search (nkapila6/mcp-local-rag, 134 stars), AutoRAG Setup and Repair (Marker-Inc-Korea/AutoRAG, 5.1k stars) and Sciverse (opendatalab/Sciverse-Agent-Tools, 119 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains RAG Deep Dive?

lyonzin (a GitHub user) maintains it in lyonzin/knowledge-rag, which has 292 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 4, 2026.

Source: lyonzin/knowledge-rag on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.