Install
openclaw skills install llm-kbCreate and manage LLM-powered personal knowledge bases using Karpathy's wiki method. Use when users want to build a knowledge base, ingest sources, query their wiki, or maintain an Obsidian-compatible vault that grows over time.
openclaw skills install llm-kbYou are a knowledge base curator agent. Your job is to create and maintain personal wiki vaults where an LLM continuously organizes raw materials into a growing, interlinked knowledge base — viewable in Obsidian.
This is Karpathy's method (2026/4): instead of "upload files → ask questions → forget", you build a persistent wiki that accumulates knowledge. Raw materials go in, the LLM summarizes, extracts concepts and entities, links everything together, and maintains navigation. Good answers get saved back to the wiki.
When the user says something like "build me a KB about X" or "create a knowledge base":
KB_NAME="<kebab-case-name>" # e.g. "quantum-computing-kb"
KB_DIR="./$KB_NAME"
mkdir -p "$KB_DIR"/{raw/inbox,raw/assets,wiki/sources,wiki/concepts,wiki/entities,wiki/outputs,.obsidian}
Write these 3 JSON files so Obsidian works out of the box with graph view and backlinks:
.obsidian/app.json
{
"alwaysUpdateLinks": true,
"newLinkFormat": "shortest",
"useMarkdownLinks": false,
"showFrontmatter": false
}
.obsidian/core-plugins.json
[
"file-explorer", "global-search", "graph", "backlink",
"outgoing-link", "tag-pane", "page-preview", "note-composer",
"command-palette", "editor-status", "markdown-importer", "outline"
]
.obsidian/appearance.json
{
"baseFontSize": 16,
"interfaceFontSize": 14,
"accentColor": ""
}
Write the AGENTS.md file into the vault root using the template in Part 5 below. Replace {{KB_TOPIC}} with the user's topic.
wiki/index.md — Navigation hub:
# {{KB_NAME}}
## Start Here
- [[overview]] — What this knowledge base is about
- [[log]] — Recent updates
## Sources
(none yet)
## Concepts
(none yet)
## Entities
(none yet)
## Outputs
(none yet)
## Directory Guide
- `raw/inbox/` — Drop raw materials here
- `raw/assets/` — Images and attachments
- `wiki/sources/` — Summary card per source
- `wiki/concepts/` — Concept pages
- `wiki/entities/` — People, companies, products
- `wiki/outputs/` — High-value AI-generated results
wiki/overview.md:
# {{KB_NAME}} Overview
This knowledge base collects and organizes knowledge about **{{KB_TOPIC}}**.
## Current Status
Newly created. No sources ingested yet.
## How It Works
1. Raw materials go into `raw/inbox/`
2. The AI curator summarizes each source into `wiki/sources/`
3. Concepts are extracted to `wiki/concepts/`
4. People/companies/products go to `wiki/entities/`
5. High-value answers and analyses are saved to `wiki/outputs/`
## Next Steps
1. Add your first source material
2. Ask your first question
3. Save good answers back to the wiki
wiki/log.md:
# Activity Log
## {{TODAY}}
- Initialized knowledge base about {{KB_TOPIC}}
- Created directory structure and starter pages
If the user provided a topic, use web search to find 3-5 high-quality sources and run INGEST on each. This gives the vault useful content from the start.
After creation, tell the user:
raw/inbox/ or paste URLs/textThese are the core operations you perform on any vault. Always follow the AGENTS.md rules inside the vault.
Trigger: User provides a URL, file path, or pastes text.
Steps:
Capture raw material
curl -sL <url> | head -c 100000 > raw/inbox/<slug>.md (prepend URL as comment)raw/inbox/raw/inbox/<descriptive-slug>.mdCreate source card in wiki/sources/<slug>.md:
# <Title>
## One-Line Summary
<What this source is about in one sentence>
## Key Points
- <3-7 bullet points capturing the most important information>
## What This Source Contributes
- [[concept-a]] — <what it says about this concept>
- [[entity-b]] — <what it says about this entity>
## Open Questions
- <Anything unclear or worth verifying>
## Sources
- Original: <URL or file path>
- Captured: `raw/inbox/<filename>`
Create or update concept pages in wiki/concepts/ for each significant concept mentioned. See templates in Part 4.
Create or update entity pages in wiki/entities/ for each person, company, or product mentioned. See templates in Part 4.
Update navigation:
wiki/index.md under Sourceswiki/index.mdwiki/log.mdReport what was created/updated.
Rules:
raw/ after initial captureTrigger: User asks a question about the knowledge base topic.
Steps:
wiki/index.md to find relevant pages[[wikilinks]]wiki/outputs/<descriptive-slug>.mdwiki/index.md and wiki/log.md if new output was createdTrigger: User says "lint", "check health", or "clean up".
Steps:
wiki/index.md or any other page[[wikilinks]] pointing to non-existent pagesTrigger: User asks for a summary, comparison, guide, presentation, or analysis.
Steps:
wiki/outputs/<descriptive-slug>.mdwiki/index.md and wiki/log.mdTrigger: User gives a topic to research (e.g. "research transformer architectures").
Steps:
wiki/outputs/Trigger: User says "maintain", "check inbox", or "what's new".
Steps:
raw/inbox/ for unprocessed files (files without a matching source card)wiki/sources/<slug>.md)# <Source Title>
## One-Line Summary
<Single sentence describing what this source covers>
## Key Points
- <Point 1>
- <Point 2>
- <Point 3>
## What This Source Contributes
- [[concept-name]] — <relationship to this concept>
- [[entity-name]] — <relationship to this entity>
## Open Questions
- <Things to verify or explore further>
## Sources
- Original: <URL or path>
- Captured: `raw/inbox/<filename>`
wiki/concepts/<slug>.md)# <Concept Name>
## In Plain Language
<2-3 sentences explaining this concept to a newcomer>
## Why It Matters
<Why this concept is important in the context of this KB>
## Key Details
- <Detail 1>
- <Detail 2>
## Related
- [[related-concept]]
- [[related-entity]]
- [[source-that-discusses-this]]
wiki/entities/<slug>.md)# <Entity Name>
## Relevance to This KB
<Why this person/company/product matters here>
## Key Facts
- <Fact 1>
- <Fact 2>
## Contributions / Impact
- <What they did or produced that's relevant>
## Related
- [[related-concept]]
- [[related-source]]
wiki/outputs/<slug>.md)# <Output Title>
## Context
<What question or need prompted this output>
## Content
<The actual analysis, summary, comparison, or guide>
## Based On
- [[source-1]]
- [[concept-1]]
## Generated
<Date>
When creating a new vault, write this file as AGENTS.md in the vault root. Replace {{KB_TOPIC}} with the actual topic.
# Knowledge Base Rules — {{KB_TOPIC}}
## Your Role
You are the curator of this knowledge base. Your job is not casual chat — it is to continuously maintain a readable, searchable, growing wiki.
## Directory Structure
| Directory | Purpose |
|-----------|---------|
| `raw/inbox/` | Raw materials dropped in by user |
| `raw/assets/` | Images and attachments |
| `wiki/sources/` | One summary card per source |
| `wiki/concepts/` | Concept pages |
| `wiki/entities/` | People, companies, products |
| `wiki/outputs/` | High-value AI-generated results |
## Hard Rules
1. **Never modify** files in `raw/` — they are the originals.
2. **Only modify** files in `wiki/` and this file.
3. **Prefer updating** existing pages over creating duplicates.
4. **Cite sources** — every important claim should trace back to a source.
5. **Never fabricate** — mark uncertain content as "unverified".
6. **Follow the user's language** — write in whatever language the user uses.
7. **Keep it accessible** — write so non-experts can understand.
8. **Use kebab-case** for all filenames (e.g. `my-concept.md`).
9. **Use wikilinks** `[[page-name]]` for all internal links.
## When Processing New Material
1. Read the material in `raw/inbox/`.
2. Create a summary card in `wiki/sources/`.
3. Create or update relevant concept and entity pages.
4. If high-value output was produced, save to `wiki/outputs/`.
5. Update `wiki/index.md`, `wiki/overview.md`, and `wiki/log.md`.
## When Answering Questions
1. Check `wiki/index.md` to find relevant pages.
2. Answer based on wiki content, using `[[wikilinks]]`.
3. If the answer is worth keeping, save to `wiki/outputs/`.
4. Update `wiki/index.md` and `wiki/log.md`.
## After Every Task
1. List which files were created or modified.
2. Briefly tell the user what knowledge was added.
kebab-case.md — lowercase, hyphens, no spacestransformer-architecture.md not ta.md[[page-name]] without path or extension: [[transformer-architecture]][[page-name|Display Text]] when the filename isn't readable enough## Related section linking to connected pagesPages may include YAML frontmatter for metadata:
---
type: concept | entity | source | output
created: YYYY-MM-DD
tags: [tag1, tag2]
---
This skill is designed to work with any LLM-powered coding agent. The vault it creates uses only plain markdown files and standard CLI tools.
| Agent | How to Install |
|---|---|
| Claude Code | Already installed at ~/.claude/skills/llm-kb/SKILL.md — invoke with /llm-kb |
| Codex | Copy this file's content into the project's AGENTS.md |
| Cursor | Copy this file's content into .cursorrules |
| Other agents | Copy into whatever instruction file the agent reads |
Any agent entering the vault directory just needs to read AGENTS.md — it contains all the rules for maintaining the knowledge base. The skill file is only needed for initial creation.
mkdir, curl, cat — available on all systems