Skip to content

Instantly share code, notes, and snippets.

@karpathy
Created April 4, 2026 16:25
Show Gist options
  • Select an option

  • Save karpathy/442a6bf555914893e9891c11519de94f to your computer and use it in GitHub Desktop.

Select an option

Save karpathy/442a6bf555914893e9891c11519de94f to your computer and use it in GitHub Desktop.
llm-wiki

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

The idea here is different. Instead of just retrieving from raw documents at query time, the LLM incrementally builds and maintains a persistent wiki — a structured, interlinked collection of markdown files that sits between you and the raw sources. When you add a new source, the LLM doesn't just index it for later retrieval. It reads it, extracts the key information, and integrates it into the existing wiki — updating entity pages, revising topic summaries, noting where new data contradicts old claims, strengthening or challenging the evolving synthesis. The knowledge is compiled once and then kept current, not re-derived on every query.

This is the key difference: the wiki is a persistent, compounding artifact. The cross-references are already there. The contradictions have already been flagged. The synthesis already reflects everything you've read. The wiki keeps getting richer with every source you add and every question you ask.

You never (or rarely) write the wiki yourself — the LLM writes and maintains all of it. You're in charge of sourcing, exploration, and asking the right questions. The LLM does all the grunt work — the summarizing, cross-referencing, filing, and bookkeeping that makes a knowledge base actually useful over time. In practice, I have the LLM agent open on one side and Obsidian open on the other. The LLM makes edits based on our conversation, and I browse the results in real time — following links, checking the graph view, reading the updated pages. Obsidian is the IDE; the LLM is the programmer; the wiki is the codebase.

This can apply to a lot of different contexts. A few examples:

  • Personal: tracking your own goals, health, psychology, self-improvement — filing journal entries, articles, podcast notes, and building up a structured picture of yourself over time.
  • Research: going deep on a topic over weeks or months — reading papers, articles, reports, and incrementally building a comprehensive wiki with an evolving thesis.
  • Reading a book: filing each chapter as you go, building out pages for characters, themes, plot threads, and how they connect. By the end you have a rich companion wiki. Think of fan wikis like Tolkien Gateway — thousands of interlinked pages covering characters, places, events, languages, built by a community of volunteers over years. You could build something like that personally as you read, with the LLM doing all the cross-referencing and maintenance.
  • Business/team: an internal wiki maintained by LLMs, fed by Slack threads, meeting transcripts, project documents, customer calls. Possibly with humans in the loop reviewing updates. The wiki stays current because the LLM does the maintenance that no one on the team wants to do.
  • Competitive analysis, due diligence, trip planning, course notes, hobby deep-dives — anything where you're accumulating knowledge over time and want it organized rather than scattered.

Architecture

There are three layers:

Raw sources — your curated collection of source documents. Articles, papers, images, data files. These are immutable — the LLM reads from them but never modifies them. This is your source of truth.

The wiki — a directory of LLM-generated markdown files. Summaries, entity pages, concept pages, comparisons, an overview, a synthesis. The LLM owns this layer entirely. It creates pages, updates them when new sources arrive, maintains cross-references, and keeps everything consistent. You read it; the LLM writes it.

The schema — a document (e.g. CLAUDE.md for Claude Code or AGENTS.md for Codex) that tells the LLM how the wiki is structured, what the conventions are, and what workflows to follow when ingesting sources, answering questions, or maintaining the wiki. This is the key configuration file — it's what makes the LLM a disciplined wiki maintainer rather than a generic chatbot. You and the LLM co-evolve this over time as you figure out what works for your domain.

Operations

Ingest. You drop a new source into the raw collection and tell the LLM to process it. An example flow: the LLM reads the source, discusses key takeaways with you, writes a summary page in the wiki, updates the index, updates relevant entity and concept pages across the wiki, and appends an entry to the log. A single source might touch 10-15 wiki pages. Personally I prefer to ingest sources one at a time and stay involved — I read the summaries, check the updates, and guide the LLM on what to emphasize. But you could also batch-ingest many sources at once with less supervision. It's up to you to develop the workflow that fits your style and document it in the schema for future sessions.

