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.

@jurajskuska
Copy link
Copy Markdown

jurajskuska commented Apr 13, 2026 via email

@gnusupport
Copy link
Copy Markdown

gnusupport commented Apr 13, 2026 via email

@jurajskuska
Copy link
Copy Markdown

jurajskuska commented Apr 13, 2026 via email

@hectordww-alt
Copy link
Copy Markdown

I wrote a tiny add-on prompt for this pattern focused on taste logs: music, films, books, etc.

The idea is to keep plain markdown logs plus small curator instructions, so an agent can avoid repeats, use misses as negative signal, and make recommendations from actual taste history rather than starting from zero each time.

https://gist.github.com/hectordww-alt/30c3e6af4ec77001f21b8b103e0115ff

@ilya-epifanov
Copy link
Copy Markdown

I wrote a couple of tools augmenting LLM-wiki:

  1. https://github.com/ilya-epifanov/llmwiki-tooling — a CLI utility to simplify linting, checking and fixing links, optionally enforcing frontmatter fields, sections in markdown etc. It's supposed to be used by the agent for consistency and to save some tokens.
  2. https://github.com/ilya-epifanov/wikidesk:
    • a client binary that syncs a copy of wiki/ locally and can talk to the server to initiate a research
    • a server that spawns a Claude (or any other agent) instance whenever it receives a research request (with adjustable additional prompt)

Both tools are as unopinionated as possible. They should work with any reasonably non-disfigured LLM-wiki setup.

Works great for me!
My use case: claude on DGX Spark (actually an ASUS thingy) is busy designing an ML training pipeline while having access to my ML wiki. A couple of research requests it has sent so far have properly incrementally updated the wiki and pulled in relevant papers.
🎆

@waydelyle
Copy link
Copy Markdown

SwarmVault v0.7.30 — now with a first-party Obsidian plugin. Another update from the project that started from this gist.

Five releases since the last post and the big one is the Obsidian integration:

  • First-party Obsidian plugin@swarmvaultai/obsidian-plugin drives the full CLI from inside Obsidian. Status bar shows vault state + compile freshness, command palette runs init/ingest/compile/lint/watch/serve, "Query from current note" returns answers with page_id → wikilink citations so results link directly to your vault pages. Run Log view streams live stdout/stderr. Currently in Obsidian community marketplace review.
  • Deep Obsidian exportgraph export --obsidian now ships .obsidian/types.json for Bases/Dataview property typing, node-type color groups for the graph view, typed link frontmatter for Breadcrumbs/Juggl/ExcaliBrain, graph metrics (degree, bridge score, god-node detection) in frontmatter, cssclasses per page type, and pre-built Dataview dashboards. Canvas export uses clickable file nodes with directional arrows.
  • swarmvault demo — zero-config sample vault walkthrough. Point someone at the repo and they can see what a compiled vault looks like in under a minute.
  • swarmvault diff — shows graph-level changes against the last committed state. See exactly what changed structurally, not just file diffs.
  • Offline graph exportsgraph export --html-standalone bundles vis-network inline so exported HTML works with no internet connection.
  • TypeScript path alias resolution@/components/Button and @utils/format style imports now resolve correctly in the code index via tsconfig.json.

We're heading toward being the default second brain compiler for people who already live in Obsidian. The wiki Karpathy described in this gist is the output format — SwarmVault automates building and maintaining it.

Try it: npx @swarmvaultai/cli demo — see a working vault in 30 seconds, no config needed.

Repo: https://github.com/swarmclawai/swarmvault

If you use Obsidian, would love early feedback on the plugin.

@giovani-junior-dev
Copy link
Copy Markdown

Hey! I just wanted to take a moment to thank you for sharing this project. Claude Wiki is a fantastic idea and the way you've documented and made it accessible is really impressive.

Your content inspired me to create my own custom skill for Claude Code, adapted to my specific workflow and needs. I've been using it heavily on the projects I'm developing here in Brazil, and it has made a huge difference — Claude now has context and memory across sessions, which has completely changed the way I work.

It's great to see the community building on top of Andrej Karpathy's LLM Wiki methodology in such practical and creative ways. Keep up the amazing work!

Thanks again for sharing this with the world. 🙌

https://claude-wiki.madeinvibecoding.com/

@skyllwt
Copy link
Copy Markdown

skyllwt commented Apr 14, 2026

