Ollama, LangChain and Obsidian: build a local LLM wiki

Build a Markdown knowledge base with Ollama, LangChain and Obsidian using Gemma 4 E4B. Learn how the demo groups four articles by topic and entity.

Player not loading? Watch on YouTube

This tutorial builds a local knowledge base from saved articles using Ollama, LangChain and Obsidian. The speaker presents it as a simplified implementation of Andrej Karpathy's LLM wiki idea: organize source material into linked Markdown pages that can later supply context to a model, rather than retrieve raw documents for every question.

The workflow starts with Obsidian's Web Clipper Chrome extension, which saves articles and their metadata into a clippings folder. The Python project uses LangChain core and LangChain Ollama, with Gemma 4 E4B as the chosen model. The speaker suggests Llama 3.2 for computers with less available RAM or GPU capacity, without specifying hardware minimums.

The code requests JSON containing summaries, key points, broad topics and specific entities. It merges matching topic and entity names, writes linked pages, and creates an index. The four-article demonstration ends with source, topic and entity views in Obsidian, plus a graph of their connections.

A central limitation is that this implementation clears the generated wiki on each run. It produces a static rebuild rather than the incremental updates described in Karpathy's proposal. The speaker also notes that processing speed depends on the model and computer, while topic and entity quality depends on the model.