Version Control as Memory Architecture

The brain doesn't store memories. It rewrites them. AI still hasn't learned the difference.

Computer Science · Neuroscience · Biocomputing · AI
Your Brain Has Been Running Version Control for 500 Million Years
Biology solved most of the hard problems in computer science long before computers existed. Every read is a write. Every forgotten fact is a feature. And the gap between a neuron and an AI agent is closing from both directions at once.
2026 · Daice Labs

Every time you remember something, you change it. Neuroscientists have known this for decades. Software engineers are only now starting to realize it matters for the machines they build.

Consider what happens when you recall a memory of a childhood argument. You are not playing back a recording. You are reconstructing the event from fragments, coloring it with everything you now know about the people involved, about yourself, about how arguments tend to go. The reconstruction feels like retrieval. Neurologically, it is something far stranger: the act of remembering physically rewrites the memory before storing it again. Every read is a write.

This would be catastrophic in a computer. A filesystem that silently modified files every time you opened them would be considered broken. But the brain does it deliberately, and for good reason. Memories that are retrieved frequently get updated to reflect the organism's current understanding of the world. Memories that are never retrieved fade. The whole system is tuned not for faithful archival but for useful action, for making good decisions in a changing environment.

Now consider what happens when you ask an AI assistant something it should remember. Depending on the system, it either draws on a static snapshot of training data, searches a vector database of past conversations, or reconstructs context from a long but finite window of recent text. None of these approaches work the way the brain works. All of them are running into serious problems. And a growing number of researchers think that the gap between the two, between how brains handle memory and how computers do it, may be the central engineering problem of artificial intelligence.

I. The tool that changed software

To understand why AI memory is hard, it helps to understand how software engineers think about memory now. The dominant framework comes from a tool called Git, and it is worth taking a moment to understand what Git actually does, because it is genuinely elegant.

Git was built by Linus Torvalds in ten days in the spring of 2005 after a licensing dispute left the Linux kernel development team without a version-control system. Version control, in the simplest terms, is software that keeps track of changes to files over time. Every time you save a new version, the system records what changed, who changed it, and when. You can go back to any earlier state. You can create parallel timelines, called branches, try something experimental on one branch, and merge it back into the main branch if it works.

What makes Git elegant is its underlying data structure. Instead of storing the differences between versions, Git stores complete snapshots. Each snapshot is given a unique name generated by running the file's contents through a mathematical function called a hash. The same contents always produce the same name. If you change even a single character, the name changes completely. This means Git can instantly tell whether two copies of a file are identical, and it means that tampering with the historical record is detectable, because any change would alter the name of every snapshot that followed it. The history is immutable.

This architecture, called a Merkle tree after the computer scientist Ralph Merkle who first described it in 1979, is now one of the most widely copied ideas in computing. Bitcoin uses it to secure transaction records. Modern cloud storage systems use it to deduplicate data. The distributed file system IPFS uses it. Cassandra, the database system, uses it. Git just happened to be the place where most programmers first encountered it.

For tracking code, Git works beautifully. For anything resembling knowledge, it starts to break down. Git knows nothing about the meaning of what it stores. It tracks lines of text, not ideas. When two people change the same section of a document in different ways and try to combine their changes, Git does its best to reconcile the differences automatically but frequently gets confused in ways that humans have to untangle by hand. It cannot tell that two seemingly different sentences are saying the same thing, or that two identical sentences are being used to mean different things in different contexts. It archives faithfully and understands nothing.

01 Git's Merkle tree
How Git stores history as an immutable chain of content-addressed snapshots. Each commit points to its parent by hash, and unchanged files are reused automatically across versions.
HOW GIT STORES HISTORY Commit a3f9 Apr 7, 2005 · "init" Commit 7b2c Apr 8 · "add README" Commit e1d4 · HEAD Apr 9 · "fix bug" parent hash parent hash Tree snapshot Tree snapshot Tree snapshot blob blob blob (changed) blob (reused) blob (new fix) blob (reused) Each object is named by a hash of its contents · identical files deduplicate automatically Any edit cascades new hashes up the chain · the history is immutable and tamper-proof
HEAD commit
Tree snapshots
Changed blob objects
II. The part of you that never forgets

While software engineers were building increasingly sophisticated tools for preserving information, biologists were discovering something that seemed almost contradictory: the brain preserves information by constantly changing it. And the more they looked, the more the brain's approach looked like the right answer to problems that software was failing to solve.