We didn't just build a wiki — we plugged it into the entire research pipeline as the central hub that every step revolves around.

The result is ΩmegaWiki: your LLM-Wiki concept extended into a full-lifecycle research platform.

If you find it useful, a ⭐ would mean a lot! PRs, issues, and ideas all welcome — let's build
this together.

https://github.com/skyllwt/OmegaWiki

截图 2026-04-14 08-55-39

What the wiki drives:
• Ingest papers → structured knowledge base with 8 entity types
• Detect gaps → generate research ideas → design experiments
• Run experiments → verdict → auto-update wiki knowledge
• Write papers → compile LaTeX → respond to reviewers
• 9 relationship types connecting everything (supports, contradicts, tested_by...)

The key idea: the wiki isn't a side product — it's the state machine. Every skill reads from it,
writes back to it, and the knowledge compounds over time. Failed experiments stay as
anti-repetition memory so you never re-explore dead ends.

20 Claude Code skills, fully open-source. Still early-stage but functional end-to-end. We're
actively iterating — more model support and features on the way.

@earaizapowerera
Copy link
Copy Markdown

earaizapowerera commented Apr 14, 2026 via email

@vanillaflava
Copy link
Copy Markdown

I've been working with Obsidian and various LLMs (mostly Chats, little Code) for a while. Filesystem MCP kind of steered me in this direction already (I noticed that I had to write less bootstraps, but I generated hundreds of files, and search and linking was painful.) When I stumbled on this post (and the deliberate learning oriented angle it has), I figured why not? and tried implementing it myself as a pure self-teaching excercise.

I'm glad I did (and not just picking something off the shelf). Thinking about the pattern, my own pains, and looking at the other implementations shared here has really boosted my understanding of what really matters when it comes to working with LLM. I used Claude and published the skills as installable .skill files: https://github.com/vanillaflava/llm-wiki-claude-skills.

