knowledge-base

knowledge-base is a skill for Claude Code from WaniWani-AI/sdk. It costs 34 tokens per session (1,300 once invoked), scanned A, original, MIT.

A setup guide for adding searchable knowledge documents to an MCP project using the Waniwani knowledge-base service.

In plain words
What is it for?
Use it to create a knowledge folder, upload Markdown files, and add a searchable FAQ tool and ingestion script.
Why use it?
It removes the need to build document ingestion and search wiring from scratch.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Not installable on its own: it reads a path above its own folder, which only exists inside its repository. The line is const knowledgeDir = join(import.meta.dirname, "../lib/{MCP_NAME}/knowledge-base/knowledge");.

Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/waniwani-ai/sdk/knowledge-base.svg)](https://agentmods.dev/skills/waniwani-ai/sdk/knowledge-base)
Your own site
<a href="https://agentmods.dev/skills/waniwani-ai/sdk/knowledge-base"><img src="https://agentmods.dev/badge/skills/waniwani-ai/sdk/knowledge-base.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,300 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.00034 $0.01300
Opus 5 $0.00017 $0.00650
Sonnet 5 $0.00007 $0.00260
Haiku 4.5 $0.00003 $0.00130

Measured 6d ago against content hash 7cf1f5f72dfc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

knowledge-base 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 6d 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.

.claude/skills/knowledge-base/SKILL.md · 181 lines

How it starts

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

Set Up Knowledge Base

Add semantic search over markdown documents to an MCP project using the Waniwani KB API (client.kb).

Prerequisites

  • Project must already be initialized (no {{MCP_NAME}} placeholders)
  • @waniwani/sdk must be installed
  • WANIWANI_API_KEY must be set in the environment

Steps

1. Detect MCP name

Look in lib/ for the directory that isn't shared — that's the MCP name. Store as {MCP_NAME}.

2. Create knowledge directory

Create lib/{MCP_NAME}/knowledge-base/knowledge/ directory.

Ask the user: "Do you have .md files to add to the knowledge base, or should I create an example file?"

If no files provided, create lib/{MCP_NAME}/knowledge-base/knowledge/example.md:

# Example Knowledge Base

## What is this?

This is an example knowledge base entry. Replace this file with your own .md files containing information you want your AI assistant to be able to search through.

## How does it work?

Each .md file is split into chunks by H2 headings. The H1 title provides context for each chunk. Run `bun run kb:ingest` to upload your knowledge files to the Waniwani API.

3. Create the ingestion script

Create scripts/kb-ingest.ts (create scripts/ directory if it doesn't exist):

import { readdir, readFile } from "node:fs/promises";
import { join } from "node:path";
import { waniwani } from "@waniwani/sdk";

const knowledgeDir = join(import.meta.dirname, "../lib/{MCP_NAME}/knowledge-base/knowledge");

const mdFiles = (await readdir(knowledgeDir)).filter((f) => f.endsWith(".md"));
console.log(`Found ${mdFiles.length} knowledge file(s)`);

const files = await Promise.all(
  mdFiles.map(async (filename) => ({
    filename,
    content: await readFile(join(knowledgeDir, filename), "utf-8"),
  })),
);

const client = waniwani();

console.log("Ingesting files into knowledge base...");
console.log("⚠️  This will replace all existing KB chunks for this environment.");

const result = await client.kb.ingest(files);
console.log(`Done: ${result.chunksIngested} chunks from ${result.filesProcessed} files`);

Read the full file on GitHub · 181 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. 6d ago First seen · 181 lines · 34 tokens per session scan A 7cf1f5f72dfc

Subscribe to this mod's changes

knowledge-base is a skill published in the GitHub repository WaniWani-AI/sdk (17 stars, last pushed yesterday), licensed MIT. It adds 34 tokens to every session and 1,300 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.