Expand description
Hebbian file co-access graph — “files that fire together, wire together”.
§The idea (neuroscience → retrieval)
Hebbian theory: synapses between co-active neurons strengthen (long-term potentiation, LTP), while unused ones weaken (long-term depression / the Ebbinghaus forgetting curve). We apply the same rule to files: whenever a task surfaces a set of files together, we strengthen the association between every pair; on each update all weights decay slightly, so stale associations fade. Over time the graph learns the project’s real working paths — which the static import/AST graph cannot capture.
The learned association is an additive retrieval signal: given a file the
agent is looking at, related returns the files history says tend to be
touched alongside it.
The store is a small per-project JSON file; reads/writes are whole-file and cheap because the graph is pruned aggressively (decay + min-weight + caps).
Structs§
- CoAccess
Graph - Persistent, decaying co-access graph for one project.
Functions§
- load
- Load the co-access graph for
project_root(empty if none / unreadable). - record_
access - Record that
fileswere accessed together for one task, persisting the reinforced graph. No-op for fewer than two distinct files. - related
- Files historically co-accessed with
file, strongest association first.