okf-kb-template
Copier template for LLM-maintained knowledge bases: OKF v0.2 bundle + Obsidian vault
okf-kb-template
A Copier template for personal knowledge
bases that LLM agents maintain, following Andrej Karpathy's
LLM wiki
pattern. The pages live in one folder of the repository (named after the
knowledge base by default; kb/ before v0.5.0), which is both a conformant
Open Knowledge Format v0.2
bundle and, optionally, an Obsidian vault. You work
with a command-line agent (Claude Code, Codex, Gemini CLI) through three
skills: ingest, query and maintain. A small kb tool, hooks, pre-commit
and CI keep the bundle valid at every commit.
Documentation: https://egparedes.github.io/okf-kb-template/
(source in docs/).
Quick start
Requirements: git and uv; optionally Obsidian 1.13.7 or later.
uvx copier copy --trust gh:egparedes/okf-kb-template my-kb
cd my-kb
uv run poe setup # git init, pre-commit hook, indexes; uv installs the tooling
uv run poe obsidian-setup # then open my-kb/ with Open folder as vault
claude # or codex, or gemini
Then ask the agent to ingest a URL. The
first tutorial
explains each step, and uv run poe lists the other
tasks. To
pull later template changes into a knowledge base, run
uvx copier update --trust in it.
Develop
uv sync
uv run poe test # renders several configurations and runs each result's checks
uv run poe lint # ruff (lint, format check) and mypy; `uv run ruff format` fixes the formatting
uv run poe render [DEST] # renders the working tree with defaults into DEST (default /tmp/okf-kb-preview)
uv run poe docs-serve # preview the documentation site on http://localhost:8000
uv run poe docs # build it into site/ (strict)
uv run poe lists these tasks; they are defined in [tool.poe.tasks] of
pyproject.toml.
CI (.github/workflows/template.yml) runs uv run poe test from the
locked environment (uv sync --locked) on Linux, macOS and Windows, with
Python 3.11 and 3.14; the Linux job with Python 3.11 runs in the C locale
without UTF-8 mode, which catches file access that relies on the platform's
default encoding. The Linux job with Python 3.14 also runs uv run poe lint:
ruff over tests/, launcher/ and the template's tooling, mypy over
tests/ and launcher/. The tooling is type-checked in a rendered knowledge
base (its own poe lint, which tests/test_template.py runs). docs.yml builds the documentation site; links.yml
checks its external links on demand. The actions are pinned by commit SHA
and .github/dependabot.yml proposes updates weekly. Dependabot reads only
.github/workflows/, not the knowledge base's kb.yml inside template/:
tests/test_workflows.py fails until kb.yml uses the same pins, so update
it in the Dependabot pull request.
.gitattributes keeps LF line endings in every checkout: Copier renders
files byte for byte, so a CRLF checkout would produce CRLF knowledge bases.
Tag releases (v0.1.0, …) and push the tags with the commits
(git push origin main --tags). Generated knowledge bases record the tag
in .copier-answers.yml, and copier update moves between tags.
Licence
MIT-0. Knowledge bases generated from the template carry no licence obligations for the tooling copied into them. Obsidian plugins are downloaded from their authors at setup time, not bundled, and keep their own licences.
Credits
- The workflow follows Andrej Karpathy's LLM wiki pattern.
- The file format follows Google's Open Knowledge Format.
- Independent conformance checks use scaccogatto/okf-skills, pinned and fetched at run time.
- The maintenance analytics (
kb graph,kb dupes,kb unlinked) are inspired by Ar9av/obsidian-wiki and reimplemented deterministically. tools/retrieval-eval/questions.yamlis a hand-maintained set of questions for judging whether a heavier search tier is worth enabling.kb evalmeasures, deterministically, which tiers reach the expected pages.
How to Install
- Download the ZIP or clone the repository
- Open the folder as a vault in Obsidian (File → Open Vault)
- Obsidian will prompt you to install required plugins
Stats
Stars
1
Forks
0
License
MIT-0
Last updated 1mo ago