Query. You ask questions against the wiki. The LLM searches for relevant pages, reads them, and synthesizes an answer with citations. Answers can take different forms depending on the question — a markdown page, a comparison table, a slide deck (Marp), a chart (matplotlib), a canvas. The important insight: good answers can be filed back into the wiki as new pages. A comparison you asked for, an analysis, a connection you discovered — these are valuable and shouldn't disappear into chat history. This way your explorations compound in the knowledge base just like ingested sources do.

Lint. Periodically, ask the LLM to health-check the wiki. Look for: contradictions between pages, stale claims that newer sources have superseded, orphan pages with no inbound links, important concepts mentioned but lacking their own page, missing cross-references, data gaps that could be filled with a web search. The LLM is good at suggesting new questions to investigate and new sources to look for. This keeps the wiki healthy as it grows.

Indexing and logging

Two special files help the LLM (and you) navigate the wiki as it grows. They serve different purposes:

index.md is content-oriented. It's a catalog of everything in the wiki — each page listed with a link, a one-line summary, and optionally metadata like date or source count. Organized by category (entities, concepts, sources, etc.). The LLM updates it on every ingest. When answering a query, the LLM reads the index first to find relevant pages, then drills into them. This works surprisingly well at moderate scale (~100 sources, ~hundreds of pages) and avoids the need for embedding-based RAG infrastructure.

log.md is chronological. It's an append-only record of what happened and when — ingests, queries, lint passes. A useful tip: if each entry starts with a consistent prefix (e.g. ## [2026-04-02] ingest | Article Title), the log becomes parseable with simple unix tools — grep "^## \[" log.md | tail -5 gives you the last 5 entries. The log gives you a timeline of the wiki's evolution and helps the LLM understand what's been done recently.

Optional: CLI tools

At some point you may want to build small tools that help the LLM operate on the wiki more efficiently. A search engine over the wiki pages is the most obvious one — at small scale the index file is enough, but as the wiki grows you want proper search. qmd is a good option: it's a local search engine for markdown files with hybrid BM25/vector search and LLM re-ranking, all on-device. It has both a CLI (so the LLM can shell out to it) and an MCP server (so the LLM can use it as a native tool). You could also build something simpler yourself — the LLM can help you vibe-code a naive search script as the need arises.

Tips and tricks

  • Obsidian Web Clipper is a browser extension that converts web articles to markdown. Very useful for quickly getting sources into your raw collection.
  • Download images locally. In Obsidian Settings → Files and links, set "Attachment folder path" to a fixed directory (e.g. raw/assets/). Then in Settings → Hotkeys, search for "Download" to find "Download attachments for current file" and bind it to a hotkey (e.g. Ctrl+Shift+D). After clipping an article, hit the hotkey and all images get downloaded to local disk. This is optional but useful — it lets the LLM view and reference images directly instead of relying on URLs that may break. Note that LLMs can't natively read markdown with inline images in one pass — the workaround is to have the LLM read the text first, then view some or all of the referenced images separately to gain additional context. It's a bit clunky but works well enough.
  • Obsidian's graph view is the best way to see the shape of your wiki — what's connected to what, which pages are hubs, which are orphans.
  • Marp is a markdown-based slide deck format. Obsidian has a plugin for it. Useful for generating presentations directly from wiki content.
  • Dataview is an Obsidian plugin that runs queries over page frontmatter. If your LLM adds YAML frontmatter to wiki pages (tags, dates, source counts), Dataview can generate dynamic tables and lists.
  • The wiki is just a git repo of markdown files. You get version history, branching, and collaboration for free.

Why this works

The tedious part of maintaining a knowledge base is not the reading or the thinking — it's the bookkeeping. Updating cross-references, keeping summaries current, noting when new data contradicts old claims, maintaining consistency across dozens of pages. Humans abandon wikis because the maintenance burden grows faster than the value. LLMs don't get bored, don't forget to update a cross-reference, and can touch 15 files in one pass. The wiki stays maintained because the cost of maintenance is near zero.

