kb-rag

kb-rag is a skill for Claude Code, Codex from MuduiClaw/ClawKing. It costs 74 tokens per session (864 once invoked), scanned A, original, MIT.

A knowledge-base search and question-answering skill using RAG, a method that retrieves relevant stored passages before generating an answer. Its indexed sources can include articles, documentation, skills, project files, and conversation notes.

In plain words
What is it for?
Finding information across indexed documents, answering questions from stored material, and retrieving matching passages from a selected collection.
Why use it?
It avoids searching through many files manually when you need information from the accumulated knowledge base.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: positional $N argument; built for openclaw.

Good fit Finding information across indexed documents, answering questions from stored material, and retrieving matching passages from a selected collection.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/muduiclaw/clawking/kb-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 MuduiClaw/ClawKing --skill kb-rag
Clone the repo
git clone --depth 1 https://github.com/MuduiClaw/ClawKing

Made for: Claude Code, Codex.

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 kb-rag

README.md
[![agentmods](https://agentmods.dev/badge/skills/muduiclaw/clawking/kb-rag.svg)](https://agentmods.dev/skills/muduiclaw/clawking/kb-rag)
Your own site
<a href="https://agentmods.dev/skills/muduiclaw/clawking/kb-rag"><img src="https://agentmods.dev/badge/skills/muduiclaw/clawking/kb-rag.svg" alt="Measured on agentmods" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 864 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.00074 $0.00864
Opus 5 $0.00037 $0.00432
Sonnet 5 $0.00015 $0.00173
Haiku 4.5 $0.00007 $0.00086

Measured 8d ago against content hash 50e72e686316, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

kb-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 8d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (run.sh, scripts/rag_query.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.

workspace/skills/kb-rag/SKILL.md · 95 lines

How it starts

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

Knowledge Base RAG

Architecture

  • Backend: qmd (BM25 + vector + hybrid reranker)
  • LLM: Antigravity proxy (Gemini/Claude, $0 cost)
  • Collections: 7 indexed collections, auto-updated every 5 min by OpenClaw

Collections

Collection Content Path
kb-articles Blog translations & analysis output/blog-translations/
kb-skills Skill documentation skills/**/SKILL.md
kb-captures Conversation insight captures content-pipeline/captures/
kb-docs Project documentation docs/
memory-dir Daily notes & archives memory/
memory-root Core memory index MEMORY.md
memory-alt Alt memory memory.md

Query (RAG Pipeline)

Run the RAG script for end-to-end retrieve + generate:

python3 skills/kb-rag/scripts/rag_query.py "question"

Options:

  • -c <collection> — limit to specific collection (e.g. kb-articles)
  • -k <N> — top-K chunks (default 8)
  • -m <model> — LLM model (default gemini-3.1-pro-high)
  • --retrieve-only — skip LLM, just show retrieved chunks
  • --json — JSON output

Examples:

# General KB question
python3 skills/kb-rag/scripts/rag_query.py "OpenClaw 2026.2.13 有什么重要更新"

# Search only blog articles
python3 skills/kb-rag/scripts/rag_query.py "Agent 自主付费" -c kb-articles

# Just retrieve, no generation
python3 skills/kb-rag/scripts/rag_query.py "Peter Steinberger 的创业哲学" --retrieve-only

Manual Search (without LLM)

Direct qmd commands for quick lookups:

# Hybrid search (best quality)
qmd query "search terms" -n 5

# Vector similarity (better for semantic/fuzzy)
qmd vsearch "search terms" -n 5

# Full-text BM25 (exact term matching)
qmd search "search terms" -n 5

# Limit to collection
qmd query "search terms" -c kb-articles -n 5

Ingest New Content

Add individual files

New .md files dropped into indexed directories are auto-picked up on next qmd update && qmd embed.

Add new collection

qmd collection add /path/to/dir --name collection-name --mask "**/*.md"
qmd update && qmd embed

Read the full file on GitHub · 95 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. 8d ago First seen · 95 lines · 74 tokens per session scan A 50e72e686316

Subscribe to this mod's changes

kb-rag is a skill published in the GitHub repository MuduiClaw/ClawKing (11 stars, last pushed 4mo ago), licensed MIT. It adds 74 tokens to every session and 864 once invoked, about $0.0004 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