The story starts somewhere unexpected: in bacteria. Bacteria are among the simplest living organisms on earth, single-celled creatures without even a nucleus to house their DNA. They have no nervous system, no brain, no ability to learn in any recognizable sense. And yet, researchers discovered in the early 2000s, they have something that functions remarkably like a long-term memory.

It works like this. Many bacteria contain a genetic structure called a CRISPR array, which is essentially a molecular scrapbook of past infections. When a virus attacks a bacterium and the bacterium survives, a pair of proteins called Cas1 and Cas2 snip a short segment of the virus's genetic code and insert it into the CRISPR array, always at the beginning, always in order, creating a chronological record of every virus the bacterium or its ancestors has encountered. If the same virus attacks again, the bacterium can recognize it and mount a defense.

Rodolphe Barrangou and Philippe Horvath proved this in 2007, and the discovery eventually led to the development of CRISPR gene-editing tools that have transformed biology. But the immediate insight is simpler and stranger: bacteria have been running an append-only log of past threats for roughly three billion years. An append-only log is exactly what it sounds like: a record where new entries are always added at the front and old entries are never deleted or modified. It is the same data structure that Kafka uses for message streaming, that Datomic uses for database history, that blockchain networks use for transaction records. The bacteria got there first. The arrays do not grow indefinitely. After 20 to 600 entries, the oldest ones are quietly dropped to make room. This is automatic garbage collection. The same operation that software systems implement deliberately, biology solved by necessity billions of years ago.

02 Biology's append-only log
A CRISPR array in bacteria and a Git commit log share the same fundamental structure: new entries always at the top, strict chronological order, bounded size with automatic pruning at the tail.
BIOLOGY: CRISPR ARRAY SOFTWARE: COMMIT LOG New infection recorded here New commit added here Spacer 4 — Phage D Most recent · 2024 Spacer 3 — Phage C 2021 Spacer 2 — Phage B 2018 Spacer 1 — Phage A Oldest · ~2010 Older spacers pruned automatically Commit e1d4 — "fix bug" Most recent · HEAD Commit 7b2c — "README" 2 days ago Commit a3f9 — "init" 3 days ago Commit 0001 — "start" Oldest History immutable · never overwritten Same structure · different substrate · three billion years apart
CRISPR array (biological log)
Git commit log (software)
III. The two-tier architecture in your head

The bacterial memory system is impressive for its simplicity, but the brain's version of the same idea is vastly more sophisticated, and far more relevant to the AI memory problem. The brain actually runs two different memory systems in parallel, and they have different jobs.

The hippocampus is a small, seahorse-shaped structure deep in the brain that acts like a high-speed recorder. When something happens to you, the hippocampus encodes it quickly, creating a rough trace of the event. It is optimized for speed and novelty: it can form new memories in a single exposure, and it does not care very much whether a new memory conflicts with old ones. This is the write-optimized hot tier, in the language of distributed computing.

The neocortex is the large, wrinkled outer layer of the brain that handles most of what we think of as intelligence: language, reasoning, long-term knowledge about how the world works. It encodes memories slowly, over days and weeks and months, by gradually adjusting the strengths of billions of connections between neurons. It integrates new information with old information carefully, checking for consistency, building abstract frameworks that help organize related knowledge. This is the read-optimized cold tier.

The critical operation that connects the two systems happens during sleep. Matthew Wilson and Bruce McNaughton discovered in 1994 that when a rat sleeps after exploring a new environment, the neurons that were active during the exploration replay their activity in compressed form, running through the sequence at roughly twenty times real speed. The hippocampus is playing back the day's recordings for the neocortex, slowly training it to incorporate the new information into its long-term knowledge base. A 2024 study from György Buzsáki's lab added an important detail. Not all experiences get replayed. The ones selected for overnight consolidation are weighted by how surprising they were, by how much they violated the brain's expectations. Routine, predictable events get compressed or dropped. Unexpected events get prioritized. This is not a FIFO queue. It is a priority queue whose comparator is prediction error.

03 The brain's two-tier memory
The hippocampus encodes fast and tolerates conflict. The neocortex integrates slowly and builds schemas. Sleep replay connects them, but selects what to transfer by surprise, not by recency.
Hippocampus Hot tier · fast writes Encodes any event in one pass Does not check for conflicts analogy: write-ahead log Neocortex Cold tier · slow writes Integrates over weeks Builds schemas and abstractions analogy: compacted column store Sleep replay 20× compressed sharp-wave ripples Selection filter Weighted by surprise · not recency Surprising events High priority · consolidated Routine events Low priority · fade or drop Not a FIFO queue · a priority queue whose comparator is prediction error The brain selects what to remember based on information value, not recency
Hippocampus (hot tier)
Neocortex (cold tier)
Sleep replay connector
IV. Every read is a write

