DEV Community

Cover image for How do Hebbian learning and association networks work in agentic memory architectures?
Edward Izgorodin
Edward Izgorodin

Posted on Originally published at mnemoverse.com

How do Hebbian learning and association networks work in agentic memory architectures?

Hebbian learning in agent memory is a rule for one number, the weight of the link between two stored items. When the two come back in the same retrieval, the weight goes up, and in most working versions it decays when they stop coming back together. An association network is the graph of those weighted links. It is often read by spreading activation: the items that match the query pass part of their activation along their links, so a memory can come back without resembling the query.

That is the narrow meaning of the word, and I think it is the one worth keeping. Many memory systems called associative do something else under the same name. Some write a link once, when a memory is stored. Others rank by embedding similarity and keep no links at all. A third kind moves a weight when an answer is rated; if that rule also needs the two items to be used together, the textbook calls it a three-factor rule. Each of these can be a sound design, but the word associative does not say which one a product runs, and the mechanisms break on different inputs. Similarity misses a memory that is needed but does not resemble the question; co-use weighting misses a correction that appears only once.

Hebb's rule and its two conditions

Donald Hebb stated his postulate in 1949, and the Hebbian theory page on Wikipedia quotes it: "When an axon of cell A is near enough to excite a cell B and repeatedly or persistently takes part in firing it, some growth process or metabolic change takes place in one or both cells such that A's efficiency, as one of the cells firing B, is increased." The slogan about neurons that fire together and wire together came later, and the textbook Neuronal Dynamics finds it "less precise than Hebb's original formulation", because in Hebb's version cell A has to fire slightly before cell B.

For software, the useful part is in section 19.2 of the same book: "There are two aspects in Hebb's postulate that are particularly important; these are locality and joint activity." The same section draws the line: "If the Taylor expansion had been stopped before the bilinear term, the learning rule would be called 'non-Hebbian', because pre- or postsynaptic activity alone induces a change of the synaptic efficacy and joint activity is irrelevant."

I like this definition because it can be checked against code. Raise one memory's score each time it is read, and you have a rule on one side. Strengthen the link between two memories each time they come back together, and you have a rule on both. Only the second is Hebbian by the book, and the two behave differently in a running system: the first moves memories that are read often up the ranking, and the second changes which memories come back along with a given one.

Section 19.1 says the rule has no teacher: "We emphasize that Hebbian learning is unsupervised, because there is no notion of 'good' or 'bad' changes of a synapse." The Hebbian theory page explains that the plain rule is unstable, so working versions add decay or a cap on the weight. A rule that also listens to an outcome depends, in the words of section 19.4, "on three factors, i.e., the two Hebbian factors and the neuromodulator"; the book calls these "three-factor learning rules", and the third factor is "most often taken as 'reward minus expected reward'". In an agent, the rating of an answer plays that part.

Spreading activation is a search

On Hacker News on 4 November 2026, someone asking for advice on analogical retrieval wrote: "I want my model to partially go off on a tangent, in a good way". A tangent here means reaching a memory that does not resemble the query, and a link between memories is one way to get there. One classic way to read such a network is spreading activation, which Wikipedia defines as "a method for searching associative networks": "The search process is initiated by labeling a set of source nodes (e.g. concepts in a semantic network) with weights or 'activation' and then iteratively propagating or 'spreading' that activation out to other nodes linked to the source nodes."

The definition calls it searching, and that is accurate: spreading activation walks weights that already exist and by itself changes none of them. A system can read its graph this way and never learn from use, and another can learn from use and still find things only by similarity. So for any memory called associative I would ask two things separately: what writes a link, and what reads it.

Five things called association

In the papers and documentation I read for this question, five different mechanisms go by the name. Four decide which items count as related. The fifth reads the result.

Mechanism What creates or moves the link When it changes In the textbook's terms
Co-use strengthening Two items retrieved or used together; unused links decay On every read that returns both Hebbian: joint activity of both sides
Link written at storage An extracted fact, an entity two memories share, a link the model chose, a count made while the graph is built On write; a read leaves it as it was No learning rule; set when written
Similarity Closeness of two embeddings Computed per query, nothing kept A score per item, with no link at all
Outcome weighting A rating or reward on an answer that used the items After the rating Three-factor, if it also needs joint activity
Spreading activation Activation passed along existing weights from the items that match the query During the read A search; the weights stay as they are

