knowledge-base-rag

knowledge-base-rag is a skill for Claude Code from itallstartedwithaidea/agent-skills. It costs 40 tokens per session (1,561 once invoked), scanned A, original, MIT.

A retrieval-augmented generation system for answering questions from a private document collection. It finds relevant passages and gives them to an AI model before generating a response.

In plain words
What is it for?
Use it to ingest documents, split and index them, retrieve relevant text, and generate answers with cited sources.
Why use it?
AI models may not know private or newly created information, and retrieving source passages helps ground answers in the available documents.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Claude Code; built for cline.

Part of the all-skills plugin — 73 skills shipped together

Good fit Use it to ingest documents, split and index them, retrieve relevant text, and generate answers with cited sources.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/itallstartedwithaidea/agent-skills/knowledge-base-rag
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.

Any agent
npx skills add itallstartedwithaidea/agent-skills --skill knowledge-base-rag
Clone the repo
git clone --depth 1 https://github.com/itallstartedwithaidea/agent-skills

Made for: Claude Code.

Or install all-skills, the plugin that ships this one along with the rest of its 73 skills.

Wrote 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.

agentmods badge for knowledge-base-rag

README.md
[![agentmods](https://agentmods.dev/badge/skills/itallstartedwithaidea/agent-skills/knowledge-base-rag/github.svg)](https://agentmods.dev/skills/itallstartedwithaidea/agent-skills/knowledge-base-rag)
Your own site
<a href="https://agentmods.dev/skills/itallstartedwithaidea/agent-skills/knowledge-base-rag"><img src="https://agentmods.dev/badge/skills/itallstartedwithaidea/agent-skills/knowledge-base-rag/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.

agentmods 80×15 button for knowledge-base-rag

Your own site · 80×15
<a href="https://agentmods.dev/skills/itallstartedwithaidea/agent-skills/knowledge-base-rag"><img src="https://agentmods.dev/badge/skills/itallstartedwithaidea/agent-skills/knowledge-base-rag.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,561 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00040 $0.01561
Opus 5.5 $0.00016 $0.00624
Sonnet 5.5 $0.00008 $0.00312
Haiku 4.5 $0.00004 $0.00156

Measured 1mo ago against content hash 49763bfba938, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

knowledge-base-rag 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.

skills/productivity/knowledge-base-rag/SKILL.md · 179 lines

How it starts

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

Knowledge Base RAG

Part of Agent Skills™ by googleadsagent.ai™

Description

Knowledge Base RAG implements the complete Retrieval-Augmented Generation pipeline: document ingestion, intelligent chunking, embedding generation, vector store indexing, semantic retrieval, and grounded response generation. The agent builds RAG systems that answer questions from private knowledge bases with cited sources and reduced hallucination.

RAG solves the fundamental limitation of large language models: they cannot access information created after their training cutoff or proprietary information they were never trained on. By retrieving relevant documents from a vector store and injecting them into the prompt context, RAG grounds the model's responses in factual, up-to-date, organization-specific knowledge.

The quality of a RAG system depends on chunking strategy more than model choice. This skill encodes production-tested chunking approaches: semantic chunking that preserves paragraph coherence, recursive splitting that respects document structure (headings, code blocks, tables), and overlap windows that maintain context across chunk boundaries. Each strategy is matched to the document type for optimal retrieval quality.

Use When

  • Building question-answering systems over private documents
  • Creating a searchable knowledge base from documentation, wikis, or PDFs
  • Reducing hallucination by grounding LLM responses in retrieved facts
  • Implementing semantic search across large document collections
  • Building customer support bots with product-specific knowledge
  • The user asks about RAG, vector search, or document embedding

How It Works

graph TD
    A[Documents: PDF, MD, HTML] --> B[Ingestion Pipeline]
    B --> C[Extract Text + Metadata]
    C --> D[Intelligent Chunking]
    D --> E[Generate Embeddings]
    E --> F[Index in Vector Store]
    G[User Query] --> H[Embed Query]
    H --> I[Semantic Search: Top-K]
    I --> J[Re-rank Results]
    J --> K[Construct Prompt with Context]
    K --> L[LLM Generation]
    L --> M[Response with Citations]

Read the full file on GitHub · 179 lines

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. 1mo ago First seen · 179 lines · 40 tokens per session scan A 49763bfba938

Subscribe to this mod's changes

knowledge-base-rag is a skill published in the GitHub repository itallstartedwithaidea/agent-skills (44 stars, last pushed 6mo ago), licensed MIT. It adds 40 tokens to every session and 1,561 once invoked, about $0.0002 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-08-30.

Related

Other skills, from other repositories

ai-hive-simulate-datawhale

A research and content-planning workflow that studies Datawhale's public material and turns its general methods into original work using your own facts and experience. It can also organise authorised documents into a source-linked reference library.

wubin1836/ai-hive-agent-skills · 304 tokens

ai-hive-simulate-david-holz

A research and content-planning workflow that studies David Holz's public material and turns its general methods into original work using your own facts and experience. It can also organise authorised documents into a source-linked reference library.

wubin1836/ai-hive-agent-skills · 301 tokens

ai-hive-simulate-david-sacks

A research and content-planning workflow that studies David Sacks's public material and turns its general methods into original work using your own facts and experience. It can also organise authorised documents into a source-linked reference library.

wubin1836/ai-hive-agent-skills · 316 tokens

ai-hive-simulate-demis-hassabis

A research and content-planning workflow that studies Demis Hassabis's public material and turns its general methods into original work using your own facts and experience. It can also organise authorised documents into a source-linked reference library.

wubin1836/ai-hive-agent-skills · 321 tokens

ai-hive-simulate-dn-samuel

A research and content-planning workflow that studies DN-Samuel's public material and turns its general methods into original work using your own facts and experience. It can also organise authorised documents into a source-linked reference library.

wubin1836/ai-hive-agent-skills · 334 tokens

ai-hive-simulate-donbesilent

A research and content-planning workflow that studies Donbesilent's public material and turns its general methods into original work using your own facts and experience. It can also organise authorised documents into a source-linked reference library.

wubin1836/ai-hive-agent-skills · 317 tokens