A developer replaced an LLM-based personal wiki system with a pure Python compiler using only the standard library. The pipeline has four stages: a regex metadata extractor, a word-indexed graph builder for cross-references, a section-aware rewriter that preserves hand-written notes, and a linter. Two real bugs are documented with fixes — a quadratic graph builder (O(n²) pairwise regex replaced with a word-indexed phrase matcher) and a linter that miscounted orphan pages by scanning the wrong section. Benchmarks across Linux and Windows at 100, 1,000, and 5,000 files show deterministic, identical outputs on both platforms. The core argument: deterministic text organization is a parsing problem, not a reasoning problem, and LLMs are the wrong tool for the mechanical 90% of knowledge base maintenance.

17m read timeFrom towardsdatascience.com
Post cover image
Table of contents
TL;DRWhy I wrote thisThe compiler mindsetThe problem with agent-driven wikisStep 1: The regex metadata extractorStep 2: The Graph BuilderStep 3: The section-aware rewriterStep 4: The Linter (and the Second Bug)The Full Test SuiteThe Benchmark: Two Machines, Same NumbersWhere this breaksClosing thoughtResources and citations
10.6K Impressions