Leverage AI

Knowledge Architecture

File Back the Walk

📖 This article has an expanded ebook edition — read the full ebook.

A query is a write in disguise. File the hard answers back as typed derived cache, keep every walk as telemetry, and let the map improve from being used — not just from being fed.

Scott Farrell · LeverageAI · July 2026

TL;DR

Right now, in a chat window you probably have open in another tab, an assistant is doing something quietly wasteful on your behalf.

You ask a question. It fires off searches, reads across a dozen sources, assembles a genuinely good research package in its working memory — and then, when it answers, throws almost all of it away. By the next turn the durable state is the conversation text, so those fetched pages have compressed down to two or three citations and a paragraph. Ask a follow-up and it does the whole expensive gather again from scratch.

The research was the costly part of the turn. The research is exactly the part that gets binned.

Andrej Karpathy noticed the same thing and did something about half of it. In his LLM Wiki gist, the Query operation ends with a line most readers skim past: "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."1 That single move flips which artefact is durable. Conversations become ephemeral; the map persists; exploration compounds instead of evaporating. The community turned it into a directory convention within weeks — the most-installed open implementation ships a literal syntheses/ folder described as "query answers filed back as wiki pages."2

Karpathy files the answer. Almost nobody files the path. And the path — the actual record of where the agent went, what it opened, which branch it entered and abandoned — turns out to be the more informative of the two.

A query is a write in disguise

Start with why this needs no new architecture.

In an ordinary retrieval pipeline, writing and reading are two different machines. Ingestion is dumb by design — chunk, embed, store — and all the intelligence is deferred to query time. That wall is why a corpus accumulates but never compounds. It can't compound: the only moment the system could decide how a new thing relates to everything it already knows is at ingest, and at ingest you built it to think about nothing at all. That is the argument of Ingest Is a Query, and it runs in both directions.

Tear the wall down and something falls out for free. The agent that walks the graph to answer your question is the same agent that walks it to file a new source, and the same agent that walks it to tidy up on a cron. One explorer toolbelt, three North Stars — that's The Scout and the Senior. Which means the query agent's finaliser, handed a write tool, is the ingestion finaliser.

A query that files back is just an ingestion whose source is the system's own exploration.

The wider field arrived at the same conclusion from the other side this year: "Retrieval is still the read path. The novelty is the write path."3 Correct — and the write path has two lanes, not one.

Lane one: the answer, typed as cache

Filing answers back is obviously right and obviously dangerous, and the danger is the reason most people who try it eventually stop.

The objection turned up in Karpathy's own comment thread within days. Critics argued the pattern collapses past roughly a thousand files, that LLM-only maintenance produces compounding hallucinations, and that calling a folder of AI-written markdown a wiki is a category error because no humans collaborate on it.4 Take the middle one seriously, because it is correct as stated. A filed synthesis is a claim whose provenance is the system's own reasoning. File enough of them, unmarked, and future answers build on earlier guesses. The graph gets more confident without acquiring any new evidence. A memory vendor writing about its own category names the same failure precisely: a highly-retrieved memory "is accurate until they change jobs, at which point it becomes confidently wrong."5

The fix is not a better model. It's a type.

The derived page: five properties, all load-bearing

That last property is the one people find counter-intuitive and it's the one that keeps the whole thing honest. A derived page is not knowledge you have acquired. It is work you have already paid for and would rather not pay for twice — which is the definition of a cache, and caches are allowed to be thrown away.

Interestingly, the sharpest commenter on the gist landed within a word of this independently, recommending "a strict type taxonomy (topics, projects, syntheses, questions), graph topology constraints, and explicit handling for contradictions."4 Anyone who runs the pattern seriously reinvents classical knowledge-management discipline. Better to start there.

Not every walk deserves filing

The bloat objection has a second answer, and it's a rule rather than a promise: file on evidence of difficulty.

If the walker traversed five pages to connect two ideas, the map lacked a shortcut — and the synthesis it produced is genuinely expensive to reconstruct. File it. If it was a one-page lookup, the map already worked; filing the answer adds a node that competes for attention with the page that answered it. Discard.

The signal is sitting in the walk log already: hop count before the first useful page, number of distinct clusters joined, whether the agent had to reach past the map to raw source. You are not asking a model to judge whether an answer was good. You are counting how hard the map made it.

Lane two: the path, mined by code

Now the half nobody ships.

Keep the walk transcript. Not a summary of it — the transcript. Summarising is precisely wrong here, because a summary keeps the conclusions and throws away the material that earned them: the pages checked and found irrelevant, the branch entered and abandoned, the region never entered at all. Dead ends are informative, and summaries delete them.

Keeping it is affordable in a way it wasn't two years ago. Append-only transcripts are the cache-optimal shape, and cache reads are documented at roughly a tenth of standard input pricing6 — so the design that writes every tool result into the conversation stopped being an extravagance and became the economical structure. Storage of the finished transcript is cheaper still, and the pass that mines it spends zero model tokens.

