ワンクリックで
llm-wiki
Karpathy's LLM Wiki: build/query interlinked markdown KB.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Karpathy's LLM Wiki: build/query interlinked markdown KB.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Schedule reminders and recurring tasks. Actions: add, list, remove or set_context.
Periodic wake-up service that checks HEARTBEAT.md for pending tasks and executes them automatically. Use this skill to write or update HEARTBEAT.md.
Private knowledge base for indexing multimodal files or folders into a knowledge graph, supporting multi-hop graph retrieval
Generate wiki docs + Mermaid diagrams for any codebase. Use when the user asks to document a codebase, generate architecture diagrams, or create a structured wiki for a repo.
Parse an image from a file path to obtain a description, enabling non-multimodal LLMs to have vision capabilities.
When the user needs to transcribe video (such as .mp4, .mkv, .avi) into text, use the python_repl tool to generate text.
| name | llm-wiki |
| description | Karpathy's LLM Wiki: build/query interlinked markdown KB. |
| version | 3.0.0 |
| author | Hermes Agent (adapted for EMA_AI_agent) |
| license | MIT |
| platforms | ["windows"] |
| metadata | {"hermes":{"tags":["wiki","knowledge-base","research","notes","markdown","rag-alternative"],"category":"research","related_skills":["obsidian","arxiv"]}} |
Build and maintain a persistent, compounding knowledge base as interlinked markdown files. Based on Andrej Karpathy's LLM Wiki pattern.
Unlike traditional RAG (which rediscovers knowledge from scratch per query), the wiki compiles knowledge once and keeps it current. Cross-references are already there. Contradictions have already been flagged. Synthesis reflects everything ingested.
Division of labor: The human curates sources and directs analysis. The agent summarizes, cross-references, files, and maintains consistency.
Use this skill when the user:
所有路径均通过脚本动态计算,基于项目根目录下的 src/data/wiki/。
{
"wiki": {
"root": ["SCHEMA.md", "index.md", "log.md"],
"raw": {
"description": "原始资料(只读,不可修改)",
"articles": "网页文章/网络资料",
"papers": "论文/研究报告",
"transcripts": "对话记录/访谈",
"assets": "图片/附件资源"
},
"entities": "人物/组织档案",
"concepts": "概念/主题解析",
"comparisons": "对比分析",
"queries": "查询结果存档"
}
}
from skills.builtin.llm-wiki.scripts import get_wiki_path, print_structure
print(f"Wiki路径: {get_wiki_path()}")
print(f"目录结构: {print_structure()}")
from skills.builtin.llm-wiki.scripts import init_wiki
result = init_wiki()
print(result)
from skills.builtin.llm-wiki.scripts import search_wiki
results = search_wiki("关键词")
for r in results:
print(f"{r['file']} — {r['matches']}处匹配")
from skills.builtin.llm-wiki.scripts import lint_wiki
report = lint_wiki()
print(report)
from skills.builtin.llm-wiki.scripts import save_source
result = save_source("资料内容", category="articles", filename="my-source.md")
print(result)
src/data/wiki/
├── SCHEMA.md # Conventions, structure rules, domain config
├── index.md # Sectioned content catalog with one-line summaries
├── log.md # Chronological action log (append-only, rotated yearly)
├── raw/ # Layer 1: Immutable source material
│ ├── articles/ # Web articles, clippings
│ ├── papers/ # PDFs, arxiv papers
│ ├── transcripts/ # Meeting notes, interviews
│ └── assets/ # Images, diagrams referenced by sources
├── entities/ # Layer 2: Entity pages (people, orgs, products, models)
├── concepts/ # Layer 2: Concept/topic pages
├── comparisons/ # Layer 2: Side-by-side analyses
└── queries/ # Layer 2: Filed query results worth keeping
Layer 1 — Raw Sources: Immutable. The agent reads but never modifies these.
Layer 2 — The Wiki: Agent-owned markdown files. Created, updated, and cross-referenced by the agent.
Layer 3 — The Schema: SCHEMA.md defines structure, conventions, and tag taxonomy.
| 操作 | 可用工具 | 说明 |
|---|---|---|
| 读取文件 | read_file | 读取任意文件内容 |
| 写入文件 | write_file | 创建或覆盖文件 |
| 追加文件 | write_file(append=true) | 追加内容到文件末尾 |
| 修改文件 | patch_file | 替换文件中的指定内容 |
| 运行命令 | terminal | 执行shell命令(创建目录、移动文件等) |
| 运行Python | python_repl | 执行Python代码(调用脚本) |
| 搜索网络 | tavily_search | 联网搜索信息 |
| 搜索记忆 | _message_search_tool | 搜索历史对话 |
When the user has an existing wiki, always orient yourself before doing anything:
① Read SCHEMA.md — understand the domain, conventions, and tag taxonomy.
② Read index.md — learn what pages exist and their summaries.
③ Scan recent log.md — read the last 20-30 entries to understand recent activity.
from skills.builtin.llm-wiki.scripts import get_wiki_path
wiki = get_wiki_path()
# 使用 read_file 工具读取
# read_file(str(wiki / "SCHEMA.md"))
# read_file(str(wiki / "index.md"))
# read_file(str(wiki / "log.md"), offset=<last 30 lines>)
Only after orientation should you ingest, query, or lint. This prevents:
When the user asks to create or start a wiki:
init_wiki() 创建目录结构SCHEMA.md customized to the domain (see template below)index.md with sectioned headerlog.md with creation entryAdapt to the user's domain. The schema constrains agent behavior and ensures consistency:
# Wiki Schema
## Domain
[What this wiki covers — e.g., "魔女岛回忆", "AI/ML research", "personal health"]
## Conventions
- File names: lowercase, hyphens, no spaces (e.g., `witch-island-history.md`)
- Every wiki page starts with YAML frontmatter (see below)
- Use `[[wikilinks]]` to link between pages (minimum 2 outbound links per page)
- When updating a page, always bump the `updated` date
- Every new page must be added to `index.md` under the correct section
- Every action must be appended to `log.md`
- **Provenance markers:** On pages that synthesize 3+ sources, append `^[raw/articles/source-file.md]`
at the end of paragraphs whose claims come from a specific source.
## Frontmatter
```yaml
---
title: Page Title
created: YYYY-MM-DD
updated: YYYY-MM-DD
type: entity | concept | comparison | query | summary
tags: [from taxonomy below]
sources: [raw/articles/source-name.md]
# Optional quality signals:
confidence: high | medium | low
contested: true
contradictions: [other-page-slug]
---
---
source_url: https://example.com/article
ingested: YYYY-MM-DD
sha256: <hex digest of the raw content below the frontmatter>
---
[Define 10-20 top-level tags for the domain. Add new tags here BEFORE using them.]
Rule: every tag on a page must appear in this taxonomy. If a new tag is needed, add it here first, then use it. This prevents tag sprawl.
_archive/, remove from indexOne page per notable entity. Include:
One page per concept or topic. Include:
Side-by-side analyses. Include:
When new information conflicts with existing content:
contradictions: [page-name]
### index.md Template
```markdown
# Wiki Index
> Content catalog. Every wiki page listed under its type with a one-line summary.
> Read this first to find relevant pages for any query.
> Last updated: YYYY-MM-DD | Total pages: N
## Entities
<!-- Alphabetical within section -->
## Concepts
## Comparisons
## Queries
# Wiki Log
> Chronological record of all wiki actions. Append-only.
> Format: `## [YYYY-MM-DD] action | subject`
> Actions: ingest, update, query, lint, create, archive, delete
> When this file exceeds 500 entries, rotate: rename to log-YYYY.md, start fresh.
## [YYYY-MM-DD] create | Wiki initialized
- Domain: [domain]
- Structure created with SCHEMA.md, index.md, log.md
When the user provides a source (URL, file, paste), integrate it into the wiki:
① Capture the raw source:
tavily_search to get content, then save_source() to storesave_source() to store② Discuss takeaways with the user.
③ Check what already exists — read index.md to find existing pages.
④ Write or update wiki pages:
updated date[[wikilinks]]⑤ Update navigation:
index.mdlog.md⑥ Report what changed.
When the user asks a question about the wiki's domain:
① Read index.md to identify relevant pages.
② Read the relevant pages using read_file.
③ Synthesize an answer from the compiled knowledge. Cite the wiki pages.
④ File valuable answers — create a page in queries/ or comparisons/.
⑤ Update log.md.
When the user asks to lint, health-check, or audit the wiki:
from skills.builtin.llm-wiki.scripts import lint_wiki
report = lint_wiki()
# 检查 orphan_pages, broken_links, frontmatter_issues, large_pages 等
① Orphan pages: Pages with no inbound [[wikilinks]].
② Broken wikilinks: [[links]] pointing to non-existent pages.
③ Index completeness: Compare filesystem against index entries.
④ Frontmatter validation: Check required fields.
⑤ Stale content: Pages with updated date >90 days old.
⑥ Contradictions: Pages with conflicting claims.
⑦ Quality signals: Pages with confidence: low.
⑧ Page size: Flag pages over 200 lines.
⑨ Tag audit: Flag tags not in SCHEMA.md taxonomy.
⑩ Log rotation: If log.md exceeds 500 entries, rotate it.
⑪ Report findings grouped by severity.
⑫ Append to log.md.
raw/ — sources are immutable. Corrections go in wiki pages.[[wikilinks]].