Most personal knowledge tools pair LLMs with standard RAG pipelines. Yet RAG searches raw chunks and regenerates answers on every query, burning tokens and latency while struggling to spot cross-document links or contradictions. To address this limitation, Andrej Karpathy proposed a pattern where an LLM incrementally builds and maintains a persistent wiki. LLM Wiki brings that pattern to life as an open-source cross-platform desktop app.

How the Wiki Pattern Differs from RAG

LLM Wiki persists analysis results as structured wiki pages and updates them incrementally only when new sources arrive. When a user imports a PDF or DOCX file, the app runs a Two-Step Chain-of-Thought ingestion pipeline. It first extracts core entities, concepts, and contradictions against existing pages, and then generates or updates wiki articles from that structured analysis. Relationships between pages feed into a Knowledge Graph built on [[wikilinks]] and a four-signal relatedness model, while Louvain community detection surfaces natural topic clusters. Instead of querying ephemeral chunks, users converse with an evolving personal wiki.

Two-Step Ingestion and Purpose-Driven Structuring

LLM Wiki follows Karpathy’s three-layer architecture: raw sources, LLM-generated wiki pages, and a schema defining wiki conventions. On top of that foundation, it adds purpose.md, a document stating why the wiki exists, which questions it tracks, and which hypotheses it tests. The LLM reads purpose.md during both ingestion and querying so it classifies and highlights material according to the wiki’s goal. Feeding the same PDF into an “Energy Industry Trends” wiki versus a “Personal Study Notes” wiki yields different extracted entities and takeaways.

Ingestion splits work across two separate LLM calls. The first call reads the source document and outputs a structured breakdown of entities, concepts, claims, links to existing pages, contradictions, and structural recommendations. The second call takes only that structured analysis and writes source summary pages, entity and concept pages, updated index.md and log.md files, human review items, and search queries for Deep Research in one pass. Separating comprehension from synthesis raises output quality at both stages.

The knowledge graph in LLM Wiki actively drives retrieval and expansion rather than serving as a passive chart. Its four-signal relatedness model combines direct links, shared sources, Adamic-Adar scores, and page-type affinity. Graph rendering uses sigma.js, graphology, and the ForceAtlas2 layout. Users can toggle node colors by page type or community, and node sizes use a square-root scale over link counts to prevent hub nodes from dominating the view. Automatic Louvain community detection identifies natural clusters from link topology regardless of page type and assigns each cluster a cohesion score based on internal edge density. Clusters scoring below 0.15 trigger a warning, showing users right away where their wiki lacks coverage.

The search pipeline runs tokenized lexical search, vector semantic search, and graph expansion in sequence. In benchmark tests, enabling vector search lifted overall recall from 58.2% to 71.4%. When the LLM spots gaps in the wiki, Deep Research runs multi-query web searches generated during ingestion via the Tavily API, synthesizes the retrieved pages into new wiki articles, and feeds them back into the two-step ingestion pipeline.

LLM Wiki also manages auto-generated .obsidian/ settings so any wiki directory opens directly as an Obsidian vault without conversion. Users can open the folder in LLM Wiki for automated ingestion and graph analysis, or in Obsidian for standard Markdown note editing. A Chrome extension (Web Clipper) imports web articles straight into the wiki.

Pre-built binaries are available for macOS, Windows, and Linux. The app supports OpenAI, Anthropic, Google, and other LLM providers, defaulting to a 15-minute timeout to accommodate long ingestion runs.

Summary

  • Implements Karpathy’s persistent, incrementally updated LLM wiki pattern as an alternative to chunk-based RAG.
  • Splits comprehension and synthesis into a two-step ingestion pipeline guided by purpose.md.
  • Integrates directly with Obsidian vaults, a Chrome Web Clipper, and a four-signal knowledge graph.