The most counterintuitive of the biological memory principles, and the one most directly relevant to the AI memory crisis, concerns what happens during retrieval itself. In 2000, Karim Nader, working in Joseph LeDoux's lab at New York University, showed that reactivating a consolidated fear memory in rats and then blocking protein synthesis in the amygdala erased the memory. Not the original learning, which had taken place weeks earlier and was supposed to be safely consolidated. The memory as it existed at the moment of recall. LeDoux had told Nader not to run the experiment. When it worked, it demolished a foundational assumption of twentieth-century neuroscience: that consolidated memories were fixed and immune to interference.

What reconsolidation means for systems design is specific. The brain does not rewrite memory on every read. It rewrites memory when retrieval produces prediction error, when incoming information violates the stored pattern. Confirmation triggers no write. Surprise triggers a labile window during which the memory can be updated in light of everything currently known, then re-stabilized. This is a sophisticated conditional update policy, and nothing in our current version-control stack implements it.

Neuromorphic chip and biological memory research

Intel's Loihi 2 neuromorphic chip, a component of the Hala Point system announced in April 2024. Unlike standard processors, Loihi 2 updates its connection strengths locally in real time, mimicking synaptic plasticity without the von Neumann bottleneck. The system packs 1,152 chips simulating 1.15 billion neurons and 128 billion synapses, running at over 15 trillion operations per watt.

V. Why AI keeps forgetting

The memory crisis in artificial intelligence is not a single problem. It is at least four different problems that all stem from the same root: machines that treat knowledge as files to be stored rather than as beliefs to be maintained.

The oldest is catastrophic forgetting. When researchers train a neural network on a new task, the new training overwrites the parameters that encoded the old task. Performance on the original task collapses, often completely. Biological brains do not do this. James Kirkpatrick and colleagues at DeepMind published a solution in 2017 called Elastic Weight Consolidation, or EWC. The idea is to identify which internal parameters are most important to previously learned tasks, using a mathematical technique borrowed directly from McClelland, McNaughton, and O'Reilly's 1995 complementary learning systems theory, and then to penalize changes to those parameters when training on new tasks. The parameters that matter most to old knowledge are protected. The parameters that are less critical are free to adapt.

The second problem is the context window. Large language models process a fixed number of tokens at once. Even with context windows reaching millions of tokens, the fundamental problem remains: once a conversation exceeds the limit, earlier parts of it are simply gone. The third problem is retrieval-augmented generation, or RAG: storing past conversations in a database and retrieving relevant pieces by keyword similarity. This works, up to a point, but it retrieves documents rather than updating beliefs. It has no way to know which stored memories are still accurate, which have been superseded, or which are contradicted by others.

The fourth problem is knowledge editing. Kevin Meng and David Bau at MIT showed in 2022 that you could surgically overwrite a single fact in a language model by directly modifying the right parameters. Tell the model the Eiffel Tower is in Rome, and it will tell you the Eiffel Tower is in Rome. But ask it where Parisians go to see a famous tower, and it will still say Paris. The edit did not propagate through the network of facts that depended on it. The brain's reconsolidation process updates the broader memory trace holistically whenever a mismatch is detected. Software does not yet know how to do this.

04 The four AI memory failures
Where current AI memory systems break: catastrophic forgetting during retraining, the hard context wall, shallow retrieval that finds text without updating beliefs, and knowledge edits that don't propagate.
WHERE CURRENT AI MEMORY BREAKS 1. Catastrophic forgetting Training on task B erases task A Task A learned Encoded in weights Task B training Overwrites parameters Task A performance collapses 2. The context wall Anything beyond the window is gone Active context window Current conversation (visible to model) Earlier text · gone Earlier text · gone 3. Retrieval without update RAG finds text · doesn't revise beliefs Question User asks Similar text found By keyword similarity No belief update occurs 4. Edits without ripple effects Changing one fact breaks related facts Edit: Tower now in Rome Model still says: "Parisians walk to it" Each failure has a biological solution · none are solved together in any current system
AI system behavior
Failure outcome
VI. The industry tries to catch up