The human's job is to curate sources, direct the analysis, ask good questions, and think about what it all means. The LLM's job is everything else.

The idea is related in spirit to Vannevar Bush's Memex (1945) — a personal, curated knowledge store with associative trails between documents. Bush's vision was closer to this than to what the web became: private, actively curated, with the connections between documents as valuable as the documents themselves. The part he couldn't solve was who does the maintenance. The LLM handles that.

Note

This document is intentionally abstract. It describes the idea, not a specific implementation. The exact directory structure, the schema conventions, the page formats, the tooling — all of that will depend on your domain, your preferences, and your LLM of choice. Everything mentioned above is optional and modular — pick what's useful, ignore what isn't. For example: your sources might be text-only, so you don't need image handling at all. Your wiki might be small enough that the index file is all you need, no search engine required. You might not care about slide decks and just want markdown pages. You might want a completely different set of output formats. The right way to use this is to share it with your LLM agent and work together to instantiate a version that fits your needs. The document's only job is to communicate the pattern. Your LLM can figure out the rest.

@ErikEvenson
Copy link
Copy Markdown

Thank you for this — it's been the seed for something genuinely useful. My LLM and I have been running this pattern on an Obsidian vault for a few days now, and the thing I'd add to the conversation is this:

The wiki pattern becomes transformative when it stops being a knowledge base and starts being a decision-support system — when the LLM doesn't just curate what you know, but operates on it.

Most of the implementations in these comments are building smarter libraries. What surprised me is what happens when the wiki starts driving real decisions: comparing vendor pitches against structured criteria, tracking financial accounts with scheduled reminders that surface in conversation, encoding sequencing constraints between life projects so the LLM can't propose structurally wrong plans. The three-layer split (immutable sources, living wiki, co-evolving schema) makes this possible because the LLM always has ground truth to reason from.

Anyway, thank you for the nudge. The bookkeeping idea was the key insight.

@vitalii-ivanov-rakuten
Copy link
Copy Markdown

vitalii-ivanov-rakuten commented Apr 10, 2026

Taking this from personal wiki to team knowledge base — with Claude Code native integration

After reading this gist and reviewing ~17 implementations linked in the comments, using Claude Code, we built a team-oriented version on top of this concept. The key advancement: instead of a separate tool you explicitly invoke, the wiki becomes ambient — it's always in Claude's context and compiles itself as you work.


What We changed or added

1. @import makes the wiki always visible

One line in ~/.claude/CLAUDE.md:

@~/Vault/Wiki/index.md

Claude Code expands this at session start. Claude sees the full article index without any explicit lookup. The original pattern requires you to remember to query — this makes it automatic.

2. Path-scoped rules for zero-friction domain knowledge

---
paths:
  - "<repo>/**/*.py"
---
# Code Patterns
- Key pattern 1...
- Key pattern 2...

Files in ~/.claude/rules/ auto-load when Claude opens matching files. Working on a DAG file? Relevant patterns are already in context before you type anything.

3. Git-native architecture — wiki as submodule

~/Vault/                  ← personal Obsidian vault (private git repo)
├── Wiki/                 ← git submodule → team wiki repo
├── Wiki-inbox/           ← personal drop zone (worklogs, docs, exports),
│                            outside of Wiki scope to not store in git
└── Worklogs/             ← task artifacts (the raw layer)
~/Projects/               ← code artifacts (the raw layer)

The wiki lives in its own repo. Each developer forks it, works on a personal branch, and Claude PRs to the team upstream. Git IS the staging and review layer — no separate approval workflow needed.

4. Event-driven compilation, not scheduled

## Knowledge Base
@~/Vault/Wiki/index.md
When you discover a durable pattern, gotcha, or architectural decision:
run `/knowledge-compile convo` immediately — don't wait for session end.

The trigger is "I just learned something" not "it's time to run the pipeline."