Real systems mix several rows, and the second row sometimes carries the name Hebbian as well. BambooKG, a preprint, describes in its abstract "a knowledge graph with frequency-based weights on non-triplet edges which reflect link strength, drawing on the Hebbian principle of 'fire together, wire together'." Per the full text, those weights are counted while the graph is built. That is a fair use of the slogan, but a build-time count and a weight moved by reads behave differently once the system is in use, so I keep them in separate rows.

HeLa-Mem and the other papers

For the first row, the example I would point to is HeLa-Mem, accepted to ACL 2026 and listed in the Anthology as 2026.acl-long.625. Its abstract names what similarity search misses, "the associative structure of human memory, wherein related experiences progressively strengthen interconnections through repeated co-activation".

The full text states the rule in one line, "edge weights strengthen when memories are co-activated during retrieval", and the update has two terms. The previous weight shrinks by a decay rate, and a reinforcement is added when both memories are in the current retrieved set, so a link grows only with joint use and fades without it. Reading takes two paths. Similarity finds the first memories, learned associations bring in more, and the paper ties this to how people recall: "it is a spreading activation process where one thought triggers another." I found no term in the update for whether an answer was right, so by the textbook HeLa-Mem is Hebbian in the strict sense, with decay added.

SYNAPSE "models memory as a dynamic graph where relevance emerges from spreading activation rather than pre-computed links." In its full text, edges come from time, embedding similarity and co-occurrence, and the method section does not describe learning edge weights from use. HippoRAG combines "LLMs, knowledge graphs, and the Personalized PageRank algorithm". The model extracts the graph, a step the full text calls "open information extraction (OpenIE)", and the read is PageRank from the query's concepts.

Generative Agents scores each memory alone, and in its retrieval score, "Recency assigns a higher score to memory objects that were recently accessed". By the textbook's definition that is a rule on one side, so Generative Agents does not belong in the Hebbian row.

InMind, a benchmark preprint, makes the case for links with an example similarity cannot handle: "A tree-nut allergy should change the answer to a macaron request through their almond-flour ingredient, yet the two texts share no cue a retriever can see." Per the abstract, "six vector, graph, and agentic memory systems reach at most 14.4 percent, even though they recall the same facts on demand at up to 100 percent". I read every number as the output of its recipe. Here the recipe is the authors' own benchmark, and the abstract does not name the six systems, so I do not name them either.

The products, by their own documentation

Whether a read writes to a product's graph was the subject of an earlier article. This time I read the vendors' pages for where a link comes from and what moves its weight.

Zep builds its graph from facts a model extracts, and How Graph Creation Works says "Each extracted fact is compared to existing edges: duplicates merge, and contradictions invalidate older facts rather than leaving conflicting truths side by side." Zep takes feedback on agent Skills; Retrieve Skills says "This feedback controls the trust value and the search rank of each Skill." The pages I read do not describe a graph edge strengthening because two facts came back together. An edge changes when a newer fact invalidates it, which is what a fact that changes over time needs.

Mem0 links memories through the entities they share; its Graph Memory page says "Two entities are related when they co-occur in one or more memories". On a search, connected memories get a ranking boost, which the page says is combined with the vector and keyword scores into one score. Feedback is given per memory, and the Feedback Mechanism page says "Mem0 continuously learns from this feedback, refining its memory generation and search capabilities". It does not say whether ratings change the entity links.

Among Zep, Mem0, Cognee and Letta, Cognee is the one whose documentation says the outcome of use moves the weights of graph edges. The Improve page says "Session feedback updates feedback_weight on graph nodes and edges that were used during retrieval." The pages describe a weight on each element an answer used, moved by the rating, and they do not call it Hebbian.

In Letta, memory is a set of files the agent edits. Per the Memory page, "An agent's memory is its own: it persists across conversations, follows the agent between models and computers, and the agent edits it as it learns." On the pages I read, the model writes the structure and no rating is described. Background subagents consolidate lessons into memory.

For Mnemoverse, the API overview describes "A graph of concepts that occur together in a memory or in a rated recall, readable with memory_graph". The API reference says a rating "moves each memory's valence and the association links between its concepts", that a read expands through those links by default ("Expand via concept associations (default: true)"), and that each edge read back from the graph carries a weight documented as "Co-activation strength" and a "Co-activation count".