I adapted a few things (like turning the ingestion on it's head. Unsorted scrapheap -> categorized sources), I had manually organised my notes into domain-specific hubs before -> but the wiki pattern loves those, and really latches onto them. I added an extra skill to summarize and touch and update what is known at the end of a session, pivotal point or before retiring the chat, and that really lit up my brain. Now I don't need bootstraps anymore, the wiki is the bootstrap and I can specialize agents by just following the breadcrumbs to their specific domain (without ramming the same huge documents down its throat over and over). It just all seems to compound more and more. Token usage is way down compared to last week.

Just here to thank you (and the other posters) for sharing your thoughts and examples, and for leaving this explicitly vague. If I hadn't taken the plunge and tried to just tinker with it myself, I would have missed 90% of the point that makes this so elegant. I am still in shock how well this works!

Thank you for writing this up.

@Nemo4110
Copy link
Copy Markdown

Nemo4110 commented Apr 14, 2026

@kytmanov
Copy link
Copy Markdown

Just shipped v0.2 LLM Wiki for local Ollama LLMs. Now with Rejection feedback loop https://github.com/kytmanov/obsidian-llm-wiki-local

@gnusupport
Copy link
Copy Markdown

Not today. Maybe someday LLMs will have persistent memory, perfect recall, and flawless integrity. But that day isn't here. Right now, handing your knowledge base to an LLM means accepting contradictions, broken links, privacy leaks, and probabilistic answers to questions that need deterministic ones. I've spent 23 years building Hyperscope — the Dynamic Knowledge Repository, deterministic programs, human in control — and I use LLMs to accelerate my work, not replace my judgment. The LLM is a refreshener, not the curator. Keep your hands on the wheel. Full article: https://gnu.support/articles/Hyperscope-vs-LLM-Wiki-Why-PostgreSQL-Beats-Markdown-for-Deterministic-Knowledge-Bases-124138.html

@gnusupport
Copy link
Copy Markdown

@kytmanov

Just shipped v0.2 LLM Wiki for local Ollama LLMs. Now with Rejection feedback loop https://github.com/kytmanov/obsidian-llm-wiki-local

Sure, drop markdown notes... 😂😂😂 there is much more to it. Drop images, all multimedia! Images can easily be described by LLM, get embeddings and get related to other objects, Many notes are images. Imagine staff members, that is what we have, they make picture of their notes and reports and submit back to organization. Think future. Is something like that limited as "markdown notes" even manageable. I am talking from 23 years experience handling bunch of information. And surely I am using new technologies. But think time, future, how would you work with it in future with it? The Dynamic Knowledge Repository concept by Doug Engelbart was future proof since the vision for boosting Collective IQ. https://en.wikipedia.org/?curid=1004008

LLMs are useful, but not to be delegated the human work, as that way you would defeat the purposes. See more here: https://dougengelbart.org/content/view/190/

So if I am to follow LLM-Wiki... throw bunch of markdown notes into my system...

I Am Not Throwing Bunch of Markdown Notes into My System 🤣🤣🤣🤣

The LLM-Wiki pattern assumes your world is made of Markdown. I was one of first Markdown users since it's inception, and was promoting it as a good replacement for some other systems I was using, if I remember well asciidoc and m4. Information today is multi-media, not just text. But that knowledge base should be limited to Markdown notes in 21st century.... no way 🤣🤣🤣

😂 The LLM-Wiki pattern is essentially LLM training data generation disguised as personal knowledge management. 😂

Think about it:

  • You feed the LLM your sources

  • The LLM writes markdown files

  • Those markdown files become training material for the next session (via the schema file and index)

  • The LLM reads its own previous outputs to answer questions

🐑 The Tale of the Sheep and the LLM-Wiki Saga 🐑

The whole system is a loop of LLM → markdown → LLM → markdown 😂😂😂😂😂😂 and bunch of people running after it as 🐑🐑🐑🐑🐑🐑!!!!!!!

It's not a knowledge repository. It's a self-perpetuating LLM context generator. The wiki exists only to feed the LLM on the next query.

An LLM-Wiki without the LLM is just a bunch of files, without any organization!

A Dynamic Knowledge Repository database without the LLM is still a fully functional, queryable, relational knowledge base with 23 years of data, 245,377 people, 95,211 hyperdocuments, and complete referential integrity. The LLM is optional — a nice interface, not the engine.

Call this LLM-Wiki, fo what it is: LLM training with an expanded website wiki. 😂🤣💀

Go run for it 🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑

People follow the LLM-Wiki pattern not because it's good, but because Karpathy said it. He's an authority at OpenAI, Tesla, everywhere. So people assume: "He must know what he's doing."

But authority is not infallibility. 😈

He cannot beat DKR. Not because he's not smart. Because he's not Engelbart. He didn't spend decades thinking about CODIAK, Open Hyperdocument Systems, and Dynamic Knowledge Repositories. He came up with a clever weekend hack and people are treating it like gospel. 🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑🐑

Sheep follow the shepherd. 🐑🐑🐑

@catalinviciu
Copy link
Copy Markdown

I think this is a real problem and it's not a generic one. For certain jobs you might need a more opinionated method of bookkeeping.
As a coincidence I've built something similar but for Product Managers allowing us to keep and maintain the product context and update and use it for downstream purposes powered by AI agents.
You can find it here. It's free https://github.com/catalinviciu/product-builder-agent.git

@mauceri
Copy link
Copy Markdown

mauceri commented Apr 14, 2026 via email

@Mekopa
Copy link
Copy Markdown

Mekopa commented Apr 14, 2026

My experince is LLMs are able to discover knowlage better with a graph reprsentation layer

beyond just .md using data files like;
.ics
.vcf
...
and "link" them with each other, similar to how obsidian does for .md's

basicly a dead simple wiki of your life, and Im using a graph.json to keep my graph up to date

@gnusupport
Copy link
Copy Markdown

Look, I don't have excessive pride in myself or any particular tool — my confidence is in long-term systems proven over decades, not weekend hacks. I've analyzed OmegaWiki and the others here, and none of them are time-proof. Here's the fatal contradiction: if you delegate everything to an LLM-Wiki, the system eventually blocks and becomes unmanageable — unless the human gets more involved to fix the mess. That means the LLM-Wiki principle wants to escape itself! It promises "near zero maintenance" but delivers a growing burden of linting, fixing contradictions, patching broken links, and verifying hallucinations. The only way out is more human work, not less. That's not a solution — that's a trap. 🐑💀

Another huge trap -- authors are mostly coding by the LLM. And the LLM could know the outcomes in future, but authors, let us call them curators, will not ask the LLM right questions. So there we are at the fundamental problem, asking the right questions.

Idea is accepted like the Amen from sole Jesus Christ, or Elohim, whoever. And they go spending their Claude money/tokens to show-off here something what is unmanageable and where authors didn't put that much thinking.

And me stupid, even analyzed few of those projects to see how it goes.

Each project is pretty large, yet no collaborators, no users, no issues or problems reported.

Scalability? Almost zero. Computer cannot be handling locally what is being stated here. I am running LLMs on GPU, if I would have 120000 files to be each time like that, automatically LLM-WIKI-sheep-style expanded, then my computer would block, burn or otherwise be inaccessible for human.

Let us say this way, the LLM-WIKI idea while sounding hype, it is basically useless piece of crap.

@gnusupport
Copy link
Copy Markdown

My experince is LLMs are able to discover knowlage better with a graph reprsentation layer

Seems like you are actually using it, and having it productive for you personally. That is how it should be.

@mauceri
Copy link
Copy Markdown

mauceri commented Apr 14, 2026 via email

@rohitg00
Copy link
Copy Markdown

Extended version - LLM Wiki v2

@mursu-ai
Copy link
Copy Markdown

@karpathy
Wow, what a great idea Andrej! Thanks for posting it. To me it sounds very much like a RAG with memory (MemRAG) and keeping the wiki folder into a DB (possibly GraphDB?) could help with scaling.

@gnusupport
Copy link
Copy Markdown

gnusupport commented Apr 14, 2026

It all depends on how you intend to use it, for one thing; and for another, it’s perhaps pointless to call people sheep simply because you don’t see what they might like about this text.

Calling them "sheep" isn't about insulting their intelligence — it's about shocking them awake to realize that blindly following a seductive pattern without questioning its long-term outcomes leads to an unmanageable system that will eventually collapse under its own contradictions, broken links, and loss of human control. Especially when the authority figure they're following has literally declared himself to have "AI psychosis" and admitted he's on the verge of insanity. 🐑💀

OpenAI cofounder says he hasn't written a line of code in months and is in a 'state of psychosis' | Fortune:
https://fortune.com/2026/03/21/andrej-karpathy-openai-cofounder-ai-agents-coding-state-of-psychosis-openclaw/

He openly admits he hasn't written code in months and is in a state of psychosis — so was the LLM-Wiki a deeply considered architecture or just a vibe-coded hallucination he threw out while losing his grip? 🤡💀

@mikhashev
Copy link
Copy Markdown

mikhashev commented Apr 14, 2026

To: @karpathy and @torvalds and all participants

Proposed Comment for Gist Discussion

Git object model as a knowledge backend — why reinvent the wheel?

Going through the 485+ comments, I see a recurring pattern: we are all building custom infrastructure for graph databases, SPARQL, entity stores, and lint pipelines from scratch. But we already have a battle-tested, content-addressable storage with deduplication, provenance, and branching built-in: Git internals.

Instead of just storing Markdown files, why not map knowledge units directly to the Git object model?

The Mapping:

  • Blob → Atomic knowledge unit (a single fact, a proven pattern, or even a "rejected approach").
  • Tree → Category/Index (a directory of related concepts or a specific context snapshot).
  • Commit → Provenance event (who added what, when, and why — with a clear message/reasoning).
  • Branch → Competing hypotheses or parallel research threads (keeping uncertainty alive until evidence resolves it).
  • Merge → Synthesis or resolution (one interpretation wins, or they are merged into a unified truth).
  • Tag → Stable knowledge snapshot ("verified/audited as of date X").

What this gives us for free:

  1. Content Deduplication: Same knowledge = same SHA. This prevents "LLM agents" vs "AI agents" duplicates from bloating the context.
  2. Immutable Provenance: Every fact knows its origin. No more "mostly correct" JSON failures that are hard to trace.
  3. Anti-Repetition Memory: Failed experiments stored as typed blobs. The agent can query "what didn't work" before wasting tokens trying it again.
  4. Diff-based Reviews: A clean way to see exactly how the knowledge state evolved between agent iterations.

The Open Challenge: Active Recall
The biggest gap remains: "How does the agent know to look for something it forgot it has?" Even with a perfect Git-based index, triggering retrieval during a conversation without hardcoded triggers is still the "holy grail." Semantic hashes and tags help, but the "I didn't know I should search" problem is still open.

Pragmatic Take:
Current Markdown + vector search covers ~90% of use cases for ~10% of the effort. But when we hit the walls of scale, deduplication, and provenance, the Git object model becomes a very compelling "knowledge plumbing" solution.

Would love to hear if anyone is already experimenting with using git plumbing commands (not just the porcelain) as their agent's memory backend!

@gnusupport
Copy link
Copy Markdown

@mikhashev git is for source code, not for granular knowledge management. Maybe take five minutes to read at Doug Engelbart already figured out decades ago. You know, an actual Open Hyperdocument System. Not a pile of hashed blobs pretending to be a "brain". https://www.dougengelbart.org/content/view/110/460/

And whole this LLM-WIKI stuff, is like there is some problem there to be solved, while there is none! There are already millions of knowledge management system with so much better architecture.

This whole thread is just 🐑🐑🐑 following the perceveid 👑, "joining" to resolve a problem that has been resolved long ago. But sure, keep reinventing the wheel while calling it innovation — with the LLM-generated BS generating more problems than the imaginary one that was imagined to be solved.

@karlwirth
Copy link
Copy Markdown

Thank you for this idea of using LLMs to build and maintain a wiki. I have been experimenting with this since you proposed it.

Their is friction with the toolchain you propose: Obsidian + Claude Code terminal + browser extension + git + local search is five processes across three windows, and the ingest/lint pipeline is fully manual. It only runs when you remember to run it.

We took the same concept and built it in Nimbalyst, where the markdown editor and Claude Code or Codex are in the same integrated workspace, so there's no tool-switching. A single prompt bootstraps a /wiki command, a daily automation that compiles new sources into wiki pages, and a weekly automation for contradiction detection and stale content cleanup. The automations run on a schedule, so the wiki maintains itself rather than depending on you to trigger each step.

The prompt and more details are here if anyone wants to try it: https://nimbalyst.com/use-cases/knowledge-base/

For me, this wiki LLM approach has been moderately helpful. Anyone have suggestions on how you are getting more out of it?

@YAMLcase
Copy link
Copy Markdown

Windows user here: I'd like to try this, but my first hurdle is getting Obsidian to NOT be a PITA trying to switch between vaults (I'm already using it). Anyone have suggestions on a good workaround, or an alternative markdown viewer-editor-in-one?

