-
-
Notifications
You must be signed in to change notification settings - Fork 0
Memory Biological Systems
Spector Memory draws on computational neuroscience research to implement simplified, performance-optimized approximations of biological memory mechanisms. Each package in spector-memory maps to a neuroscience concept, implementing mathematical models inspired by peer-reviewed cognitive science β particularly Anderson's ACT-R architecture (1993) β and optimized for microsecond-scale agent memory operations.
graph TB
subgraph "Encoding & Storage"
STE["π§© Synapse<br/>Synaptic Tags & Scoring<br/><i>Bloom filter + binary layout</i>"]
CT["π§ Cortex<br/>4-Tier Memory Stores<br/><i>Working β Episodic β Semantic β Procedural</i>"]
end
subgraph "Emotional & Importance Modulation"
DA["β‘ Dopamine<br/>Surprise Detection<br/><i>Welford Z-score β importance</i>"]
AM["β€οΈ Amygdala<br/>Emotional Valence<br/><i>-128 to +127 coloring</i>"]
end
subgraph "Retrieval Dynamics"
HB["π Habituation<br/>Anti-Filter Bubble<br/><i>Repetition penalty</i>"]
IN["π« Inhibition<br/>Suppression Set<br/><i>Inhibition of return</i>"]
IF["π Interference<br/>Deduplication<br/><i>Proactive/retroactive</i>"]
end
subgraph "Association & Learning"
HE["π 3-Layer Cognitive Graph<br/>Hebbian + Entity + Temporal<br/><i>Off-heap graph structures</i>"]
end
subgraph "Consolidation & Planning"
HP["π€ Hippocampus<br/>Sleep Consolidation<br/><i>ReflectDaemon cycle</i>"]
PR["π Prospective<br/>Future Intents<br/><i>Scheduled reminders</i>"]
MM["π Metamemory<br/>Self-Reflection<br/><i>Confidence calibration</i>"]
end
DA --> STE
AM --> STE
STE --> CT
CT --> HE
HE --> HP
style HE fill:#e74c3c,color:white
style DA fill:#f39c12,color:white
style HP fill:#9b59b6,color:white
| System | Brain Region | Key Concept | Spector Implementation | Reference |
|---|---|---|---|---|
| [[Cortex | Memory--Cortex]] | Prefrontal, Hippocampus, Neocortex, Basal Ganglia | Multi-store memory model | 4-tier off-heap stores (Working, Episodic, Semantic, Procedural) |
| [[Synapse | Memory--Synapse]] | Synaptic junction | Synaptic tagging & capture | 64-bit Bloom filter tag encoding, 32B binary header |
| [[Dopamine | Memory--Dopamine]] | Ventral tegmental area | Prediction error signaling | Welford Z-score surprise detection, flashbulb encoding |
| [[Amygdala | Memory--Amygdala]] | Amygdala | Emotional memory modulation | Signed valence byte (-128 to +127), emotional filtering |
| [[3-Layer Graph | Memory--Hebbian]] | Cortical networks, Hippocampus | Hebbian learning, STDP, episodic sequences | Off-heap HebbianGraph, EntityGraph, TemporalChain |
| [[Habituation | Memory--Habituation]] | Sensory cortex | Response decrement to repetition | Exponential penalty on repeated recall |
| [[Inhibition | Memory--Inhibition]] | Prefrontal cortex | Inhibition of return | SuppressionSet with TTL-based suppression windows |
| [[Interference | Memory--Interference]] | Hippocampus | Proactive/retroactive interference | Similarity-based deduplication during ingestion |
| [[Hippocampus | Memory--Hippocampus]] | Hippocampus | Sleep consolidation & replay | ReflectDaemon: decay, compaction, episodicβsemantic promotion |
| [[Prospective | Memory--Prospective]] | Prefrontal cortex | Prospective memory | Scheduled future intent reminders |
| [[Metamemory | Memory--Metamemory]] | Prefrontal cortex | Metacognitive monitoring | Confidence calibration, recall quality estimation |
| [[Sync | Memory--Sync]] | β (engineering) | Persistence & replication | WAL + mmap-backed partitions |
Spector approximates the power law of forgetting using precomputed decay buckets β avoiding expensive Math.pow() calls in the hot loop:
Where
References: Wixted, J.T. (2004). The psychology and neuroscience of forgetting[^15]; Ebbinghaus, H. (1885). Γber das GedΓ€chtnis[^13]
Each recall shifts the decay bucket backward, simulating how retrieved memories become more durable:
Reference: Bjork & Bjork (1992). A New Theory of Disuse[^14]
The importance signal uses a Z-score from Welford's online statistics:
Where
Reference: Schultz, W. (1997). A neural substrate of prediction and reward[^3]
Co-ingested memories strengthen their bidirectional edge:
With decay during consolidation:
Reference: Hebb, D.O. (1949). The Organization of Behavior[^5]
Directed causal edges are strengthened when tag A is recalled before tag B:
Reference: Bi & Poo (2001). Synaptic modification by correlated activity[^6]
Spector's core scoring formula is a simplified, hardware-optimized approximation of the ACT-R activation equation (Anderson, 1993):
Spector's approximation:
Where:
- Similarity β ACT-R's spreading activation from current context
-
Importance Γ decay β ACT-R's base-level activation
$B_i$ -
$S^{0.3}$ (storage strength) β Bjork's two-factor model (1992)[^14] - Ξ±, Ξ² = relative weighting of context vs. base-level (default: 0.6, 0.4)
References: Anderson, J.R. (1993). Rules of the Mind[^16]; Anderson, J.R. & Lebiere, C. (1998). The Atomic Components of Thought[^17]
Repeated recall of the same memory incurs an exponentially increasing penalty:
Where
Reference: Thompson & Spencer (1966). Habituation: A model phenomenon[^7]
-
Grounded in research: Each system implements a mathematical model inspired by peer-reviewed cognitive science, optimized for microsecond-scale agent memory operations. The scoring formula is a simplified, hardware-optimized approximation of the ACT-R activation equation (Anderson, 1993)[^16], with extensions for emotional valence (McGaugh, 2004)[^4] and storage strength (Bjork & Bjork, 1992)[^14].
-
Independent testability: Each biological system is a standalone package with its own unit tests. Systems compose via dependency injection, not inheritance.
-
Graceful degradation: Every system is optional. Disabling surprise detection, habituation, or graph augmentation produces a functional (if less intelligent) memory system.
-
Performance-first biology: Biological accuracy is constrained by microsecond latency requirements. Where exact models are too expensive (e.g., continuous exponential decay), we use precomputed approximations (decay buckets, Bloom filter tags).
-
:material-brain:{ .lg .middle } Cortex β Tier Stores
Working, Episodic, Semantic, and Procedural memory tiers
-
:material-flash:{ .lg .middle } Synapse β Tags & Scoring
Bloom filter encoding, binary layout, 6-phase scorer
-
:material-head-lightning-bolt:{ .lg .middle } Dopamine β Surprise
Welford Z-score, flashbulb encoding, importance scoring
-
:material-heart:{ .lg .middle } Amygdala β Valence
Emotional coloring, valence-based filtering
-
:material-share-variant:{ .lg .middle } 3-Layer Cognitive Graph
Hebbian, Entity-Relationship, and Temporal Causal graphs
-
:material-sleep:{ .lg .middle } Hippocampus β Consolidation
Sleep cycles, decay, episodic-to-semantic promotion
[^1]: Atkinson, R.C. & Shiffrin, R.M. (1968). Human memory: A proposed system and its control processes. In Psychology of Learning and Motivation, 2, 89β195. doi:10.1016/S0079-7421(08)60422-3
[^2]: Frey, U. & Morris, R.G.M. (1997). Synaptic tagging and long-term potentiation. Nature, 385, 533β536. doi:10.1038/385533a0
[^3]: Schultz, W. (1997). A neural substrate of prediction and reward. Science, 275(5306), 1593β1599. doi:10.1126/science.275.5306.1593
[^4]: McGaugh, J.L. (2004). The amygdala modulates the consolidation of memories of emotionally arousing experiences. Annual Review of Neuroscience, 27, 1β28. doi:10.1146/annurev.neuro.27.070203.144157
[^5]: Hebb, D.O. (1949). The Organization of Behavior: A Neuropsychological Theory. New York: Wiley.
[^6]: Bi, G. & Poo, M. (2001). Synaptic modification by correlated activity: Hebb's postulate revisited. Annual Review of Neuroscience, 24, 139β166. doi:10.1146/annurev.neuro.24.1.139
[^7]: Thompson, R.F. & Spencer, W.A. (1966). Habituation: A model phenomenon for the study of neuronal substrates of behavior. Psychological Review, 73(1), 16β43. doi:10.1037/h0022681
[^8]: Klein, R.M. (2000). Inhibition of return. Trends in Cognitive Sciences, 4(4), 138β147. doi:10.1016/S1364-6613(00)01452-2
[^9]: Underwood, B.J. (1957). Interference and forgetting. Psychological Review, 64(1), 49β60. doi:10.1037/h0044616
[^10]: Rasch, B. & Born, J. (2013). About sleep's role in memory. Physiological Reviews, 93(2), 681β766. doi:10.1152/physrev.00032.2012
[^11]: Einstein, G.O. & McDaniel, M.A. (1990). Normal aging and prospective memory. Journal of Experimental Psychology: Learning, Memory, and Cognition, 16(4), 717β726. doi:10.1037/0278-7393.16.4.717
[^12]: Nelson, T.O. & Narens, L. (1990). Metamemory: A theoretical framework and new findings. In Psychology of Learning and Motivation, 26, 125β173. doi:10.1016/S0079-7421(08)60053-5
[^13]: Ebbinghaus, H. (1885). Γber das GedΓ€chtnis: Untersuchungen zur experimentellen Psychologie. Leipzig: Duncker & Humblot. English translation: Memory: A Contribution to Experimental Psychology (1913).
[^14]: Bjork, R.A. & Bjork, E.L. (1992). A new theory of disuse and an old theory of stimulus fluctuation. In From Learning Processes to Cognitive Processes: Essays in Honor of William K. Estes, 2, 35β67.
[^15]: Wixted, J.T. (2004). The psychology and neuroscience of forgetting. Annual Review of Psychology, 55, 235β269. doi:10.1146/annurev.psych.55.090902.141555
[^16]: Anderson, J.R. (1993). Rules of the Mind. Hillsdale, NJ: Erlbaum.
[^17]: Anderson, J.R. & Lebiere, C. (1998). The Atomic Components of Thought. Mahwah, NJ: Erlbaum.
[^18]: Park, J.S. et al. (2023). Generative Agents: Interactive Simulacra of Human Behavior. UIST '23. doi:10.1145/3586183.3606763
[^19]: Hu, Y. et al. (2025). MemoryOS: Cognitive-Inspired Memory Architecture for AI Agents. arXiv:2506.06326.
[^20]: McClelland, J.L., McNaughton, B.L. & O'Reilly, R.C. (1995). Why there are complementary learning systems in the hippocampus and neocortex. Psychological Review, 102(3), 419β457. doi:10.1037/0033-295X.102.3.419
[^21]: Baddeley, A.D. (2000). The episodic buffer: a new component of working memory? Trends in Cognitive Sciences, 4(11), 417β423. doi:10.1016/S1364-6613(00)01538-2
[^22]: Bahrick, H.P. (1984). Semantic memory content in permastore: Fifty years of memory for Spanish learned in school. JEP: General, 113(1), 1β29. doi:10.1037/0096-3445.113.1.1
- Home
- Getting Started
-
Cognitive Memory
- Overview
- Getting Started
- Use Cases & Configuration
- API Reference
- Architecture
- The 6-Phase Scoring Pipeline
- Cognitive Profiles
- Salience & Importance
-
Biological Systems
- Overview
- Cortex β Tier Stores
- Hippocampus β Sleep Consolidation
- Synapse β Tags & Scoring
- Dopamine β Surprise Detection
- Amygdala β Emotional Valence
- 3-Layer Cognitive Graph
- Habituation β Anti-Filter Bubble
- Inhibition β Suppression
- Interference β Deduplication
- Prospective β Future Intents
- Metamemory β Self-Reflection
- Sync β Persistence & Replication
- Performance & Internals
- Cognitive Evaluation
-
Architecture
- System Overview
- Core Concepts
- Ingestion Pipeline
- RAG Pipeline
- MCP Integration
- Distributed Mode
- Event Notifications
- Namespace Sharding
- GPU Acceleration
- Performance Tuning
- Test Framework & LLM Judge
- JDK API Status
- Security & Data
- Deep Dives
- Cortex Dashboard
-
Community
- Contributing
- FAQ
- Roadmap
- π¬ Labs