In October 2023, a group of researchers at the University of California, Berkeley released a system called MemGPT. The name was a play on the operating system concept of virtual memory. The paper's central argument was that large language models should be treated like CPUs, computationally powerful but limited in what they can hold in active memory at any moment. The solution was to give the model explicit control over what goes in and out of its context window, paging information in from an external database when needed and summarizing or archiving information when the context fills up. MemGPT was later developed into a commercial product called Letta. The architecture is clever. It is also built around the wrong metaphor: an OS page-replacement policy works by recency and priority. Memories are not valuable because they are recent. They are valuable because they are informative.

A few months before MemGPT, a group at Stanford published Generative Agents, a simulation in which 25 AI-powered characters lived in a small virtual town. Each character had a memory stream, a running log of experiences tagged with importance scores. Periodically, when accumulated importance crossed a threshold, the system prompted the AI to generate higher-order summaries of recent events. The summaries were stored back into the memory stream alongside the raw events. This is consolidation in all but name: selective, synthetic compression of recent experience into more abstract, durable form, triggered by salience rather than recency.

By late 2025, every frontier lab had shipped persistent memory to consumers. ChatGPT enabled cross-conversation recall by default in April 2025. Gemini's Personal Context activated in August. Claude's memory feature rolled out across paid tiers through the fall, with Anthropic's implementation using transparent markdown files that users can read and edit. All three systems immediately ran into the same failure modes: context collapse, fading relevance, interference between old and new memories, and no principled policy for what to keep. Claude's memory degrades noticeably above a few hundred lines of stored notes, exactly the symptom you would predict from a hippocampus with no cortex to consolidate into.

VII. When hardware starts thinking like biology

While software engineers have been retrofitting memory onto language models, a separate community of researchers has been asking a more radical question: what if the hardware itself were designed to work the way neurons do?

Standard computer chips separate memory from processing. The processor sits in one place, the memory sits in another, and data shuttles back and forth constantly. This separation, known as the von Neumann bottleneck, is a fundamental inefficiency. In a neuron, the connection to other neurons is both the memory and the processor: it stores a value representing connection strength, and it updates that value locally based on local activity, without any central coordinator. Intel's neuromorphic chip, Loihi 2, attempts to implement this in silicon. Intel's Hala Point system, announced in April 2024, packs 1,152 of these chips together, simulating roughly 1.15 billion artificial neurons connected by 128 billion synapses, running at over 15 trillion synaptic operations per watt.

Even more directly biological are devices called memristors: resistive circuit elements that remember how much current has passed through them. Their resistance changes as a function of history, and they retain that resistance when the power is off, like a neuron holding onto the strength of its connections between activations. Arrays of memristors can perform matrix-vector multiplication, the core operation of neural network inference, without moving data anywhere. Memory and computation happen in the same physical location at the same time.

Then there is DNA. In 2018, researchers at the University of Washington and Microsoft demonstrated a system that could store 200 megabytes of data in synthetic DNA molecules and retrieve specific files using targeted molecular search. The storage density approaches one exabyte per cubic inch, roughly a billion times denser than a hard drive, with stability measured in centuries. Current DNA systems read and write slowly, hours to days, but for archival storage that is acceptable. In 2020, a group of researchers showed that modern Hopfield networks are mathematically equivalent to the attention mechanism in transformers. The query-key-value structure of transformer attention is the same operation as content-addressable memory retrieval in a Hopfield network. John Hopfield, whose 1982 paper was drawing on models of how the hippocampus might work, won the Nobel Prize in Physics in 2024. The mathematical structure he invented to model biological memory turned out to be the core operation inside every modern AI system.

VIII. Designing the next memory

Researchers who work at the intersection of biology and computer science are starting to sketch what a knowledge system might look like if it were built from the ground up around these biological principles, rather than retrofitted with them one piece at a time.

The foundation would be a genuine two-tier architecture. The fast tier would accept writes quickly, without worrying much about consistency with the long-term store. The slow tier would integrate information carefully, checking for contradictions, building abstract schemas, pruning detail. The connection between them would not be a simple data pipeline but a consolidation process that runs offline and selects what to transfer based on information value, weighted by prediction error, not by recency.

Retrieval would trigger a consistency check. When a stored belief is accessed, the system would ask whether it conflicts with what it currently knows. If not, it would serve the cached version unchanged. If yes, it would open an update window, revise the belief in light of current knowledge, and store the updated version while keeping the original as a historical record. This reconsolidation-on-retrieval protocol would prevent the system from serving outdated beliefs indefinitely, which is the most common failure mode of current agent memory systems.

