akm docs

LLM Wikis

akm supports Andrej Karpathy's LLM Wiki pattern: a markdown-based knowledge base that an LLM agent maintains together with a human, on a filesystem it can read and write directly, with no special SDK.

An LLM wiki is a bundle format, not an asset type: the LLM Wiki adapter recognizes it, and there is no akm wiki command.

The design

A wiki is a directory. Full stop.

<wiki-root>/
  schema.md                  rulebook the agent reads first
  index.md                   catalog of pages, regenerable
  log.md                     append-only activity log
  raw/                       immutable ingested sources (never edit)
  pages/<page>.md            agent-authored pages
  pages/<topic>/<page>.md    optional nesting

Three layers, from Karpathy's gist:

Principle — akm surfaces, the agent writes

Karpathy's workflow is a conversation between a human, an agent, and a filesystem. akm is not that agent. Page writes — create, append, xref, log — all use the agent's native Read / Write / Edit tools. akm's job is recognition and discovery: it mounts the wiki, indexes the pages, and makes them searchable alongside every other asset.

How akm sees a wiki

The LLM Wiki adapter recognizes a wiki when the bundle is added: a bundle component whose root holds a schema.md plus a pages/ directory is mounted as an llm-wiki component. From there:

A wiki kept inside an ordinary akm bundle (for example wikis/articles/, with its own schema.md and pages/) is indexed by the akm adapter: its raw/**.md files are wiki-source too, at their bundle-relative ref (bundle//wikis/articles/raw/<slug>), and its pages keep their akm type.

Working with a wiki

akm bundle add github:team/research-wiki        # install a wiki bundle (or point at a local dir)
akm search "attention"                   # pages rank alongside all other indexed content
akm show research-wiki//pages/attention  # read a page by ref
akm show research-wiki//pages/attention#history

To build a new wiki, create the directory shape above by hand (or have your agent do it — schema.md plus an empty pages/ is enough for recognition), then add it as a bundle. Ingesting raw sources, writing pages, and maintaining index.md/log.md are the agent's job, guided by schema.md.