Skip to main content

llm-knowledge-base

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.

Source facts

Repository
hey-dmitri/llm-knowledgebase
Last source activity
July 19, 2026 at 20:07
Detected SKILL.md language
English
Stars
0
Forks
0

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

File Explorer
3 files

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
llm-knowledge-base
description
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.
# 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: 1. The target directory. Default to the current working directory only when that is clearly the intended project. 2. The topics or domains the knowledge base should cover. 3. Whether existing files should be included as raw sources. 4. The host agent. Use `AGENTS.md` for Codex and `CLAUDE.md` for 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: ```text 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`: ```markdown --- type: index updated: YYYY-MM-DD --- # Wiki Index ## By Domain ### Domain name ## Recently Added ``` Create `wiki/log.md`: ```markdown --- 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`: ```markdown --- 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: 1. Read the source fully. 2. Summarize the important claims and provenance. 3. Create or update relevant wiki pages. 4. Add cross-references. 5. Update `wiki/index.md`. 6. 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: 1. Confirm the expected directories and core files exist. 2. Confirm the instruction filename matches the selected agent. 3. Check that no existing files were overwritten unexpectedly. 4. Check that every generated wiki page cites at least one source or is clearly labeled as an inference. 5. Summarize what was created and give one concrete first-ingest prompt.
View on GitHub