@karlwirth
Copy link
Copy Markdown

karlwirth commented Apr 14, 2026 via email

@earaizapowerera
Copy link
Copy Markdown

earaizapowerera commented Apr 14, 2026 via email

@harshitgavita-07
Copy link
Copy Markdown

harshitgavita-07 commented Apr 14, 2026

@karpathy and everyone ,

Building on this I took the idea file a bit too literally and wired it into an AI‑native OS shell instead of “just another app”.

I’ve been hacking on AIOS, a Linux‑based AI operating environment with Rust + Python where the LLM is a first‑class process, not a website tab. Over the last week I bolted on an LLM‑wiki mode that treats a folder of markdown notes as a living knowledge base with three primitives:

  • ingest: watch a directory (docs, code, PDFs converted to md), chunk + normalize, and let the agent compile it into a structured wiki graph instead of raw embeddings.

  • query: local LLM (via Ollama) answers questions by editing the wiki first, then responding from the updated state, so answers always come from the same artifact you can grep / git diff.

  • lint: an agent pass that scans the wiki for contradictions, stale claims, “TODO: verify” zones, and proposes concrete edits as patches.

A few opinions baked in, inspired by the gist:

  • Local‑first: the whole thing runs offline with Ollama + plain markdown; no external APIs, so your “second brain” is just a Git repo and a folder.

  • OS‑level, not app‑level: AIOS exposes the wiki as a system primitive — you can script it from the shell, plug it into cron, or let other agents treat it as the canonical memory instead of each tool reinventing RAG.

  • Multilingual: I’m in India, so my real use‑case is English + Hindi/Marathi mixed notes; ingestion normalizes and tags language so the wiki doesn’t collapse on code‑mixed mess.

Current real‑world test: I’m feeding AIOS my own ML experiments (JAX micrograd rebuild, VLIW performance kernels, and some hackathon work) and using the wiki as a personal “lab notebook compiler” — every new experiment notebook gets distilled into consistent, cross‑linked pages the agent can then reason over.

I’m also actively looking for roles (ML engineer / applied AI / agentic systems) or serious collab work around this pattern — especially teams building local‑first agents, LLM‑native operating environments, or researchy tooling for programmers.

Repo (with a tiny LLM‑wiki quickstart in the README) is here:
👉 https://github.com/harshitgavita-07/Aios

Happy to open issues / PRs to align this more tightly with the idea file if there are patterns you all think I’m missing.

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