Llm knowledge base
Set up a safe, local LLM knowledge base with immutable sources and an agent-maintained Markdown wiki.
npx -y skills add hey-dmitri/llm-knowledgebase --skill llm-knowledge-baseAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Set up and maintain a local, file-based knowledge base with immutable raw sources, an agent-maintained Markdown wiki, and generated outputs. Use when a user asks to create an LLM wiki, personal knowledge base, AI-assisted second brain, Obsidian knowledge system, or a persistent alternative to reprocessing source files for every question.
SKILL.md
5.4 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it
LLM Knowledge Base
Build a personal knowledge base based on Andrej Karpathy's LLM Wiki pattern. Keep raw sources unchanged. Incrementally maintain a linked Markdown wiki. Save useful analyses as durable outputs.
Original pattern: https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f
Confirm the setup
Before writing files, establish:
- The target directory. Default to the current working directory only when that is clearly the intended project.
- The topics or domains the knowledge base should cover.
- Whether existing files should be included as raw sources.
- The host agent. Use
AGENTS.mdfor Codex andCLAUDE.mdfor Claude Code. For another agent, use its documented project-instruction filename.
Ask only for missing information. Do not infer personal domains from unrelated context.
Inspect the target before editing. If files or directories already exist, preserve them and explain any conflicts. Do not overwrite an existing agent instruction file without the user's approval.
Create the structure
Create only the directories that are useful for the user's sources:
raw/
articles/
papers/
notes/
images/
wiki/
_templates/
index.md
log.md
outputs/
AGENTS.md or CLAUDE.md
Use .gitkeep files when the user wants empty directories tracked by Git.
Create the agent instructions
Read assets/agent-guidelines-template.md. Adapt it to the chosen domains and instruction filename, then write it to the target directory.
Keep paths project-relative so the knowledge base remains portable. Preserve any existing project instructions unless the user explicitly approves a replacement. If an instruction file already exists, propose a scoped addition instead of silently replacing it.
Create the core files
Create wiki/index.md:
---
type: index
updated: YYYY-MM-DD
---
# Wiki Index
## By Domain
### Domain name
## Recently Added
Create wiki/log.md:
---
type: log
---
# Operations Log
## [YYYY-MM-DD] init | Knowledge base created
- Created the raw, wiki, and outputs layers.
- Added the agent operating instructions.
- Based on Andrej Karpathy's LLM Wiki pattern.
Create wiki/_templates/entity.md:
---
type:
domain:
created: YYYY-MM-DD
updated: YYYY-MM-DD
sources: []
tags: []
---
# Title
## Summary
## Key Details
## Related
## Sources
Use real dates when creating files. Use the user's chosen domains in the index.
Handle existing content safely
If the user wants existing content included, copy it into the appropriate raw/ directory by default. Preserve the originals. Move or delete source files only with explicit approval.
Do not ingest secrets, credentials, private keys, or material the user is not allowed to copy. Flag likely sensitive files before copying them.
After copying approved sources, process them one at a time unless the user requests a batch:
- Read the source fully.
- Summarize the important claims and provenance.
- Create or update relevant wiki pages.
- Add cross-references.
- Update
wiki/index.md. - Append an entry to
wiki/log.md.
Prefer updating a relevant page over creating a near-duplicate.
Explain the operating loop
Give the user three simple commands or prompts:
- Ingest: Process a named file in
raw/. Update the wiki, index, and log. - Query: Answer from the wiki and cite the relevant wiki pages and raw sources.
- Lint: Find contradictions, stale claims, missing citations, duplicate topics, orphan pages, and broken links.
Recommend a lint pass after a meaningful batch of ingests or when the wiki starts to feel inconsistent. Do not claim that monthly is the right schedule for every knowledge base.
Maintain provenance
- Treat
raw/as immutable unless the user explicitly asks to correct a source file. - Cite raw sources from derived wiki pages.
- Distinguish source claims from agent inference.
- Record contradictions instead of silently choosing one claim.
- Include dates on time-sensitive claims.
- Never present an agent-generated synthesis as a primary source.
Adapt to the user's tools
The pattern works best with an agent that has persistent filesystem access.
- For Codex, use
AGENTS.md. - For Claude Code, use
CLAUDE.md. - For Obsidian, keep
[[wiki-links]]and optional YAML frontmatter. - For editors without wiki-link support, use standard Markdown links if the user prefers them.
- For chat products that only support file uploads, explain that updates and file organization will be manual between sessions.
Do not require Obsidian, Dataview, a vector database, or external command-line tools. Offer them only when they solve a stated need.
Finish with verification
Before reporting completion:
- Confirm the expected directories and core files exist.
- Confirm the instruction filename matches the selected agent.
- Check that no existing files were overwritten unexpectedly.
- Check that every generated wiki page cites at least one source or is clearly labeled as an inference.
- Summarize what was created and give one concrete first-ingest prompt.