5. Three input sources

  • /knowledge-compile TASK-1234 — from a task worklog (structured, chronological)
  • /knowledge-compile convo — from the current conversation
  • /knowledge-compile Wiki-inbox/article.md — from a dropped external reference

6. Five skills forming a complete workflow

/knowledge-compile TASK-XXXX  → extract patterns from worklog → write articles
/knowledge-preserve            → commit to personal fork, update vault submodule
/knowledge-share               → preserve + open PR to team upstream for review
/knowledge-lookup <query>      → search wiki before starting domain work
/knowledge-review              → health check: staleness, cross-ref symmetry, orphans

7. Structured article ontology

Folder structure with {category}-{name} convention:

  • tech-* — cross-project technical patterns (e.g. tech-bigquery/, tech-airflow/)
  • team-* — organizational knowledge (people, ownership, processes)
  • project-* — project-specific patterns spanning multiple repos
  • synthesis/ — cross-domain insights that don't belong to a single domain
  • process-* — workflows and repeatable processes

Frontmatter schema informed by community repos:

confidence: high|medium|speculative
status: active|superseded|archived
open-questions:
  - unanswered question
contradictions:
  - Source A says X, Source B says Y — human to resolve

8. Self-installing via README

Someone new can set this up with one message to Claude:

Clone https://github.com/your-org/llm-wiki.git and integrate

Claude reads the README and autonomously:

  1. Forks the repo, creates personal branch
  2. Adds as git submodule in ~/Vault/Wiki/
  3. Installs skills to ~/.claude/commands/
  4. Patches ~/.claude/CLAUDE.md with the @import line
  5. Creates ~/Vault/Wiki-inbox/ with a source-tracking template
  6. Wires path-scoped rules for key domains

The wiki repo carries a setup/ folder containing the skills and the exact CLAUDE.md snippet — so the installation is self-contained and reproducible.


What we learned from the community repos

