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.

@xuhe83-cyber
Copy link
Copy Markdown

Karpathy makes KB automation look like poetry, while I’m out here realizing I need a crash course in computer science just to open the right directory. Praising the genius of his vision while I prepare to spend my weekend fighting with file paths and shell scripts. Let the 'from zero to one' journey begin~

@JieqLuo
Copy link
Copy Markdown

JieqLuo commented Apr 9, 2026

Extended this with three additions: (1) the wiki only stores knowledge that's passed through your own thinking —
dialogue, challenge, practice — not auto-compiled summaries, (2) the LLM challenges your understanding before writing
entries, so you grow with the collection, (3) every new entry connects to your existing knowledge, making the compounding
effect work on your understanding, not just your pages. Idea file + implementation:
https://gist.github.com/JieqLuo/41761c7fbe48b233f6bf6b50ddee5d95

@swartzlib7
Copy link
Copy Markdown

Been thinking about this a lot lately. We've been trying to do this with cognition. Not the things you know, but the way you actually think. The heuristics you apply without noticing, the tensions between things you believe, the mental models that shape every decision before you're even aware you're making one.
The hard part isn't storage, it's extraction. You can't just ask someone what their values are. You have to start from a real decision. What did you reject? What tradeoff actually mattered to you? What rule did you apply on instinct? Our approach, an LLM reads through conversation transcripts on a schedule and classifies what it finds against a strict hierarchy of types. Decision rule, framework, tension, preference. "Idea" is last resort. Everything gets a confidence score and an epistemic tag so the system knows the difference between something you're sure about and something you're still working out.
Typed edges rather than a flat list. Supports, contradicts, evolved_into, depends_on. That's what makes it traversable rather than just searchable. An agent can walk the contradictions in your own reasoning, find connections between domains you never explicitly linked, or surface something you've been circling for weeks without naming it.
Nodes decay too, which felt important. Values hold. Ideas fade fast. The graph is supposed to model what's live in your thinking right now, not accumulate everything you've ever said, but that's probably a personal choice.
Mine has 8,000+ nodes at this point, 16 MCP tools, runs as an npx server. Curious whether the decay model resonates with you or whether you'd approach that part differently.
https://github.com/multimail-dev/thinking-mcp

Very interesting

Howdy,

Reading this stirred a bit of philosophy in me so here is a bit of my thinking.

I agree, this is very interesting and so is your piece. I believe tooling and technology is the area that requires the engineering attention today. It's as if all the excitement of LLM capability got every user throwing flat files at the LLMs. Sure, we've all wished for the ability to do that at one point or another, but this is just a temporary dream come true in recent years - and what a joy it's been. I think Andrej is hitting at this point and very aptly timed as well.

Continually building smarter models is a small piece of the bigger picture. Not to mention attempting to construct a mind for a machine when most people do not understand the mechanics. Heck, this subject itself has been tainted by many individuals in our history so it will not be easy to get right the first time. Human mental processes and machine mechanics have similarities, but they are fundamentally different by nature.

What has worked for me in the past was to identify key distinctions and strip them down to the most basic common denominators. From here I run it back up that line to see if it reaches the same distance conceptually - this, by the way, is not something a machine can do without us, so let's be thankful we are human... If it does reach and if you don't feel like you're losing your mind then you are on the right track with a mental model that can be replicated programatically. And that is a big point, you can't make an LLM be a program, it is a language model and the closest it will ever be to a functional system is if someone makes it part of one. This is now becoming clear to many individuals. A Wiki is a good start for personal use, but it is not the end game.

This stuff is simple if it is worked from fundamental truth. Most of our modern technology has been built this way. AI without proper tooling and technical gear will always be a bit useless. Build a system to store and connect data expertly and FORCE your AI to use it with no artificial choice. You will have a winning system.

@Jwcjwc12
Copy link
Copy Markdown

Jwcjwc12 commented Apr 9, 2026

Lots of interesting implementations. One thing I keep seeing is per-file ingestion shaping knowledge into articles that mirror the source corpus, which gets complicated fast (document types, templates, categorization schemes) and doesn't transfer well across domains. A different approach: compile at query time, shrink the knowledge unit, and validate against sources on every read instead of periodic lint. Wrote up the details here: https://gist.github.com/Jwcjwc12/6bfb80a0bd274cb965deb5dbd2f5d63f

@Pratiyush
Copy link
Copy Markdown

