Andrej Karpathy 源文件摘要
源文件信息
- 标题: LLM Wiki - A pattern for building personal knowledge bases using LLMs
- 作者: Andrej Karpathy
- 日期: 2026-04-04
- 原始链接: https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f
- 类型: GitHub Gist / 概念文档
- 星级: 5,000+ ⭐
- Fork: 2,996
核心要点
1. 问题定义
传统 RAG 系统的局限性:
- 每次查询都要重新发现知识
- 没有积累
- 需要每次都拼凑相关信息
- 知识是分散的,不是结构化的
2. 解决方案
LLM Wiki 模式:
- 持久化维基: 结构化的、互联的 Markdown 文件集合
- 增量维护: 新源文件到来时,整合到现有维基
- 复合增长: 知识编译一次,保持更新
- 交叉引用: 由 LLM 自动维护
3. 三层架构
- Raw sources (输入层): 不可变的源文件
- The wiki (维基层): LLM 生成和维护的页面
- The schema (规范层): 定义结构和工作流程的文档
4. 操作流程
- Ingest (摄入): 处理新源文件,更新多个页面
- Query (查询): 基于维基回答问题,有价值的答案可存回维基
- Lint (维护): 定期健康检查,优化维基
5. 核心文件
- index.md: 内容索引,帮助定位
- log.md: 按时间顺序的操作日志
6. 工具建议
- Obsidian Web Clipper: 快速获取文章
- 下载图像到本地
- Obsidian 图视图: 查看知识网络
- Marp: 生成幻灯片
- Dataview: 动态查询
- qmd: 本地搜索工具
7. 为什么有效
- 人类痛点: 维护负担增长快于价值
- LLM 优势: 不会厌倦,不会忘记,可以同时更新多个文件
- 分工: 人类负责策展和提问,LLM 负责维护
详细内容
与 Memex 的关系
这个想法与 Vannevar Bush 的 Memex (1945) 相关:
- 个人的、精心策划的知识存储
- 文档之间的关联轨迹
- 私有的、主动策划的
- 连接与文档本身一样有价值
Bush 无法解决的部分是:谁来做维护?LLM 现在处理这个问题。
应用场景示例
-
个人
- 追踪目标、健康、心理学、自我提升
- 归档日记、文章、播客笔记
- 构建结构化的自我画像
-
研究
- 深入某个主题数周或数月
- 阅读论文、文章、报告
- 逐步构建综合维基,形成演进的论点
-
阅读书籍
- 边读边归档每个章节
- 构建人物、主题、情节线索的页面
- 最终形成类似维基百科的陪伴维基
-
团队/商业
- 内部维基由 LLM 维护
- 源自 Slack、会议记录、项目文档、客户电话
- 人类审核更新
- 维基保持最新,因为 LLM 做了没人想做的维护工作
实现提示
- 维基只是 Git 仓库
- 获得版本历史、分支、协作为免费赠品
- 可以根据领域和偏好定制
- 一切都是可选和模块化的
- 从小规模开始,逐步扩展
关键引用
“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.”
“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.”
“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.”
“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 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.”
相关维基页面
本次摄入创建或更新了以下页面:
- llm-wiki-pattern (概念页面)
- Wiki 架构设计 (架构设计文档)
- SCHEMA (结构规范)
- 维基索引
- 操作日志
社区反馈
文档底部有一些有价值的社区评论:
-
OORAG (Object-Oriented RAG)
- 基于”一切都是对象”的原则
- 从文档块移动到结构化实体对象
- 完整属性、明确类型约束、清晰关系字段
- 动态函数绑定
- 准确性从 60-70% 提升到 95%+
- 幻觉率从 15-25% 降低到 2-5%
- 参考: https://gist.github.com/minchieh-fay/2c586d5d0d17d07698ab0bbdedf5e1b7
-
LLM4Rec 实现
- 使用 Qwen Code 构建的推荐系统维基
- 参考: https://github.com/Accagain2014/LLM4Rec_wiki
-
Actor-Network 理论
- 基于 Bruno Latour 的图网络方法
- 通过类型化关联链接节点
- 基于网络权重、中心性、新鲜度、争议信号、网关瓶颈的检索层
元数据
---
tags: [summary, llm-wiki, knowledge-management, andrej-karpathy]
source-url: https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f
ingested-date: 2026-04-10
author: Andrej Karpathy
created: 2026-04-10
---