LLM Memory With Obsidian (2026): Karpathy's LLM Wiki Pattern

8 min read

Yes, Obsidian can be LLM memory: an agent keeps a Markdown wiki built from your sources, after Karpathy's LLM Wiki gist (April 2026).

Using Obsidian as LLM memory means letting an AI agent write and maintain a folder of linked Markdown notes that you browse in Obsidian. The best-known version is Andrej Karpathy’s LLM Wiki, published as a gist in April 2026. You drop sources into a folder, the agent compiles them into wiki pages, and both of you read the wiki instead of re-searching raw documents.

This page explains what Karpathy actually proposed, how to set it up with Obsidian, the tools that help it scale, and when a memory server fits better. The main source is Karpathy’s LLM Wiki gist, dated April 4, 2026.

What is Karpathy’s LLM Wiki?

The LLM Wiki is a pattern where an LLM agent incrementally builds and maintains a persistent, interlinked Markdown wiki from source documents you collect. Knowledge is compiled once and kept current, rather than retrieved from raw text on every question. Obsidian is the viewer; the agent does the writing.

Karpathy’s one-line summary in the gist: “Obsidian is the IDE; the LLM is the programmer; the wiki is the codebase.” He calls the wiki “a persistent, compounding artifact.”

The gist is an “idea file,” not code. Karpathy says it’s deliberately abstract so you can paste it into your own agent and have it build a version for your domain. That’s why many slightly different implementations exist.

The three layers

LayerWho writes itWhat it holds
Raw sourcesYouArticles, papers, transcripts, images. Immutable; the LLM reads but never edits them
The wikiThe LLMSummaries, entity and concept pages, comparisons, an overview. “You read it; the LLM writes it.”
The schemaYou and the LLM, over timeA config file like CLAUDE.md or AGENTS.md that sets structure, conventions and workflows

Two special files keep it navigable:

  • index.md: a catalog of every page with a link and a one-line summary. The agent reads it first when answering a question. Karpathy says this works well at moderate scale without embedding-based RAG.
  • log.md: an append-only record of ingests, queries and lint passes, with greppable headings like ## [2026-04-02] ingest | Article Title.

The three operations

  1. Ingest. Add one source. The agent reads it, discusses takeaways with you, writes a summary page, updates the index, revises related pages and appends to the log. Karpathy says one source may touch 10 to 15 pages, and he prefers ingesting one at a time.
  2. Query. Ask a question. The agent reads the index and relevant pages and answers with citations. Good answers get filed back into the wiki, so exploration compounds.
  3. Lint. Periodically, the agent checks for contradictions, stale claims, orphan pages, missing concepts and missing cross-references.

Karpathy’s argument for why this works: knowledge bases fail on maintenance, because “the maintenance burden grows faster than the value.” LLMs do the bookkeeping at near-zero cost. He links it to Vannevar Bush’s 1945 Memex: “The part he couldn’t solve was who does the maintenance. The LLM handles that.”

How to set it up with Obsidian

A minimal setup, following the gist:

  1. Create a vault and add folders: raw/ for sources, wiki/ for pages.
  2. Write a schema file (CLAUDE.md or AGENTS.md) at the root: page types, naming, link style ([[wikilinks]]), what goes in index.md and log.md, and the ingest, query and lint steps. Tell the agent never to edit raw/.
  3. Clip sources with the Obsidian Web Clipper extension, which saves web articles as Markdown. Karpathy also binds a hotkey to download attachments so images are stored locally.
  4. Run a coding agent in the vault folder. Claude Code, Codex or any agent that reads and writes files will work, because the schema file is the same kind of instruction file they already load; see AI coding agent memory. For Codex, name the schema file AGENTS.md so it loads on every run (how Codex loads AGENTS.md).
  5. Browse in Obsidian. Graph view shows hubs and orphan pages. Dataview can build tables from page frontmatter, and Marp turns pages into slides.
  6. Commit to git. The wiki is a repo of Markdown, so you get history and can review what the agent changed.

Ingest one source, read what changed, correct the schema, repeat. The schema co-evolves with you.

A small lint script

The lint step can be partly mechanical. This stdlib Python script finds broken [[wikilinks]] and orphan pages that nothing links to, which you can hand to the agent as a to-do list:

 1import re
 2import sys
 3from pathlib import Path
 4
 5LINK = re.compile(r"\[\[([^\]|#]+)")
 6
 7def lint(wiki_dir: str) -> None:
 8    pages = {p.stem: p for p in Path(wiki_dir).rglob("*.md")}
 9    linked = set()
