Skip to content
Skill

Kb query

Lets an agent answer questions from a local materials-science knowledge base with cited

Kb query is an open-source agent skill for knowledge and memory. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
6
Last commit
License
MIT
Listing updated

Similar skills

About Kb query

This skill guides an agent to search and answer questions against a local knowledge base organized around the kb.py command. It separates simple lookups, which go to a plain top-K search, from comparisons, mechanisms, disputes and trend questions, which go to a bounded agentic retrieval that can follow sub-queries and graph links. Answers are meant to be built from the retrieved evidence, with concept and synthesis pages treated as secondary and source papers and raw full-text passages used to verify claims and cite file paths and line numbers.

The workflow asks the agent to check reliability fields and low-confidence signals, flag single-source claims, cross-compare sources that report the same figure, and treat low scores as gaps rather than forcing an answer. Before saying something is missing from the library, it runs a helper that searches several directories and reports hits per directory. It also covers running a local search server, checking the reranker model, and rebuilding indexes after edits.

The skill expects a Python environment with the repository's tools installed and a local knowledge base in place. Its documentation is written in Chinese, and the default reranker is a local bge model that must be explicitly allowed to download.

When your agent uses it

在本知识库里检索并回答问题(传统 RAG、Agentic RAG、分层证据、原文回指)。用户提出需要库内证据的问题、要求比较机制/争议/趋势或核对原文时使用。首选 kb.py ask/search,不要先读 index.md 全表或手工 grep。

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (10 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the matsci-knowledge-base plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add cqxcrl/matsci-kb-kit
/plugin install matsci-knowledge-base@matsci-local

Or copy only this skill to ~/.claude/skills/kb-query:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/cqxcrl/matsci-kb-kit.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/kb-query &&
cp -R "$tmp/skills/kb-query" ~/.claude/skills/kb-query &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/kb-query inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/kb-query to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/cqxcrl/matsci-kb-kit.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/kb-query &&
cp -R "$tmp/skills/kb-query" ~/.agents/skills/kb-query &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/kb-query inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/kb-query to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/cqxcrl/matsci-kb-kit.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/kb-query &&
cp -R "$tmp/skills/kb-query" ~/.cursor/skills/kb-query &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/kb-query inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/cqxcrl/matsci-kb-kit.git --path skills/kb-query

Or copy the folder to ~/.gemini/skills/kb-query yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/kb-query:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/cqxcrl/matsci-kb-kit.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/kb-query &&
cp -R "$tmp/skills/kb-query" ~/.copilot/skills/kb-query &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/kb-query inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/cqxcrl/matsci-kb-kit.git

Then copy matsci-kb-kit/skills/kb-query into your agent's skills folder as kb-query. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Strategy selection
Chooses simple, agentic or automatic retrieval depending on whether a question is a fact lookup or a comparison.
Layered evidence handling
Separates synthesized concept pages from individual source claims and verbatim raw text when answering.
Citation verification
Checks claims against original file paths and line numbers rather than relying on grep.
Single-source flagging
Marks conclusions supported by only one paper and notes disagreements between sources.
Local search service
Starts, checks and stops a resident search server and verifies the reranker model.
Missing-content check
Searches several library directories before concluding that a document is absent.

Good for

  • Compare two battery electrolyte mechanisms using the library's sources
  • Find the original wording behind a figure quoted in a wiki page
  • Answer a definition question from the knowledge base with file references
  • Check whether a claimed result appears in the underlying papers
  • Summarize a contested research trend and note the strength of evidence

Kb query FAQ

When does Kb query trigger?

It is meant for questions that need evidence from the library, requests to compare mechanisms, disputes or trends, and checks against original text.

Which command should the agent use first?

The skill names kb.py ask or search as the preferred entry point and tells the agent to list available tools with kb.py tools --json.

Does Kb query need a local model?

It uses a local reranker by default, bge-reranker-base, which reads from local files; first download requires an explicit flag or environment variable.

Is the skill openly licensed?

The repository is MIT licensed.

How do I install Kb query in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/kb-query to use it in all your projects, or to .claude/skills/kb-query in one project. Or install the matsci-knowledge-base plugin, which includes it: /plugin marketplace add cqxcrl/matsci-kb-kit, then /plugin install matsci-knowledge-base@matsci-local.

Does Kb query run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Kb query?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Kb query?

The closest alternatives to Kb query are Haiku rag, Knowledge base integration, Research ops edho ferdian, LLM wiki and Research.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from cqxcrl/matsci-kb-kit

  1. Runs batch ingest workflows for a materials-science knowledge base: ledger queries, batch

    • Open source
    • 6 GitHub stars
    • Knowledge and memory
  2. Runs health checks and batch fixes on a markdown knowledge base, with tiered lint modes

    • Open source
    • 6 GitHub stars
    • Knowledge and memory
  3. Interview-driven setup wizard that configures a literature library's research directions

    • Open source
    • 6 GitHub stars
    • Knowledge and memory
  4. Runs a serial, tick-based quality-check loop that flags numbers and claims missing from

    • Open source
    • 6 GitHub stars
    • Knowledge and memory
  5. Runs a reviewer-and-reviser loop on a literature review draft, checking claims against

    • Open source
    • 6 GitHub stars
    • Writing style
  6. Lets an agent retry blocked paper and supplement downloads through a real browser

    • Open source
    • 6 GitHub stars
    • Web search and scraping