System Where a link comes from Effect of use on the weight What a read does Effect of an outcome
HeLa-Mem (research) Joint retrieval Grows with co-retrieval, decays without Similarity, then spreading activation Not described in the update
SYNAPSE (research) Time, similarity, co-occurrence Not described in the method Spreading activation with inhibition and decay Not described
HippoRAG (research) Triples extracted by the model; synonym edges by similarity Not described Personalized PageRank from the query's concepts Not described
A-MEM (research) A link the model sets between similar notes No link weight described; a new note can update older notes' descriptions Similarity, then the notes linked to what was found Not described
Generative Agents (research) Reflections point to the memories they cite; retrieval scores each memory alone Recency of each memory Recency, importance and similarity Not described
HAGE (research) Learned edge representations Through training Query-dependent routing Yes, reinforcement learning on tasks
Zep and Graphiti Facts extracted by a model Invalidated by newer facts; strengthening not described Semantic, keyword and graph traversal Feedback on agent Skills; on graph edges not described
Mem0 Entities shared between memories Links: not described; opt-in memory decay reinforces each memory a search returns Ranking boost combined with vector and keyword scores Feedback per memory; effect on links not described
Cognee Entities and relationships an LLM extracts Through feedback weights Vector seeds, then a 1-hop graph expansion; feedback weights count once you opt in Yes, on nodes and edges an answer used
Letta Memory files the agent edits The agent rewrites them The agent reads what it needs No rating described; background subagents consolidate lessons into memory
Mnemoverse Concepts in one memory or in a rated recall Ratings move the links Semantic search, then expansion through learned concept links Yes, ratings

In this table, not described means the pages I read do not describe it. It does not mean the system lacks it, and I tested none of these systems.

The correction that appears once

On r/AI_Agents, the author of a thread about a memory after 25 weeks runs co-use weighting in one of its graphs: "An associative graph where edges strengthen on co-access and decay when unused, deliberately untyped, it's just reinforcement." A commenter, alaattincagil, proposed a test: "an important instruction that appears only once." The author replied: "the correction that appears once has nothing to co-occur with, so it's exactly what co-access weighting is worst at." In another reply the same author wrote: "pruning is currently silent, so an edge that was removed and an edge that never existed look identical afterward."

A co-use rule has no teacher, as the textbook says, so it strengthens what is used together and cannot tell frequent from right. I would let such weights decide what comes back along with a memory, and never what an agent takes as true. CODE_HEIST, in a thread on brain-like memory, wrote that "forgotten truth can be more dangerous than retained noise" and drew a similar line: "Facts should require explicit invalidation, while preferences and weak associations can decay." Swarm-Stack, in the same thread, named the case a contradiction check does not catch: "no contradiction, just an outdated entry that looks correct until you act on it."

Telling them apart from outside

Most of these mechanisms can be told apart from outside the system. If a store exposes edge weights, read one, retrieve its two memories together several times without rating anything, and read it again, with a pair never retrieved together as the control. If only the first pair moved, the store strengthens links on co-use. A link that exists right after you write two memories sharing an entity, with nothing read in between, was written at storage. One rated answer shows whether a rating moves the memory, the links between its items, or both. A link left unused for a while shows whether links decay, and whether a pruned link can be told from one that never existed.

Two more checks look at answers instead of weights, so they work even when a store does not expose its links. One has the InMind shape: a question that shares no words with the memory it needs, like the allergy and the almond-flour macaron, asked with the linking memory stored and again without it. If the answer appears only when the link exists, the read follows associations. The other is alaattincagil's single instruction, made harder. After many writes that repeat an old habit, write one correction once, then ask a question it should change.

A Python implementation of a long-term associative memory, with a control, is in another earlier article. The library page Hebbian memory for AI agents describes how Mnemoverse expands a read through learned concept associations and takes outcome feedback.

I read every source quoted here on 5 November 2026 and checked each quotation a second time with a separate read. Papers get new versions and vendor pages change, so the text describes them as they stood on that day.

I work on Mnemoverse; its row in the table comes from its public documentation, read on the same day and in the same way as every other row.

Top comments (0)