Pratiyush commented Apr 9, 2026

🟢 [Live demo →](https://pratiyush.github.io/llm-wiki/)

💾 [GitHub](https://github.com/Pratiyush/llm-wiki)

MIT · Python stdlib only · no server, no database, no account


Every Claude Code / Codex CLI / Cursor session writes a transcript to disk.
You have hundreds. You never look at them again.

llmwiki turns that dormant history into a beautiful, searchable, interlinked knowledge base — locally, in two commands.

image


What you get out of the box:

  • 365-day GitLab-style activity heatmap — see exactly when and how hard you've been building
  • Tool-call bar charts + token usage cards per session — real cost and effort visibility
  • Structured AI model cards with benchmark comparisons — know your tools
  • Auto-generated vs-pages (Claude Sonnet 4 vs GPT-5) — built from your actual usage
  • Project topic chips, highlight.js code blocks, full dark mode
  • AI-consumable exports (llms.txt, JSON-LD, per-page .txt / .json) so other agents can query your knowledge base directly
  • Complete maintainer governance scaffold included

image image
image image
image image

@aidevws
Copy link
Copy Markdown

aidevws commented Apr 9, 2026

github.com/emil-celestix/celestix-ifr

Have you created something based on your theory?

@whooan
Copy link
Copy Markdown

whooan commented Apr 9, 2026

This shines because of simplicity. Turning pdfs to markdown with embedded images, graph translation, and figure detection, is our speciality at @anyformat-ai.

If you are trying to build your own wiki over pdfs, ping us and we will grant you 1000 pages for free using the "llm-wiki" code.

@connectwithprakash
Copy link
Copy Markdown

Great idea around doing the bookkeeping! Very helpful as I have been using Obsidian and even more with LLMs and I was definitely having issues with bookkeeping. 👏

@panakh
Copy link
Copy Markdown

panakh commented Apr 9, 2026

you don't really need the index for it i think - just instruct llm to do ls in the directory

@roomi-fields
Copy link
Copy Markdown

You mention in "Optional: CLI Tools" that "at small scale the index file is enough, but as the wiki grows you want proper search."

I built that layer — RTFM ( https:\\github.com/roomi-fields/rtfm ).

What it adds to the LLM Wiki pattern:

  • rtfm vault — one command to index an Obsidian vault with auto corpus mapping
  • FTS5 + semantic + hybrid search (replaces index.md scanning)
  • [[wikilink]] resolution following Obsidian rules → stored as graph edges
  • Hub detection, orphan detection, centrality-based ranking
  • Auto-generated _rtfm/ directory: Obsidian-native navigation with wikilinks, Mermaid diagrams, Dataview-queryable frontmatter
  • Progressive disclosure: search returns metadata (~300 tokens), agent expands only what's needed
  • 10 parsers: Markdown, Python AST, LaTeX, PDF, YAML, JSON, Shell, XML, HTML, plaintext (easily extandable)

The LLM still writes the wiki. RTFM handles the retrieval.
pip install rtfm-ai[mcp] && cd your-vault && rtfm vault

Tested on a 1700-file vault. 357 tests. MIT licensed.

@sergio-bershadsky
Copy link
Copy Markdown

Thanks for that! I believe we are working on pretty similar things: I wrote several articles about that and made some of the implementation

@minchieh-fay
Copy link
Copy Markdown

Thank you for sharing your insights on the future of RAG systems. Your perspectives on software 2.0 and knowledge organization have been truly inspiring.

I've been thinking deeply about this topic, and I believe I've found an approach that could represent the ultimate form of RAG. I call it OORAG (Object-Oriented RAG), based on the principle "Everything is an Object."

The core idea is to move from document chunks to structured entity objects, where each object has:

  • Complete attributes (no information scattering)
  • Explicit type constraints (precision filtering)
  • Clear relationship fields (parent, children, related, functions)
  • Dynamic function binding (real-time data support)

Key results from my exploration:

  • Accuracy improvement from 60-70% to 95%+
  • Hallucination rate reduction from 15-25% to 2-5%
  • Complex multi-hop relationship queries: 50% → 95% accuracy
  • Real-time dynamic data queries: 20% → 90% accuracy

The math behind this: instead of relying on vector similarity + LLM reasoning (with compound error rates), we use entity recognition + type filtering + direct attribute access, which dramatically reduces error propagation.

I've written a comprehensive article with implementation details, TypeScript examples, and performance comparisons:
https://gist.github.com/minchieh-fay/2c586d5d0d17d07698ab0bbdedf5e1b7

Would love to hear your thoughts on whether this object-oriented paradigm aligns with your vision for knowledge systems. The approach combines knowledge graph concepts with strong type constraints and dynamic capabilities—essentially treating knowledge as a programmable object network rather than static text fragments.

Thanks again for your thought leadership in this space!

@Accagain2014
Copy link
Copy Markdown

Thanks for that! I use Qwen Code build an LLM4Rec repo with this wiki's instruction. I hope this repo is useful for someone doing research in LLM for recommendation.
https://github.com/Accagain2014/LLM4Rec_wiki/tree/main

@Bytekron
Copy link
Copy Markdown

Bytekron commented Apr 9, 2026

Good point. I approach this through an actor-network-inspired graph in the spirit of Bruno Latour, where nodes are linked through typed associations. On top of that, I use a retrieval layer that prioritizes by network weight, centrality, freshness, controversy signals, and gateway bottlenecks. In other words, what rises to the surface is not every stale claim on equal footing, but what the graph itself actively supports.

Errors can still enter the system, of course, but they do not automatically spread as truth unless the network keeps reinforcing them. In practice, day-to-day knowledge work becomes less about endless manual cleanup and more about triaging the noisy parts of the graph—though a bit of linting never hurts. I really want to integrate an LLM into my Minecraft Server list to tune up the minecraft servers information a bit more...

Lets see how far I will get with the project :D

Thanks for the share!!!

@waydelyle
Copy link
Copy Markdown

waydelyle commented Apr 9, 2026

SwarmVault — another update, lots has changed. Karpathy's LLM Wiki gist is now the explicit inspiration in the repo itself. Since my last comment we've gone from v0.1.27 → v0.6.1, and the project has grown well beyond the original code-first framing.

What's new:

  • First-class personal knowledge ingest — transcripts (.srt, .vtt), Slack exports, email (.eml, .mbox), calendar files (.ics), EPUBs, CSV/TSV, XLSX, and PPTX are all now proper sources with parser-/library-backed extraction. Not just code repos anymore.
  • Guided source sessionsswarmvault source add --guide opens a resumable session with durable state under state/source-sessions/. One source at a time, evolving summaries, open questions, thesis tracking. Approval queue stages guided edits before they become canonical.
  • Configurable profilesswarmvault init --profile personal-research (or compose your own with presets like reader,timeline). Profiles decide dashboard packs, guided-session routing, and canonical-review behavior.
  • Managed sources + docs crawlswarmvault source add|list|reload|delete with a persistent registry, shallow git checkouts for public repos, and bounded same-domain docs crawls so recurring documentation sources stay fresh.
  • Contradiction detection — deterministic cross-source claim comparison with contradicts edges in the graph and a dedicated section in wiki/graph/report.md. swarmvault lint --conflicts surfaces them directly.
  • Markdown-first dashboards under wiki/dashboards/ for recent sources, timeline, contradictions, open questions — all readable in plain Obsidian, Dataview-enhanced when you want it.
  • Semantic hashing that ignores operational frontmatter churn, so compile/analysis caches stay stable while still invalidating on meaningful changes.
  • Large-graph overview mode in the graph viewer with deterministic sampling, plus --full for the complete canvas.
  • Kotlin, Scala, Lua, Zig, reStructuredText added to the code-aware ingest languages on top of the existing 12+.

Still local-first, still provider-agnostic (OpenAI, Anthropic, Gemini, Ollama, OpenRouter, Groq, Together, xAI, Cerebras, or the built-in heuristic provider for fully offline use). Still MIT licensed.

The core thesis from Karpathy's original gist — that the wiki itself is the durable, compounding artifact — has held up remarkably well in practice. Everything that's been built since is basically downstream of that idea.

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

Contributions, issues, and use-case reports very welcome.

@skyllwt
Copy link
Copy Markdown

skyllwt commented Apr 9, 2026

Hey @karpathy — your LLM-Wiki idea really resonated with us.

We're a team from Peking University working on AI/CS research.

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.

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.

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

OmegaWiki

@ControllableGeneration
Copy link
Copy Markdown

We've been working on this exact same vision for weeks, well before this post was published.

This is the result AI-Context-OS: https://github.com/alexdcd/AI-Context-OS.

To take this idea further, we built a local desktop app (Tauri + Rust + React) that turns any folder into an agnostic memory layer, adding these key improvements:

  • Progressive Memory: Uses YAML frontmatter with explicit depth levels (L0, L1, L2) so the agent only loads the necessary information density.
  • Active Governance: Local telemetry (SQLite) audits memory "health", detecting conflicts, redundancies, and suggesting cleanups to avoid context bloat.
  • Adapters & MCP: Neutral core files act as a router to auto-generate tool-specific rules (claude.md, .cursorrules, .windsurfrules), plus built-in MCP servers.

AI Context OS is in active development. Core features are stable and in daily use:

✅ Workspace setup and file ontology ✅ YAML frontmatter + L0/L1/L2 tiered content ✅ Hybrid 6-signal scoring engine (Rust) ✅ Intent-adaptive weight profiles ✅ Query expansion ✅ MCP server (stdio + HTTP/SSE) ✅ Multi-tool router with adapters (Claude, Cursor, Windsurf, Codex) ✅ Governance (decay, conflicts, consolidation, scratch TTL) ✅ Health score (5-component) ✅ Observability (SQLite, query history) ✅ Simulation view (preview context for any query) ✅ Journal (daily outliner, Logseq-style) ✅ Tasks (YAML-frontmatter tasks with state/priority) ✅ Graph visualization (memory connectivity) with community coloring ✅ Community detection (LPA + tag co-occurrence) feeding graph proximity score ✅ God nodes governance tab (importance mismatch detection) ✅ Backup/restore On the roadmap:

⬚ Local embedding model for true semantic scoring ⬚ Agents marketplace (installable agent templates) ⬚ Multi-workspace support ⬚ Import from Obsidian/Logseq

If you're looking to implement this model in a structured and auditable way, I invite you to check out the repo and share your feedback!

I glanced at your project and felt too heavy for llm.wiki-alike application.

@doublesecretlabs
Copy link
Copy Markdown

Love this! I built a Chrome extension companion for this — clips web pages to clean markdown with frontmatter and saves directly to Google Drive. Designed to feed the raw/ layer with no local sync needed. https://github.com/doublesecretlabs/llm-wiki-clipper

@ESJavadex
Copy link
Copy Markdown

🔥 Built an open-source implementation — Knowledge Forge

A functional, self-contained Node.js repo that implements this entire pattern:

  • Ingest markdown sources → auto-extracts concepts/entities
  • Wiki links ([[link]] syntax) with cross-referencing between pages
  • Index + Log — navigable catalog and append-only operation history
  • Lint pass — detects orphans, dangling links, missing frontmatter
  • Web UI — dark-themed SPA with sidebar, type filters, and search

Home view

Source page with wiki links

Concept page accumulating cross-references

Quick start:

git clone https://github.com/ESJavadex/knowledge-forge.git
cd knowledge-forge
npm install && npm run demo && npm start

Currently uses heuristic extraction (frequency + bigrams). Roadmap includes LLM-powered semantic extraction for much richer concept/entity discovery.

MIT licensed. Contributions welcome! 🚀

@cthulhu-ma
Copy link
Copy Markdown

cthulhu-ma commented Apr 9, 2026 via email

@uziiuzair
Copy link
Copy Markdown

This pattern maps closely to what I've been building with Continuity.

The three layers translate directly:

  • raw sources → immutable chat history in SQLite,
  • the wiki → typed memories with version history and a relationship graph,
  • the schema → system prompt composition that injects memories into every conversation.

The main extension: the knowledge base runs as an MCP server, so any MCP-compatible tool (Claude Code, Cursor, etc.) reads and writes to the same store. Cross-tool continuity without cloud sync.

A few additions beyond the pattern here:

  • Narrative synthesis: the LLM builds a holistic mental model with confidence scores, not just individual facts
  • Learning signals: corrections, rejections, and approvals are tracked as typed signals that feed back into narrative updates
  • Chat as write path: no explicit ingest step; structure emerges from conversation
  • Memory versioning: every change tracked with timestamps and reasons

The lint concept is something I want to steal. We have staleness detection via snapshot hashes but no deliberate audit workflow yet.

https://github.com/uziiuzair/continuity

@AutomaticHourglass
Copy link
Copy Markdown

I think this could be minified into perpetual thinking wikis. For example, you can fire up an empty wiki and say search and think on everything transformer related and create a wiki

@jaychia
Copy link
Copy Markdown

jaychia commented Apr 9, 2026

I love this and wrote an article about this back in Dec '25 :)

https://www.daft.ai/blog/knowledge-curation-not-search-is-the-big-data-problem-for-ai

The biggest data problems pre-AI was in information retrieval. There's going to be so much compute going into knowledge curation - it's literally creating NEW knowledge asynchronously.

@raja-soundaramourty
Copy link
Copy Markdown

Thanks @karpathy.

@YoloFame
Copy link
Copy Markdown

Great writeup! This LLM-powered wiki pattern is such a clever solution to the long-standing maintenance overhead of personal/team knowledge bases. I've been experimenting with rolling this out for our engineering team's internal wiki lately and really love the core idea.

One major blocker I'm running into right now though: LLM-generated intermediate artifacts tend to amplify factual errors, especially for small text details. For project-level wikis where accuracy is mission-critical (think API parameter definitions, version dependency constraints, launch timeline records, etc.), these uncaught errors can be catastrophic for the whole team. The only workaround I've found so far is pouring tons of time into manual cross-checking of every LLM edit against raw sources, which basically cancels out the time-saving benefit of this pattern in the first place.

Would be super excited to see any discussions or proposed solutions to mitigate this accuracy issue! 🙏

@gptix
Copy link
Copy Markdown

gptix commented Apr 10, 2026

Thanks for this!
I've been building a similar workflow using Grok (via web), github, a local repo, and Emacs org-roam and magit.
I ingested this gist ("inGISTed'??) into my system, then worked with Grok to pull in couple of features (more formal index format than I was using, and de-linting).
I was inspired to get rolling on this by implementing a Zero-Human Organization, in turn inspired by Brian Roemmele's Zero-Human company.

@Aryan1718
Copy link
Copy Markdown

Aryan1718 commented Apr 10, 2026

@karpathy idea of LLM-powered wikis is powerful, I tried taking it one step further.

Instead of only maintaining a persistent markdown wiki for retrieval and synthesis, I built a project that uses those markdown files to generate structured training data and fine tune a language model locally. The goal is to turn the wiki into true long term memory and use the trained model itself as the reasoning layer, rather than relying only on retrieval at query time.

This approach works especially well for document heavy use cases where consistent reasoning and deeper understanding matter more than repeatedly reconstructing context.

Here is what I am building: https://github.com/Aryan1718/md2LLM

Still in progress, would really appreciate any feedback on improving.

@harshitgavita-07
Copy link
Copy Markdown

@karpathy and other contributers and maintainers .

I would be happy to endorse this cs.LG/AI submission, which turns a real incident with an autonomous, tool‑using AI agent into a concrete seven‑layer safety architecture and a cryptoeconomic governance framework for self‑evolving systems—an original, technically grounded contribution that fits well within machine learning and AI safety; if you would (or would not) like to endorse, please visit
https://arxiv.org/auth/endorse?x=YT6SDI (or http://arxiv.org/auth/endorse.php with
Endorsement Code: YT6SDI).

(https://info.arxiv.org/help/endorsement.html)

@EtienneChollet
Copy link
Copy Markdown

I came at this from the code side. I have a background in biochemistry (where structure === function) and I keep seeing the same thing in code. The domain knowledge is already latent in the identifiers and structure. It doesn't need to be written. It needs to be extracted.

I think your post here nails the core insight: the value is in the compiled, persistent artifact, not in re-deriving it on every query. For prose and research, that artifact is a wiki. For code, it's an ontology. Same pattern, different source material.

The part that resonates most w/ me is "the LLM is rediscovering knowledge from scratch on every question." That's exactly what I see agents doing with codebases. Ask "what does 'xyz' mean in this codebase?" without a semantic index and the agent does a million tool calls, reads 100k tokens, takes a few minutes.

Where I think code differs from prose: the structure is machine-parseable. You don't need the LLM to build the index -- deterministic analysis can do it (or at least provide the LLM with the important stuff). I built a thing (ontomics: https://github.com/EtienneChollet/ontomics) that parses source code with tree-sitter, runs TF-IDF over subtokens to find domain-specific concepts, clusters them by embedding similarity, detects naming conventions, and groups functions by behavioral similarity using code embeddings. It makes a semantic index of your project's domain vocabulary — concepts, conventions, abbreviations, relationships, behavioral clusters — exposed as MCP tools that any agent can call.

@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.

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