Three signals, no model required

Observation in the walk logsCandidate work item
Co-traversal. Two pages repeatedly opened in the same walk, across many walks, with no edge between them. Missing edge. Propose the link, with the walks as evidence pointers.
Abandonment. A branch entered and left without any of its content reaching the answer — repeatedly, by different agents. Dead end. Record it so future walks don't re-earn the ruling.
Non-visitation. Pages never reached across a large sample of walks. Cold page. Rename, relink, demote or compact — in that order.

All three are counting exercises over stored structure. No judgement, no inference, no API call.

The determinism is not an optimisation; it's doctrine. The pass emits candidates, and something else disposes of them. That's the same split the Cascade Ledger makes for influence — AI types the meaning, deterministic software counts the consequences — and it comes with the same instruction: prefer the under-count. A missing-edge ticket you can audit beats a confident score you can't.

The dead ends are the asset

Of the three, the abandonment signal is the one worth dwelling on, because there is hard external evidence that people feel its absence.

A feature request on the Claude Code repository puts it plainly: "Backtrack patterns are invisible — When we try approach X, hit a wall, and pivot to Y, that hard-won knowledge isn't captured anywhere. Future sessions (or future developers) may repeat the same dead-end exploration."7 The same issue notes that "when Claude presents options A, B, and C, and we choose B, the reasoning for rejecting A and C evaporates," and proposes a hand-written DECISIONS.md with status states — active, rejected, backtracked, exploring.7

The instinct is exactly right and the implementation is exactly backwards. Hand-authored logs are a discipline tax: someone must remember to write the entry at the precise moment they are most frustrated and least inclined to. Derive the same log from stored walks and nobody has to remember anything. The system already knows which branch it entered and left. It just wasn't being asked.

A ruled-out path recorded once spares every future walk from re-earning the ruling.

Cold pages are a naming problem before they're a deletion problem

The third signal is the one to handle carefully, and the order of operations matters. A page nobody reaches may be dead weight. It may equally be badly named, or missing the inbound edge that would put it in someone's path. Reach for rename and relink first; compaction last.

That ordering matters because a graph page isn't free. It widens the map every agent reads, it opens a corridor every walker may burn attention on, and it is maintenance surface for the janitor forever. Which makes the honest policy the one caches have used for decades: promote by use, demote by neglect. A summary that keeps getting materialised mid-walk is asking to become a page. A page with no walks in six months and no inbound edges exercised can dissolve back into a pointer stub. Nothing is lost; it just stops costing attention.

And measure it on the read path, not the write path. Most knowledge dashboards count documents uploaded and queries run — door-count metrics that tell you the library is open. The number that matters is the resurrection rate: how much dormant material the system returned to circulation this quarter. That's the argument of Paid to Write, Never Paid to Read, and cold-page telemetry is how you finally compute it.

Three things this is not

The fastest way to get this wrong is to conflate it with a neighbour. Three of them are close enough to matter.

It is not path testing

Path testing grades whether one walk was epistemically sound — the 2×2 of good/bad path against right/wrong answer, whose dangerous cell is the right answer reached by a bad path. That's quality assurance on a single traversal. Telemetry aggregates many traversals into maintenance work on the map. Same artefact, different consumer, different verdict.

It is not the feedback button

When a user disputes an answer you get a labelled failure with frozen evidence — a far stronger signal than an unlabelled successful walk, and it belongs in its own queue. Passive telemetry says where walkers went. Dispute tickets say where walkers were failed. Ship only the first and you improve connectivity while missing the pages users actively reject.

It is not observability, and the scoreboard is not call count

Agent trace tooling is mature — trajectories, tool calls, latency, cost — and the provenance literature has converged on the same premise, that "final-answer accuracy alone cannot explain how an output was produced."8 But traces are conventionally used to validate a change you already decided. Here the trace is mined to discover what the map should become, and the output is a graph mutation rather than a dashboard. One warning that comes with it: never make call count the metric. A better agent may make more calls because it recognises deeper investigation is available. Useful territory reached per unit of attention is the thing; traffic is not.

Where this doesn't apply

Three honest boundaries.

Low-reuse corpora. If the same class of question never comes back, filing answers is pure cost and telemetry has nothing to generalise from. The loop pays where work recurs. Even then, the dead-end log still pays — ruling a path out once is reusable even when the answer isn't.

High-precision domains. Where every claim must trace cleanly to a source — regulatory, legal, clinical — the compiled layer is a convenience, never an authority. Keep the raw sources alongside it and keep the derived tier subordinate by construction, not by policy.

Privacy of the walk log. Walk transcripts record who asked what, which is a different sensitivity class from the corpus itself. Scope them, set retention, and note that the mining pass needs the shape of the walk — page ids, edges followed, branches abandoned — not the query text. You can redact the words and keep the whole signal.

