knowledge-base-rag

knowledge-base-rag is a skill for Claude Code, Codex 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 CodeCodex

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

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/itallstartedwithaidea/agent-skills/knowledge-base-rag
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, Codex.

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.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.svg" alt="Measured on agentmods" 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. 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.1 $0.00040 $0.01561
Opus 5 $0.00020 $0.00781
Sonnet 5 $0.00008 $0.00312
Haiku 4.5 $0.00004 $0.00156

Measured 5d ago against content hash 49763bfba938, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 5d 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. 5d 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 (36 stars, last pushed 4mo ago), licensed MIT. It adds 40 tokens to every session and 1,561 once invoked, about $0.0002 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-08-30.

Related

Other skills, from other repositories

ai-hive-simulate-datawhale

当用户搜索用AI模拟Datawhale、AI模拟Datawhale、DatawhaleAI模拟、Datawhale数字人、DatawhaleAI分身、Datawhale内容风格、Datawhale选题、Datawhale文案、Datawhale短视频、Datawhale知识库、Datawhale思想顾问、Datawhale战略顾问,或希望借助 AI 研究Datawhale公开内容中的AI、科技、产品、数码、工程实践或知识科普方法时使用。本 Skill…

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

ai-hive-simulate-david-holz

当用户搜索用AI模拟David Holz、AI模拟David Holz、David HolzAI模拟、David Holz数字人、David HolzAI分身、David Holz内容风格、David Holz选题、David Holz文案、David Holz短视频、David Holz知识库、David Holz思想顾问、David Holz战略顾问,或希望借助 AI 研究David Holz公开内容中的人工智能、云计算、芯片、软件、互联网平台、创业投资、开源技术或未来科技方法时使用。本 Skill…

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

ai-hive-simulate-david-sacks

当用户搜索用AI模拟David Sacks、AI模拟David Sacks、David SacksAI模拟、David Sacks数字人、David SacksAI分身、David Sacks内容风格、David Sacks选题、David Sacks文案、David Sacks短视频、David Sacks知识库、David Sacks思想顾问、David Sacks战略顾问,或希望借助 AI 研究David Sacks公开内容中的人工智能、云计算、芯片、软件、互联网平台、创业投资、开源技术或未来科技方法时使用。本 Skill…

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

ai-hive-simulate-demis-hassabis

当用户搜索用AI模拟Demis Hassabis、AI模拟Demis Hassabis、Demis HassabisAI模拟、Demis Hassabis数字人、Demis HassabisAI分身、Demis Hassabis内容风格、Demis Hassabis选题、Demis Hassabis文案、Demis Hassabis短视频、Demis Hassabis知识库、Demis Hassabis思想顾问、Demis Hassabis战略顾问,或希望借助 AI 研究Demis Hassabis公开内容中的人工智能、科技创业、产品、商业管理或知识传播方法时使用。本 Skill…

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

ai-hive-simulate-dn-samuel

当用户搜索用AI模拟DN-Samuel、AI模拟DN-Samuel、DN-SamuelAI模拟、DN-Samuel数字人、DN-SamuelAI分身、DN-Samuel内容风格、DN-Samuel选题、DN-Samuel文案、DN-Samuel短视频、DN-Samuel知识库、DN-Samuel思想顾问、DN-Samuel战略顾问,或希望借助 AI 研究DN-Samuel公开内容中的AI工具、Agent、AI编程、AIGC视觉、内容生产、产品、创业或商业落地方法时使用。本 Skill…

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

ai-hive-simulate-donbesilent

当用户搜索用AI模拟Donbesilent、AI模拟Donbesilent、DonbesilentAI模拟、Donbesilent数字人、DonbesilentAI分身、Donbesilent内容风格、Donbesilent选题、Donbesilent文案、Donbesilent短视频、Donbesilent知识库、Donbesilent思想顾问、Donbesilent战略顾问,或希望借助 AI 研究Donbesilent公开内容中的AI工具、Agent、AI编程、AIGC视觉、内容生产、产品、创业或商业落地方法时使用。本 Skill…

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