10    for name, path in pages.items():
11        for target in LINK.findall(path.read_text(encoding="utf-8")):
12            target = target.strip()
13            linked.add(target)
14            if target not in pages:
15                print(f"broken link: {name} -> {target}")
16    for name in sorted(set(pages) - linked - {"index", "log"}):
17        print(f"orphan page: {name}")
18
19if __name__ == "__main__":
20    lint(sys.argv[1] if len(sys.argv) > 1 else "wiki")

Scaling past index.md

An index file stops working once the wiki has thousands of pages. Options:

  • qmd. Karpathy mentions qmd, a local Markdown search engine with BM25, vector search and LLM reranking, all on-device. It has a CLI and an MCP server (qmd mcp) with tools like query and get.
  • Obsidian CLI. Obsidian has an official command-line interface (it needs the 1.12 installer) that talks to the running app: obsidian search query="...", obsidian read, obsidian create. An agent can call it from a shell.
  • Basic Memory. An AGPL-3.0 MCP server that stores notes as Markdown with an SQLite index. Point Obsidian at its folder and both see the same files. Version 1.0 (29 October 2026) renamed its MCP tools to bm_write, bm_read, bm_search and so on, so older prompts that call write_note need updating; the full list is in AI memory MCP servers.
  • OpenClaw Memory Wiki. OpenClaw’s memory-wiki plugin compiles agent knowledge into a vault with structured claims and evidence, and can write Obsidian-friendly Markdown.
  • A memory server over the vault. Hindsight’s Obsidian plugin (beta, installed through BRAT) syncs a vault one way into a Hindsight bank, tags notes by vault, folder and date, and answers questions with citations to the source notes; the vault stays the source of truth.

Dating notes by last edit (Hindsight v1.2.0)

A vault synced into a memory server has a dating problem: a note written in March and extended in October is one file with one date. Hindsight’s plugin used to send every re-synced note with its creation date, so text added months later got the old date, and a relative phrase like “in October” could be read against the wrong year. Hindsight v1.2.0 (3 November 2026) fixed this and a sync bug (PR #5967):

ChangeBefore v1.2.0Now
Date facts by setting (CLI: --timestamp-from created|updated)Notes always dated by creation timeChoose Last-edit time: uses the note’s frontmatter updated / modified, else the file’s modified time. Default is still creation time, so nothing changes unless you opt in
Note deleted or renamed after its server copy was already goneSync failed on that note every time; a renamed note was never uploadedTreated as already deleted; the sync finishes and the new path uploads

If your notes are journals or running logs that you keep appending to, switch to last-edit time. For notes written once and left alone, the default is fine. The same dating question matters for any memory over notes: see temporal reasoning in AI memory.

More options are compared on AI memory MCP servers.

LLM wiki vs RAG vs memory servers

LLM wiki (Obsidian)RAG over documentsAgent memory server
What’s storedLLM-written pages that synthesize sourcesRaw chunks of your documentsExtracted facts, events, entities
When work happensAt ingest: pages updated onceAt query: fragments re-found each timeAt write: facts extracted per message
Human-readableYes, browse in ObsidianOnly the source docsUsually through an API or UI
Best forResearch, reading, personal knowledgeLarge document setsChat and agent personalization
Weak spotErrors in pages propagate; ingest is slowNo synthesis across sourcesHard to audit by hand

The wiki pattern shines for one person or a small team building up understanding of a topic. It’s a poor fit for remembering thousands of users’ preferences, where a memory API is the right tool; see RAG vs agent memory and persistent memory in AI.

Anthropic tested the same pattern at scale in November 2026: a wiki that Claude built over 128 offline “dreaming” sessions on a 420M-token corpus took its answers from 13% to 48% of graded criteria on its own, and search plus wiki reached 61% against 53% for search alone, while on a single-document task the wiki gave no gain and grew larger than the sources. The numbers and the limits are in Claude dreaming and Managed Agents memory.

Risks to watch

  • Compounding errors. If the LLM misreads a source, the mistake spreads to every page it touches. Keep raw/ immutable so you can always check, and lint often.
  • Stale claims. Pages written early may contradict newer sources. The lint step exists for this.
  • Untrusted sources. A clipped page with hidden instructions can steer the agent while it edits your wiki. Review diffs before committing, especially for web clips.