AI Engineeringllm wiki

Turning Your Docs Into a Self-Building Wiki with nashsu/llm_wiki

P&C

Prompt & Circuit Editorial

May 16, 2026 · 12 Min Read

Turning Your Docs Into a Self-Building Wiki with nashsu/llm_wiki

If you have used a "chat with your PDFs" tool for more than a few days, you have probably noticed that it does not get any smarter about your documents. Ask a related question tomorrow and it goes back to the same raw text and works the answer out again from scratch.

That is not a bug in any one product. It is how most document chat is built. This article looks at a different approach, Andrej Karpathy's "LLM Wiki" pattern, and at nashsu/llm_wiki, an open-source desktop app that implements it.

TL;DR

  • Classic retrieval-augmented generation (RAG) retrieves chunks of source text at query time. Nothing the model works out is kept for next time.
  • Karpathy's LLM Wiki pattern has an LLM incrementally build and maintain a persistent Markdown wiki from your sources, so knowledge is "compiled once and then kept current".
  • nashsu/llm_wiki is a cross-platform desktop app (Tauri, Rust and React) that implements the pattern, with a two-step ingest, a review queue, a knowledge graph view and Obsidian-compatible output.
  • It works with cloud LLM providers or local models through Ollama. It is GPL-3.0 licensed.

How most document chat works

The common pipeline, descended from the 2020 RAG paper by Lewis et al., looks like this:

  1. Split documents into chunks.
  2. Embed each chunk.
  3. Store the embeddings in a vector index.
  4. At query time, retrieve the most similar chunks.
  5. Pass them to the LLM with the question.

This works well for direct lookups. Its limit is that the index is a store of raw text, not of understanding. If answering a question requires connecting facts from five documents, the model has to find and connect them again every time. Karpathy's gist puts it bluntly: the LLM "is rediscovering knowledge from scratch on every question. There's no accumulation."

Karpathy's LLM Wiki pattern

In April 2026 Andrej Karpathy published a short design note, llm-wiki.md, as a GitHub gist. Its central idea is that the LLM "incrementally builds and maintains a persistent wiki", which becomes "a persistent, compounding artifact".

The pattern has three layers:

  • Raw sources: your curated documents. The LLM reads them but never modifies them.
  • The wiki: LLM-generated Markdown pages that the LLM owns and maintains.
  • The schema: a configuration document, such as a CLAUDE.md or AGENTS.md file, that defines the wiki's structure and workflows.

And three operations:

  • Ingest: add a source and the LLM updates the wiki. The gist notes that a single source might touch 10 to 15 pages.
  • Query: ask questions against the wiki and get answers with citations. Good answers can be filed back into the wiki.
  • Lint: periodically ask the LLM to health-check the wiki for contradictions, stale claims, orphan pages and gaps.

Two special files keep it navigable: index.md, a content-oriented catalogue of pages, and log.md, an append-only record of ingests, queries and lint passes. Karpathy relates the idea to Vannevar Bush's Memex (1945). The gist deliberately stops at the pattern and ends: "Your LLM can figure out the rest."

What nashsu/llm_wiki adds

nashsu/llm_wiki turns that abstract pattern into a desktop application. Its README describes it as "a cross-platform desktop application that turns your documents into an organized, interlinked knowledge base". It is built with Tauri v2, a Rust backend and a React and TypeScript frontend, and it keeps Karpathy's layers, operations, index.md, log.md, [[wikilinks]] and YAML front matter.