And the honest non-claim: there is no measured magnitude here. I can tell you the mechanism, and I can tell you the three signals fall out of walk logs you are almost certainly already producing. I can't tell you the size of the improvement, and I'm not going to invent one. The experiment is cheap: log co-traversed page-pairs for a week, look at the top twenty, and ask whether a human would agree those edges are missing. If the answer is no, the missing-edge signal is noise for your corpus and you're left with dead ends and cold pages — still two more maintenance feeders than you had on Monday.

The loop that closes

Put both lanes together and something changes about what a knowledge system is.

Ingestion makes the map bigger. Queries make it better. The filed answers mean hard-won syntheses stop evaporating; the mined paths mean the graph's defects stop being re-discovered and silently routed around by one agent at a time. When a walker finds the page contradicted by ground truth, the wrong move is answering around it. The right move is logging a work item — and once that's the default, query-time failures become the janitor's queue.

The map improves from being used, not just from being fed.

Which is also the answer to the question every buyer of an AI system eventually asks and never gets a straight answer to: will it learn how we do things? Under this architecture, yes — and the learning is a browsable diff. New pages, merged claims, a superseded policy, an edge that three walks this month said was missing. You read the week's learning the way you'd read a diligent new hire's notes, correct it where it's wrong, and watch it compound.

Decomposition is what gives you the stable units a walk moves between; Hora's Watchmaker makes that case and I won't re-make it here. This piece is about the residue — what walking those units leaves behind, and why throwing it away is the most expensive habit in knowledge architecture.

Your system is already producing this data. The only question is whether anything reads it.

Start here, this week. Stop deleting walk transcripts. Then write the twenty lines of code that count co-traversed page-pairs across the last thirty days and print the top twenty with no edge between them.

If that list makes you wince, you've just found the first thing your map has been quietly getting wrong — and you found it for free, out of traffic you were already paying for.

References

  1. Andrej Karpathy. "llm-wiki" (GitHub Gist, created 4 April 2026). — "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." Lint operation: "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." gist.github.com/karpathy/442a6bf555914893e9891c11519de94f
  2. SamurAIGPT. "llm-wiki-agent" (SkillsLLM listing; 3,264 GitHub stars at time of access). — Directory structure includes "syntheses/   query answers filed back as wiki pages" and "log.md   append-only record of every operation." skillsllm.com/skill/llm-wiki-agent
  3. Micheal Lanham. "Knowledge and Memory Beyond RAG: Why 2026 Agents Need a Write Path, Not Just a Retriever" (Medium, 24 April 2026). — "Retrieval is still the read path. The novelty is the write path." Also: "Stale writes outlive the chats that created them." medium.com/@Micheal-Lanham/knowledge-and-memory-beyond-rag-why-2026-agents-need-a-write-path-not-just-a-retriever-ae2547b7ffe9
  4. Denser.ai. "LLM Wiki: Karpathy's Idea for AI Knowledge Bases" — reporting criticism raised by commenters on the gist: "the pattern collapses past ~1,000 files", "LLM-only maintenance leads to compounding hallucinations", "calling a folder of AI-written Markdown a 'wiki' is a category error since no humans collaborate on it"; and the constructive recommendation that serious implementations need "a citation model with footnotes, a strict type taxonomy (topics, projects, syntheses, questions), graph topology constraints, and explicit handling for contradictions." denser.ai/blog/llm-wiki-karpathy-knowledge-base/
  5. Mem0. "AI Agent Memory 2026: Progress Benchmark Report Evaluations" (18 July 2026). — On memory staleness as an open problem: "A highly-retrieved memory about a user's employer is accurate until they change jobs, at which point it becomes confidently wrong." mem0.ai/blog/state-of-ai-agent-memory-2026
  6. Anthropic. "Prompt caching" (developer documentation). — Cache-read tokens are billed at approximately one-tenth of the base input rate, so re-reading an unchanged prefix costs a fraction of processing it fresh. docs.anthropic.com/en/docs/build-with-claude/prompt-caching
  7. anthropics/claude-code issue #15222. "[FEATURE] Decision History Tracking with DECISIONS.md" — "Backtrack patterns are invisible — When we try approach X, hit a wall, and pivot to Y, that hard-won knowledge isn't captured anywhere. Future sessions (or future developers) may repeat the same dead-end exploration." And: "When Claude presents options A, B, and C, and we choose B, the reasoning for rejecting A and C evaporates." Proposed status states: ACTIVE / REJECTED / BACKTRACKED / EXPLORING. github.com/anthropics/claude-code/issues/15222
  8. Yiqi Wang et al. "From Agent Traces to Trust: A Survey of Evidence Tracing and Execution Provenance in LLM Agents" (arXiv:2606.04990, submitted 3 June 2026). — "Final-answer accuracy alone cannot explain how an output was produced, which evidence supported each claim, whether tool calls were justified, how memory influenced later decisions, or where failures originated." arxiv.org/abs/2606.04990