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.
npx skills add GYF0311/lorekit --skill wiki-querygit clone --depth 1 https://github.com/GYF0311/lorekitWrote 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.
[](https://agentmods.dev/skills/gyf0311/lorekit/wiki-query)<a href="https://agentmods.dev/skills/gyf0311/lorekit/wiki-query"><img src="https://agentmods.dev/badge/skills/gyf0311/lorekit/wiki-query/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/gyf0311/lorekit/wiki-query"><img src="https://agentmods.dev/badge/skills/gyf0311/lorekit/wiki-query.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00056 | $0.02560 |
| Opus 5.5 | $0.00022 | $0.01024 |
| Sonnet 5.5 | $0.00011 | $0.00512 |
| Haiku 4.5 | $0.00006 | $0.00256 |
Grade A, and why
wiki-query 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 194 lines — stays where its author put it; the contents beside it link to each section on GitHub.
wiki-query
从当前 corpus 回答问题。核心是三层检索决策 + 答案必须标注来源 + corpus 没有就诚实说没有。
When to trigger
- 用户说"查一下 XXX"、"找一下 XXX"、"搜 XXX"
- 用户说"我之前整理过 XXX 吗"、"记得 XXX 吗"、"之前说过 XXX"
- 用户问"关于 XXX 我都有什么资料"
- 用户抛一个概念性问题,且明显在问已有知识库,而不是要上网
不要触发:
- 查询后用户说"把这个记下来" → 交给
wiki-fileback - 用户给了新外部资料要存 → 交给
wiki-ingest - 用户在问纯外部新知识且明说不用查库 → 直接
WebSearch/WebFetch(默认仍先查库再联网兜底,见默认查询顺序第 6 步)
默认查询顺序
铁律:先走确定性文本层,不先启动重型召回流程。
默认顺序:
rg/lorekit search "<q>"找精确词、实体名、文件名和短语。- Read
corpus/index.md定位知识分区。 - Read
{dir}/_INDEX.md缩小到候选页。 - Read 具体
知识库/canonical page,再按页内 wikilink 追 1-2 跳。 - 第二级召回(fallback):1-4 步无命中或明显不足时,
lorekit search "<q>" --all把过程区(_工作台/、_归档/、输出/等)纳入召回。命中时照常引用,但必须 标注非 canonical(例如⚠ 过程稿:_工作台/草稿/xxx.md,未经入库校验), 不得当作 Compiled Truth 级证据。转写噪音层(_工作台/转写/)--all 仍排除, 先生点名"去转写里找"才lorekit search "<q>" --dir _工作台/转写。 - 联网兜底(web fallback):1-5 步都无命中(或问题本身涉及库外的新知识 / 时效
信息)时,直接用
WebSearch/WebFetch联网检索,不要停在"库里没有"。 回答必须分层标注来源:「库内已沉淀」(引用 corpus 页面)vs「联网新查」(给 URL,注明未入库、未校验)。联网结论有长期复用价值时,提议wiki-fileback/wiki-ingest入库,由用户决定。
Decision tree
按 query 类型选层:
1. 精确关键词(实体名 / 文件名 / 具体词)
先走 lorekit search "<q>"(ripgrep fallback)。命中就读对应页面。
2. 模糊语义(概念性 / 意图类 / "跟 X 相关的东西")
- Read
corpus/index.md/知识库/→ AI 按语义选 1-3 个分区 - Read
{选中分区}/_INDEX.md→ 选具体页 - Read 具体
.md文件 → 综合答案 - 只有需要完整 provenance 时才打开
原料/ _工作台/**/_归档/**不是第一级召回层:知识库层无命中时走lorekit search "<q>" --all第二级召回(结果标注非 canonical);先生点名具体路径时直接读
3. 多跳推理("A 相关 B 的 C")
在第 2 步基础上,沿候选页的 [[wikilinks]] 递归遍历 1-2 步,综合。
大部分真实 query 是组合:先精确找锚点(第 1 步),再沿语义展开(第 2 步),最后拉链接(第 3 步)。
Tools to use
lorekit search "<q>"— 精确 ripgrep/fallback 检索(durable 层)lorekit search "<q>" --all— 第二级召回,纳入工作台/归档等过程区- Read
corpus/index.md/{dir}/_INDEX.md/ 具体文件 - 底层:Grep(复杂匹配时用)
Output format
综合答案时必须遵守:
- 每条信息标注来源
[[页面名]],用户能直接跳过去 - 如果 corpus 没相关内容,诚实说"corpus 里没有关于 XXX 的内容",永远不要瞎编
- 给出检索路径(可折叠),方便用户判断是不是漏了
- 末尾主动提议 fileback(见下一节)
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.
- 1mo ago First seen · 194 lines · 56 tokens per session scan A fc60bf606505
wiki-query is a skill published in the GitHub repository GYF0311/lorekit (5 stars, last pushed 3mo ago), licensed MIT. It adds 56 tokens to every session and 2,560 once invoked, about $0.0002 per session on Opus 5.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-31.
Other skills, from other repositories
llmwiki
Build and use a persistent, citation-traceable knowledge wiki from documents, research papers, notes, or project documentation. Use for llmwiki projects, retrieving reusable evidence for an agent task, or compiling a corpus for repeated questions. A one-off file read or live web search does not need a wiki.
karpathy-llm-wiki
Use when building or maintaining a personal LLM-powered knowledge base. Triggers: ingesting sources into a wiki, querying wiki knowledge, linting wiki quality, 'add to wiki', 'what do I know about', or any mention of 'LLM wiki' or 'Karpathy wiki'.
ingest
Populate the gnosis-mcp knowledge base — from local files, git history, or a crawled website. Handles the full matrix of flags (--force, --prune, --wipe, --embed, --include-crawled) in one place.
setup
First-time setup wizard for Gnosis MCP. Install, init the database, ingest a docs folder, wire your editor — in that order.
tune
Find the chunk-size and retrieval config that maximizes quality on YOUR corpus. Sweeps chunk sizes, runs a golden-query set, reports nDCG / MRR / Hit@5. Use after first ingest or whenever your corpus changes shape significantly.
document-chunker
Split documents into overlapping token chunks for RAG pipelines and LLM context windows. Zero dependencies.