Forgetting would be deliberate. The most important and counterintuitive finding from the neuroscience of memory is that forgetting is not the failure of a system designed to remember. It is the operation of a system designed to abstract. To extract the general rule from the specific instance, you have to stop keeping the instance around. A knowledge system that never forgets will eventually be paralyzed by the weight of its own history. The biological answer, which no software system currently implements well, is to forget the specific while retaining the structural.

05 A bio-inspired memory architecture
The proposed integrated system: experience enters a fast encoding tier, a salience filter selects what consolidates based on surprise, a background process compresses into a knowledge graph, retrieval triggers a reconsolidation check, and principled forgetting continuously prunes the long-term store.
New experience Conversation · event · observation Fast encoding · hot tier Stores quickly · no conflict check Salience filter Weighted by surprise · not recency Surprising Routine Fades · expires no consolidation Consolidation Background · compresses to schema Knowledge graph · cold tier Versioned · timestamped beliefs Retrieval + reconsolidation check Conflict? Rewrite. Confirmed? Cache. Forgetting policy · prunes stale beliefs Immutable archive · cold storage
Fast encoding (hot tier)
Knowledge graph (cold tier)
Reconsolidation check
IX. A three-billion-year head start

There is a strange loop at the center of this story. For decades, neuroscientists described the brain using the language of computers. Memory was storage. Recall was retrieval. Learning was programming. The metaphor was so pervasive that it shaped how researchers designed experiments and interpreted results, sometimes in ways that obscured what was actually happening.

Now the loop is closing in the other direction. Elastic weight consolidation is named after the biological process it mimics. Experience replay is named after hippocampal sleep replay. The mathematical equivalence between transformer attention and Hopfield networks was not designed; it was discovered, a structural connection between two independent attempts to solve the same problem of content-addressable memory. In January 2025, Samuel Gershman at Harvard, Ila Fiete at MIT, and Kazuki Irie published a paper called "Key-value memory in the brain." Their argument was that the key-value-query structure of transformer attention, invented for machine learning, is actually the right formal model for understanding how the hippocampus stores and retrieves memories. Not just analogous. Formally correct. AI theory is feeding back into neuroscience, closing a loop that took a century to open.

The next significant advance in AI memory will not come from making context windows larger or vector databases faster. It will come from implementing, in software and in hardware, the operations that biology field-tested under selection: salience-driven encoding, compressed replay-based consolidation, prediction-error-gated reconsolidation, and semantic forgetting. The pieces exist. Neuromorphic hardware implements local plasticity rules. DNA storage serves as cold-tier archival memory. Temporal knowledge graphs implement versioned belief states. Elastic weight consolidation implements weight-level consolidation. What does not yet exist is a coherent architecture that combines them into a single unified process.

The first CRISPR spacer was inserted into a bacterial genome roughly three billion years ago. The first Git commit was pushed in April 2005. The distance between those two events is a rough measure of how far ahead biology is. But the distance is closing, and the direction of travel is now clear.

Key references: Barrangou, Horvath et al., "CRISPR provides acquired resistance against viruses in prokaryotes" (Science, 2007); Wilson & McNaughton, "Reactivation of hippocampal ensemble memories during sleep" (Science, 1994); Nader, Schafe & LeDoux, "Fear memories require protein synthesis in the amygdala for reconsolidation after retrieval" (Nature, 2000); McClelland, McNaughton & O'Reilly, "Why there are complementary learning systems in the hippocampus and neocortex" (Psychological Review, 1995); Kirkpatrick et al., "Overcoming catastrophic forgetting in neural networks" (PNAS, 2017); Mnih et al., "Human-level control through deep reinforcement learning" (Nature, 2015); Meng & Bau, "Locating and editing factual associations in GPT" (NeurIPS, 2022); Packer et al., "MemGPT: Towards LLMs as operating systems" (arXiv 2310.08560, 2023); Park et al., "Generative agents: Interactive simulacra of human behavior" (arXiv 2304.03442, 2023); Ramsauer et al., "Hopfield networks is all you need" (2020); Ceze & Strauss et al., "Molecular digital data storage using DNA" (Nature Materials, 2018); Gershman, Fiete & Irie, "Key-value memory in the brain" (arXiv 2501.02950, 2025).