The main additions documented in the README are:

  • Two-step ingest. First the LLM analyses a source and writes structured notes on entities, concepts, connections to existing pages and contradictions. Then it uses that analysis to write source summaries and entity and concept pages and to update index.md, log.md and overview.md. A SHA-256 cache skips unchanged files, and a persistent queue retries failed ingests.
  • purpose.md. Alongside the schema, a purpose file records goals, key questions, scope and an evolving thesis. In the README's words, "schema is structural rules, purpose is directional intent."
  • Review queue. The LLM flags items that need human judgement, and you choose to create a page, run deeper research or skip. Review runs asynchronously, so it does not block ingest.
  • Knowledge graph view. Pages and links are visualised as a graph, with community detection to find clusters and "Graph Insights" that highlight surprising connections and gaps.
  • Broad file support. PDF, Word, PowerPoint, spreadsheets, EPUB, Markdown, images, audio and video, plus web clips from a companion Chrome extension. Complex PDFs can optionally go through MinerU for parsing.

How queries work

Despite the wiki-first design, retrieval does not disappear; it moves from raw chunks to curated pages. According to the README, a query goes through:

  1. Keyword search over wiki pages.
  2. Optional vector search over an OpenAI-compatible embeddings endpoint, stored in LanceDB. It is off by default. The project reports that enabling it raised recall in its own tests from 58.2% to 71.4%.
  3. Expansion through graph relationships between pages.
  4. Allocation of a context budget.
  5. Assembly of numbered pages so the LLM can cite them.

A "Read Sources Only" mode answers strictly from imported material.

Where your data lives

Everything is ordinary files on disk. A project folder holds purpose.md, schema.md, the raw sources and a wiki/ folder of Markdown pages. The wiki folder works as an Obsidian vault, so you can browse and edit it outside the app. App state, such as chat histories and review items, is kept in a .llm-wiki/ folder.

Models and privacy

The app supports OpenAI, Anthropic, Google, Ollama and custom OpenAI-compatible endpoints. With a local model through Ollama, and MinerU in a local mode for PDFs, the content stays on your machine. With a cloud provider, your documents go to that provider during ingest and query, as with any hosted LLM. Optional web search integrations (Tavily, SerpApi, SearXNG) also make external calls. "Local-first" is a choice you configure, not a guarantee.

Automation and integrations

There is no Python command-line tool. For scripting, the app exposes a token-protected local HTTP API on 127.0.0.1, covering projects, files, review items, search, chat and graph queries. The repository also ships an MCP server that calls the same API, so agent tools can read and query the wiki.

Getting started

  1. Download a build for your platform from the repository's Releases page: .dmg for macOS on Apple Silicon, .msi for Windows, .deb or .AppImage for Linux.
  2. Configure an LLM provider, or point it at a local Ollama model.
  3. Create a project, write a short purpose.md describing what the knowledge base is for, and import a handful of documents.
  4. Work through the review queue, then start asking questions.

To build from source, the README lists Node.js 20 or later, Rust 1.88 or later and protoc, followed by npm install and npm run tauri dev.

Trade-offs to weigh

  • Ingest costs more up front. Each source is analysed and written into several pages, so ingest uses more LLM calls than embedding chunks. The pay-off comes when you query the same material repeatedly.
  • The wiki is LLM-written. Summaries and cross-links can be wrong. The review queue and lint step exist for that reason, and the sources remain the ground truth.
  • Model quality matters. Small local models produce weaker analysis and pages than large hosted ones.
  • Scale. The pattern relies on index pages and links for navigation. Very large corpora need periodic linting and good structure to stay usable.
  • Licence. The GPL-3.0 licence matters if you plan to modify and redistribute the app.

Bottom line

For one-off questions about a single document, a standard chat-with-PDF tool is fine. For a body of material you will keep returning to, such as a research area, a product's design history or a long-running project, an LLM-maintained wiki is a meaningful step forward: what the model works out is written down, linked and reviewable rather than thrown away after each answer. nashsu/llm_wiki is one of the most complete open-source implementations of that idea, and because its output is plain Markdown, trying it does not lock you in.

Sources

Tags:llm wikiknowledge baseragopen sourceobsidian
Share Article

Responses (0)

Sign in to join the conversation and share your thoughts.

P&C

Prompt & Circuit Editorial

Contributing Editor

Articles on AI infrastructure for cloud architects, written from official vendor sources and checked claim by claim before publishing.