Checked all 17 repos/gists linked in this thread. Highlights:

  • llm-wiki (Pratiyush/llm-wiki) — best synthesis prompt structure: Summary → Key Claims (falsifiable) → Connections (wikilinks) → Contradictions
  • rtfm (roomi-fields/rtfm) — UserPromptSubmit hook (throttled 30s) + Stop hook keeps index fresh automatically
  • OmegaWiki (skyllwt/OmegaWiki) — cross-reference symmetry lint: if A links B, verify B links A; failure_reason required when marking a pattern superseded
  • LLM4Rec_wiki (Accagain2014) — wiki/log.md append-only audit trail (Karpathy's second navigation file — I was missing it)
  • secondbrain (sergio-bershadsky/ai) — staleness exemption for terminal statuses; separate review-agent from review-skill

Overengineering to avoid: HTTP servers, SQLite graph databases, local embedding models (~2GB), activation decay on articles, fine-tuning pipelines.
For a team wiki under ~500 articles, .md file-based Obsidian + keyword search and links is sufficient.

@LaserPhaser
Copy link
Copy Markdown

it've tried to implement and use in my projs exactly this idea
https://github.com/LaserPhaser/claude-ltm

@baljanak
Copy link
Copy Markdown

Great pattern. I've been running a version of this for months - the one thing I'd add is an identity-aware filter that evolves. A prompt that tells the LLM who the wiki is for, scores sources before creating pages, and rewrites itself over time based on what proved useful. Same transcript through a founder's filter vs investor's filter produces completely different wiki pages. Wrote up the extension here: https://gist.github.com/baljanak/f233d3e321d353d34f2f6663369b3105

@QipengGuo
Copy link
Copy Markdown

I built an extension verison named LLM Wikidata. It solves the large-scale entity linking issue by combining LLMs with ChromaDB to recall existing entities, preventing the hallucination of duplicate nodes. Code is available at https://github.com/QipengGuo/llm-wikidata

@goatypixel821-hash
Copy link
Copy Markdown

I built a working system along these lines before seeing this gist — started from a different problem (searching my own YouTube watch history across 3,000+ videos) and converged on the same architecture independently.
The key difference in my approach: instead of wiki pages, the LLM compresses each source into a dense "Shorty" — a retrieval-optimized brief with ~95% information retention at ~95% token reduction. Then it extracts entities and subject→relation→object triples into a global knowledge graph that spans all sources.
Retrieval uses five layers fused together via Reciprocal Rank Fusion rather than index-file scanning:
Chroma vector search (semantic)
BM25 keyword search (exact terms, names, acronyms)
Cross-encoder neural reranking
Per-source graph reasoning over triples
Global cross-source knowledge graph with multi-hop BFS
A query router classifies each question and selects which layers to activate.
On the accuracy problem @YoloFame raised — my solution was building an evaluation framework that measures retrieval quality (Recall@K, MRR) against known-good answers, so you can quantify whether the system actually works instead of spot-checking manually.
The pattern Andrej describes here is right. The part I'd emphasize: the compounding isn't just in the pages/summaries — it's in the connections. Once you have normalized entities and typed relationships across hundreds of sources, the system can answer questions that no single source contains. That's where it stops being a better search engine and starts being a research partner.
Repo: https://github.com/goatypixel821-hash/ask-shorty

@NicolasCharpentier
Copy link
Copy Markdown

Thank you Karpathy but about

"a document (e.g. CLAUDE.md for Claude Code or AGENTS.md for Codex)"

I made conferences, talks, and built an open-source local-first mobile-last MIT-licensed filename enforcer, so you don't rename the file, you ask for the file to be renamed -- and it gets renamed.

I use it so when starting a wiki, i make sure file are named correctly by calling it : filename-enforcer-local CLAUDE.md CLAUDE.md, it can even support being called caps lock FILENAME-ENFORCER-LOCAL CLAUDE.md CLAUDE.md .

Feel free to use it, it's not that you didn't use it, it's that you didn't know about its existence -- fuck adds

@manjeetgupta
Copy link
Copy Markdown

Can we use Pageindex a reasoning-based retrieval framework that enables LLMs to dynamically navigate document structures to overcome the limitation of To address these challenges of vector based RAG

@doum1004
Copy link
Copy Markdown

Built a CLI tool inspired by this: https://github.com/doum1004/llmwiki-cli

A CLI tool that lets LLM agents build and maintain structured wikis using only filesystem and git operations—no API orchestration layer required.

The CLI exposes deterministic primitives (read, write, search, index, list, commit), while the LLM agent orchestrates wiki construction through shell commands.

npm install -g llmwiki-cli

wiki init my-wiki --domain "machine learning"

wiki write wiki/concepts/attention.md <<'EOF'
---
title: Attention Mechanism
tags: [transformers, NLP]
---
Content here. Links via [[wikilinks]].
EOF

wiki index add "concepts/attention.md" "Overview of attention"

wiki search "attention"

wiki commit "ingest: attention paper"

@earaizapowerera
Copy link
Copy Markdown

earaizapowerera commented Apr 10, 2026 via email

@aaronoah
Copy link
Copy Markdown

aaronoah commented Apr 10, 2026

Thanks for sharing this! I build a CLI agent based lightweight skill to move files around https://github.com/aaronoah/llm-wiki-skill, no MCP, REST APIs required. Easy to install for any CLI agents locally. I have defined some structures for how raw files are ingested, summarized and merged with existing wikis and cross-links. Happy to hear your thoughts and welcome to use and raise some questions and even contribute!

Note: this would change the files and work/adapt to any frontends for visualizations not limited for Obsidian

@Shagun0402
Copy link
Copy Markdown

Shagun0402 commented Apr 10, 2026

@karpathy Interesting shift. This feels less like better retrieval and more like introducing a stateful memory layer into LLM systems.

One thing that stands out:
we’re trading ephemeral hallucinations for persistent errors.

If a wiki/graph incorrectly links two concepts once, that mistake doesn’t disappear — it becomes a prior that future generations build on.

Feels like the core challenge here isn’t building the wiki itself, but:

  • tracking provenance
  • handling contradictions
  • and knowing when to invalidate memory

Curious how you think about debugging or evaluating these systems over time — especially when errors compound instead of resetting per prompt.

@Byebai13
Copy link
Copy Markdown

This is very close to a direction I’ve been exploring, but with one important difference:

instead of first throwing a lot of raw material at the model and letting structure slowly emerge, I start from a personal knowledge graph that already has a fairly mature structure, then let the model grow inside it.

My Roam graph is not a general personal database. I deliberately keep it clean: it mainly stores thoughts and knowledge, not project logistics or personal admin, and I avoid letting unreviewed AI-generated text flow back into it. Over ~3 years, that graph accumulated 16,940 informative blocks, 4,754 backlinks, 695 direct block refs, 224 embeds, and 287 high-value pages. For me, that graph functions like an external prior: a compressed personal probability space, with its own naming system, link structure, and taste.

A big part of the work was not “letting the model infer links from flat notes,” but extracting and compiling the structure that already exists in the Roam graph.

The EDN export already contains the raw ingredients of the graph: page/block IDs, parent-child structure, block refs, and page membership. I parse that into an explicit graph layer with pages, blocks, breadcrumbs, refs, children, and backlinks. On top of that graph, I run a separate semantic layer using Qwen3 embeddings.

The compile layer sits between the raw RR graph and the model.

My raw RR graph is highly compressed and only fully legible to me: shorthand naming, block refs, embeds, skipped assumptions, and local jumps that make sense only inside years of personal use. So I don’t simply flatten it into plain text. I compile each node into an LLM-readable intermediate representation: path context is preserved; block refs and embeds are resolved; representative children are selected; linked concepts are injected; and that compiled search text is what gets embedded and indexed.

Then at query time, a retrieval hit is expanded through the graph: neighboring blocks, direct links, backlinks, and page summaries are pulled in before the model answers. So the model is not just reading isolated chunks; it is entering a structured local region of my thinking.

That changes the system from “retrieve chunks and answer” into something closer to “enter my thinking path, then continue growing from there.”

The outputs are also different from a typical AI knowledge base. Besides answering questions, it can:

  • overview the higher-level structure of the graph
  • surface missing links that probably should exist but haven’t been made explicit yet
  • discover latent isomorphisms across domains
  • draft entry-layer explanations for important nodes that were originally only readable to me

Later, I also started selectively enriching some high-information nodes with additional entry-layer content. These were nodes that were highly meaningful inside my own graph but still too compressed for the model. That extra layer was not blindly auto-written back: it was drafted for the model, then reviewed and confirmed by me before becoming part of the usable structure.

At the same time, I keep fast-changing operational memory separate. Project state, workflow changes, and recent preferences do not go straight into the core Roam graph. They flow through another runtime memory layer, where dialogue fragments can be promoted into memory and then lifted into higher-order observations like update, refinement, and contradiction. That way the intellectual prior stays relatively pure, while the agent still learns from interaction.

The project started in Cursor, and later I migrated the main workflow to Codex. The migration mattered less than the direction: the system gradually became not just “an AI that can search my notes,” but “an AI that reads through a compiled version of my personal cognitive structure, grows inside it, and only writes back through human confirmation.”

So the key difference is not just that I have more notes. It’s that I’m not asking the model to slowly discover my cognitive structure from raw material; I’m giving it a compiled version of that structure first, and only then asking it to grow inside it.
CleanShot 2026-04-10 at 14 37 04
CleanShot 2026-04-10 at 14 37 21
CleanShot 2026-04-10 at 14 38 33
CleanShot 2026-04-10 at 14 41 35
CleanShot 2026-04-10 at 14 42 12
CleanShot 2026-04-10 at 14 42 41
CleanShot 2026-04-10 at 14 43 10
CleanShot 2026-04-10 at 15 01 56

@abubakarsiddik31
Copy link
Copy Markdown

Working toward a open-source version of it. The goal is to do everything mentioned here but from one cli tool.

https://github.com/abubakarsiddik31/axiom-wiki

@ShalokShalom
Copy link
Copy Markdown

I found this, built from AST, instead of an LLM.

https://github.com/Houseofmvps/codesight

@adrianbr
Copy link
Copy Markdown

adrianbr commented Apr 10, 2026

We took a similar approach to build the wiki for r/ontologyengineering - it's after all, ontology ontology engineering https://www.reddit.com/r/OntologyEngineering/wiki/index/

We also take the same approach at dlthub with ontology driven data modeling - try our approach here: https://dlthub.com/blog/minimum-viable-context

@ksinghrathore482-netizen
Copy link
Copy Markdown

I have a question: If we use this approach to create a wiki for all our documents, our system will eventually become quite large. If we end up with hundreds of markdown files and each request requires updating multiple files, how will that impact our costs, storage and latency of a query?

@shimaurya
Copy link
Copy Markdown

We can include a Metadata for LLM to understand what the doc is about so it won't go through whole thing also it should cache the relation between the docs so when answering any query it'll check the relation first then Metadata.
And whenever a new doc is created, a relation and Metadata will be created and store.

@AgriciDaniel
Copy link
Copy Markdown

Built a full implementation of this pattern as a Claude Code plugin: claude-obsidian (358 stars).

Your three-layer architecture maps directly to the implementation: .raw/ for immutable sources, wiki/ for the compiled wiki, and WIKI.md as the schema document.

A few things we added that solved real problems at scale:

  • Hot cache (wiki/hot.md) - ~500 words of session context that persists between conversations. Eliminates the "where were we?" recap problem. Costs <0.25% of context window but saves 2-3K tokens of re-explanation every session.
  • Contradiction flagging - when a new source conflicts with existing wiki pages, the ingest agent creates [!contradiction] callouts instead of silently overwriting. This directly addresses the "compounding errors" concern raised in the comments.
  • 8-category lint - orphan pages, dead wikilinks, contradictions, missing pages, unlinked mentions, incomplete metadata, empty sections, stale index. Runs periodically to keep the wiki healthy as it grows.
  • Autonomous research loops (/autoresearch) - 3-round web search that identifies gaps, fills them, and files everything as cross-referenced wiki pages with provenance tracking.

10 skills total, works across Claude Code, Gemini CLI, Codex CLI, and Cursor.

For the Obsidian visualization layer you mentioned - we also built claude-canvas for AI-orchestrated canvas creation: knowledge graphs, presentations, flowcharts, mood boards with 12 templates and 6 layout algorithms. It auto-detects claude-obsidian vaults and uses wiki/canvases/ when available.

Deeper writeup: agricidaniel.com/blog/claude-obsidian-ai-second-brain

@mehrdadmms
Copy link
Copy Markdown

This is great. I've been building a second brain for a week now and there are a couple of gaps that can take this one level further.
IMHO, the wiki needs inner grooves that can orient the knowledge better. I've wrote an article about it here:
https://x.com/0xcr33pt0/status/2042644970171969634

Appreciate any thoughts or feedback.

@peterzhangbo
Copy link
Copy Markdown

https://github.com/peterzhangbo/LLMWikiController
This project was originally inspired by karpathy's early LLM Wiki workflow write-up. It builds on the core ideas from that practice and extends them with additional structure, workflow refinement, and implementation-oriented optimizations for real-world use.

@XingwenZhang
Copy link
Copy Markdown

One quick question: with knowledge grows, how to manage them efficiently and avoid the memory drift?

@jaytxrx
Copy link
Copy Markdown

jaytxrx commented Apr 10, 2026

Grok (via web)

@gptix can you elaborate how do you feed your local inputs to Grok via web ? I thought we always need API access for such kind of processing.

@Eyaldavid7
Copy link
Copy Markdown

your "LLM Wiki as a Compiler" analogy inspired me to run a head-to-head battle between a Synthesis-based Wiki and Standard RAG.

I tested them on a production codebase (React/Firebase/Gemini, ~50k LOC) using 7 distinct tournaments. Some key findings that might interest you:

The Blueprint Paradox: The Wiki significantly outperformed RAG on "deleted" or archived logic—it maintained institutional memory that was physically gone from the repo.

The Ingestion Gap: I found that a Wiki's performance is binary; "mostly finished" documentation performed 17% worse than a "fully compiled" one.

The Winning Combo: The "Combined" approach (Wiki for context + RAG for verification) never lost a single round, even in tasks specifically designed to favor RAG.

I’ve documented the full methodology, the scoring matrix for the 130 questions, and the specific "Conflict-Flagging" system prompt here https://open.substack.com/pub/eyal454160/p/why-your-ai-agent-needs-a-wiki-and?r=jn4y2&utm_campaign=post&utm_medium=web&showWelcomeOnShare=true

@gptix
Copy link
Copy Markdown

gptix commented Apr 11, 2026 via email

@tomjwxf
Copy link
Copy Markdown

tomjwxf commented Apr 11, 2026

The integrity problem no one's talking about

The LLM Wiki pattern is brilliant — but it has a silent failure mode: how do you prove your wiki content was actually generated by the model you claim?

Without cryptographic attestation, "GPT-4 says X" is indistinguishable from "I wrote X and attributed it to GPT-4." For personal notes this doesn't matter. For shared knowledge bases, medical references, legal research, or multi-model consensus — it's a critical gap.

We built a solution: issuer-blind receipt verification.

Every model response gets an Ed25519-signed receipt. Anyone can verify it offline — no accounts, no API calls, no trust in the issuing organization:

npx @veritasacta/verify --self-test
# ✓ Sample receipt: VALID (Ed25519, kid: gateway-001)
# ✓ Tampered receipt: REJECTED (signature mismatch)
# No servers were contacted.

The verifier is Apache-2.0 and will never be vendor-locked.

Live implementation: acta.today/wiki — multi-model knowledge base where every Knowledge Unit is produced by 4+ frontier models in adversarial rounds, with receipts on every response.

Why "issuer-blind"? The verifier (@veritasacta/verify) never learns who generated the receipt. This means a Chinese research team can verify outputs from a US-hosted model without revealing their org — and vice versa. No federation, no shared infrastructure, no surveillance.

Protocol standard: IETF Internet-Draft draft-farley-acta-signed-receipts-01

Related discussion: Issuer-blind verification for LLM wiki integrity

@ZhuoZhuoCrayon
Copy link
Copy Markdown

What becomes valuable for AI work is not just the raw code, but the maintained intermediate layer that grows around it.

That is why Karpathy’s llm-wiki framing resonates so much with me: raw sources are not enough by themselves. The leverage comes from turning them into something continuously synthesized, cross-referenced, and maintained, with a schema layer like AGENTS.md to keep that knowledge operational.

You can already see this pattern emerging in open source.

A repository stops being “just source code” once it starts accumulating durable intent:

  • docs explain the operational surface
  • examples preserve invocation patterns
  • changelog keeps temporal context
  • AGENTS.md and CONTRIBUTING encode maintainer policy
  • tests and GitHub Actions make behavior inspectable and checkable

throttled-py made this very concrete for me. It now carries 18 docs pages, 42 runnable examples, 730 tests, 5 GitHub Actions workflows, and 7.46M+ PyPI downloads. Those numbers matter less as scale signals than as evidence that repository memory has been accumulating for a long time.

That is why AI can do more end-to-end work there now: not because the model is magically smarter, but because more of the project’s intent has become durable, inspectable, and recoverable.

The projects that compound in the AI era may be the ones that learn to turn knowledge into infrastructure.

@dangleh
Copy link
Copy Markdown

dangleh commented Apr 11, 2026

I think the next step beyond an LLM-maintained wiki is an LLM-maintained epistemic map.

A good knowledge base should not only store “what we think is true”, but also: what is uncertain, what is contradicted, what is stale, and what still needs verification.

In that framing, the agent’s job is not just summarization or synthesis, but continuous maintenance of the system’s belief state. That feels like the real missing layer between raw sources and useful long-term knowledge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment