Thread by @karpathy
相关洞察: ../../Tech/AI/LLM 驱动的个人知识库构建方法论Andrej Karpathy @karpathy 2026-04-02
LLM Knowledge Bases
法学硕士知识库
Something I'm finding very useful recently: using LLMs to build personal knowledge bases for various topics of research interest. In this way, a large fraction of my recent token throughput is going less into manipulating code, and more into manipulating knowledge (stored as markdown and images). The latest LLMs are quite good at it. So:
我最近发现了一个非常有用的东西:使用 LLM 为各种研究课题建立个人知识库。通过这种方式,我最近的大部分代币吞吐量都减少了对代码的操作,而更多地用于操作知识(以 markdown 和图片的形式存储)。最新的 LLM 在这方面相当擅长。那么
Data ingest:
I index source documents (articles, papers, repos, datasets, images, etc.) into a raw/ directory, then I use an LLM to incrementally "compile" a wiki, which is just a collection of .md files in a directory structure. The wiki includes summaries of all the data in raw/, backlinks, and then it categorizes data into concepts, writes articles for them, and links them all. To convert web articles into .md files I like to use the Obsidian Web Clipper extension, and then I also use a hotkey to download all the related images to local so that my LLM can easily reference them.
数据摄取:
我将源文件(文章、论文、资源库、数据集、图片等)索引到一个 raw/ 目录中,然后使用 LLM 逐步 "编译 "一个 wiki,它只是一个目录结构中 .md 文件的集合。维基包括 raw/ 目录中所有数据的摘要、反向链接,然后将数据归类为概念,为概念撰写文章,并将它们全部链接起来。要将网络文章转换成 .md 文件,我喜欢使用 Obsidian Web Clipper 扩展,然后我还会使用热键将所有相关图片下载到本地,这样我的 LLM 就可以轻松地引用它们。
IDE:
I use Obsidian as the IDE "frontend" where I can view the raw data, the the compiled wiki, and the derived visualizations. Important to note that the LLM writes and maintains all of the data of the wiki, I rarely touch it directly. I've played with a few Obsidian plugins to render and view data in other ways (e.g. Marp for slides).
IDE:
我使用 Obsidian 作为集成开发环境的 "前端",在这里我可以查看原始数据、编译后的 wiki 以及衍生的可视化效果。需要注意的是,LLM 负责编写和维护维基的所有数据,我很少直接接触这些数据。我使用过一些黑曜石插件,以其他方式渲染和查看数据(例如用于幻灯片的 Marp)。
Q&A:
Where things get interesting is that once your wiki is big enough (e.g. mine on some recent research is ~100 articles and ~400K words), you can ask your LLM agent all kinds of complex questions against the wiki, and it will go off, research the answers, etc. I thought I had to reach for fancy RAG, but the LLM has been pretty good about auto-maintaining index files and brief summaries of all the documents and it reads all the important related data fairly easily at this ~small scale.
问答:
有趣的是,一旦你的维基足够大(例如,我最近的一些研究有大约 100 篇文章和大约 40 万字),你就可以针对维基向你的 LLM 代理提出各种复杂的问题,它就会去研究答案,等等。我原以为我必须使用花哨的 RAG,但 LLM 在自动维护索引文件和所有文档的简短摘要方面一直做得很好,而且在这种~小规模的情况下,它可以相当轻松地读取所有重要的相关数据。
Output:
Instead of getting answers in text/terminal, I like to have it render markdown files for me, or slide shows (Marp format), or matplotlib images, all of which I then view again in Obsidian. You can imagine many other visual output formats depending on the query. Often, I end up "filing" the outputs back into the wiki to enhance it for further queries. So my own explorations and queries always "add up" in the knowledge base.
输出:
我不喜欢用文本/终端来获取答案,而是让它为我呈现 markdown 文件、幻灯片(Marp 格式)或 matplotlib 图像,然后我再在 Obsidian 中查看所有这些内容。根据查询的不同,你还可以想象出许多其他可视化输出格式。通常,我最终会把输出结果 "归档 "到维基中,以便进一步查询。因此,我自己的探索和查询总是在知识库中 "累加"。
Linting:
I've run some LLM "health checks" over the wiki to e.g. find inconsistent data, impute missing data (with web searchers), find interesting connections for new article candidates, etc., to incrementally clean up the wiki and enhance its overall data integrity. The LLMs are quite good at suggesting further questions to ask and look into.
林汀
我已经在维基上运行了一些 LLM "健康检查",例如,查找不一致的数据、估算缺失数据(使用网络搜索器)、为新的候选文章查找有趣的联系等,以逐步清理维基,提高其整体数据的完整性。法律硕士们非常善于提出进一步的问题,并进行研究。
Extra tools:
I find myself developing additional tools to process the data, e.g. I vibe coded a small and naive search engine over the wiki, which I both use directly (in a web ui), but more often I want to hand it off to an LLM via CLI as a tool for larger queries.
额外工具
我发现自己需要开发更多的工具来处理数据,例如,我在维基上编写了一个小型、简单的搜索引擎,我可以直接使用它(在网页界面中),但更多的时候,我希望通过 CLI 将它交给 LLM,作为大型查询的工具。
Further explorations:
As the repo grows, the natural desire is to also think about synthetic data generation + finetuning to have your LLM "know" the data in its weights instead of just context windows.
进一步探索:
随着软件仓库的不断扩大,我们自然希望同时考虑合成数据的生成和微调,以便让 LLM 在其权重中 "了解 "数据,而不仅仅是上下文窗口。
TLDR: raw data from a given number of sources is collected, then compiled by an LLM into a .md wiki, then operated on by various CLIs by the LLM to do Q&A and to incrementally enhance the wiki, and all of it viewable in Obsidian. You rarely ever write or edit the wiki manually, it's the domain of the LLM. I think there is room here for an incredible new product instead of a hacky collection of scripts.
简要说明:从一定数量的来源收集原始数据,然后由 LLM 编译成 .md 维基,然后由 LLM 使用各种 CLI 进行操作,以进行问答并逐步增强维基,所有这些都可以在 Obsidian 中查看。你很少会手动编写或编辑维基,它是 LLM 的领地。我认为这里有空间开发出一种令人难以置信的新产品,而不是一堆乱七八糟的脚本。
续: Oh and in the natural extrapolation, you could imagine that every question to a frontier grade LLM spawns a team of LLMs to automate the whole thing: iteratively construct an entire ephemeral wiki, lint it, loop a few times, then write a full report. Way beyond a .decode().
哦,再进一步想象一下,对于前沿级别的 LLM 来说,每一个问题都会引发一组 LLM 的协作,从而自动化整个过程:迭代地构建一个完整的临时 wiki,进行代码检查,重复几次后,最终撰写一份完整的报告。这远远超出了.decode()所能处理的范畴。
