ima-knowledge-base

A tool for working with an IMA knowledge base, a searchable collection of stored documents and other materials. It can search content, inspect results, browse entries, upload files, and import web pages.

In plain words
What is it for?
Searching stored knowledge, viewing matching entries, listing collections and items, uploading files, and importing web pages.
Why use it?
It helps locate information in a large collection without manually browsing every item. Its guidance also helps distinguish a normal text result from an image, screenshot, or OCR document that needs closer inspection.

Skill for Claude CodeCodex

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/countbot-ai/countbot/ima-knowledge-base
Any agent
npx skills add countbot-ai/CountBot --skill ima-knowledge-base
Clone the repo
git clone --depth 1 https://github.com/countbot-ai/CountBot

Made for: Claude Code, Codex.

Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 832 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 $0.00067 $0.00832
Opus 5 $0.00034 $0.00416
Sonnet 5 $0.00013 $0.00166
Haiku 4.5 $0.00007 $0.00083

Measured 2d ago against content hash c8f30dc2d3a3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ima-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 2d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/ima_client.py, scripts/ima_kb_tool.py, scripts/ima_tool.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/ima-knowledge-base/SKILL.md · 60 lines

What it actually says

IMA Knowledge Base

入口:

python skills/ima-knowledge-base/scripts/ima_kb_tool.py <command> ...

执行规则

  • 用户说“搜、查、找、看看有没有”时,先 search-kb
  • 默认直接返回命中片段,不堆字段
  • search-kb 搜的是内容,不是知识库列表
  • 用户给了 kb-idkb-name 时,加定向参数
  • 默认优先 --keyword,只有明确要把多个词合成一次搜索串时才用 --query
  • 宽搜建议加 --show 5 --limit 10;知识库很大再加 --search-pages 2 或更高

查看单条结果

  • 默认先 show-kb-hit
  • 只有命中像图片、截图、OCR 文档、菜单图,或 show-kb-hit 太短时,才用 inspect-kb-hit
  • 一条 --keyword "推荐 菜单 餐厅 美食" 会拆成多次搜索,同一标题可能重复出现
  • 宽搜后稳定定位优先级:更窄关键词 > --title > --media-id > --pick

常用命令

python skills/ima-knowledge-base/scripts/ima_kb_tool.py search-kb --keyword "orslow"
python skills/ima-knowledge-base/scripts/ima_kb_tool.py search-kb --keyword "推荐 菜单 餐厅 美食" --show 5 --limit 10
python skills/ima-knowledge-base/scripts/ima_kb_tool.py search-kb --kb-name "个人知识库" --keyword "菜单"
python skills/ima-knowledge-base/scripts/ima_kb_tool.py show-kb-hit --keyword "orslow" --pick 1
python skills/ima-knowledge-base/scripts/ima_kb_tool.py inspect-kb-hit --keyword "orslow" --pick 1
python skills/ima-knowledge-base/scripts/ima_kb_tool.py list-kb
python skills/ima-knowledge-base/scripts/ima_kb_tool.py list-kb-items --kb-name "个人知识库" --limit 20
python skills/ima-knowledge-base/scripts/ima_kb_tool.py upload-file --kb-name "个人知识库" --file "/path/to/report.pdf"
python skills/ima-knowledge-base/scripts/ima_kb_tool.py import-url --kb-name "个人知识库" --url "https://example.com"

推荐类问题

用户问“知识库里有什么推荐”时:

  1. 先宽搜:search-kb --keyword "推荐 菜单 餐厅 美食" --show 5 --limit 10
  2. 命中太杂就补对象词,例如 search-kb --keyword "orslow 推荐"
  3. 锁定单条后先 show-kb-hit
  4. 只有需要 OCR 扩展片段时才 inspect-kb-hit

写入安全

  • upload-fileimport-url 会真实写入知识库,执行前先确认目标知识库
  • 需要配置时查看 scripts/config.jsonconfig.help.md

如何配置

下载最新的IMA客户端(比如Android),登陆后点击 “我” --> Claw配置 --> 复制 client_id和api_key参数,提供给CountBot后会自动调用文件编辑工具修改config.json。

Files

What ships with it

7 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. 2d ago First seen · 60 lines · 67 tokens per session scan A c8f30dc2d3a3

Subscribe to this mod's changes

ima-knowledge-base is a skill published in the GitHub repository countbot-ai/CountBot (773 stars, last pushed 6d ago), licensed MIT. It adds 67 tokens to every session and 832 once invoked, about $0.0003 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.