Neuromorphic Concepts
Relevant source files
The following files were used as context for generating this wiki page:
Ethos is a neuromorphic memory engine designed to provide AI agents with a long-term memory system modeled after the human hippocampus. It moves beyond simple vector retrieval by implementing biological mechanisms such as memory consolidation, associative spreading activation, and temporal decay based on the Ebbinghaus Forgetting Curve and Long-Term Potentiation (LTP).
The system architecture organizes memory into distinct tiers—episodic traces for short-term conversation context and semantic facts for durable knowledge—while maintaining a graph-based structure where related concepts reinforce one another through access.
Sources: README.md:1-15, README.md:121-125
Memory Lifecycle and Tiering
Ethos manages the transition of information from raw input to permanent knowledge through a structured pipeline. This process mimics the way human sleep consolidates daily events into long-term memory.
Tiered Memory Structure
- Session Events: Raw logs of conversation turns (fast, unlogged ingest).
- Episodic Traces: Clusters of conversation turns with metadata like emotional tone, importance, and novelty.
- Semantic Facts: Durable, structured knowledge (triples: subject-predicate-object) promoted from episodes that meet specific salience or retrieval thresholds.
Sources: README.md:19-24, README.md:52-68, migrations/001_initial_schema.sql:35-125
The following flowchart illustrates the lifecycle of a memory from ingestion to potential pruning or consolidation:
This diagram shows the path of data from session events to either episodic traces or semantic facts, followed by the continuous decay and reinforcement cycles.
Sources: README.md:52-68, ethos-server/src/subsystems/decay.rs:18-24
Ebbinghaus Decay and Long-Term Potentiation (LTP)
The decay engine is responsible for the "forgetting" aspect of the neuromorphic architecture. It uses a mathematical model to simulate how memories fade over time unless they are reinforced by access.
The Salience Formula
The system calculates a salience score using the formula:
$$S(t) = S_0 \times e^{(-t/\tau_{eff})} \times (1 + \alpha \times f) \times (1 + \beta \times E)$$
| Variable | Description | Source |
|---|---|---|
| $S_0$ | Initial or current salience | decay.rs:5 |
| $t$ | Time since last access (in days) | decay.rs:6 |
| $\tau_{eff}$ | Effective decay time constant (influenced by LTP) | decay.rs:7 |
| $\alpha \times f$ | Frequency boost based on retrieval count | decay.rs:10 |
| $\beta \times E$ | Emotional boost based on emotional tone | decay.rs:11 |
Long-Term Potentiation (LTP)
LTP represents the biological process where frequent access makes a memory more durable. In Ethos, every retrieval increments the retrieval_count and extends the effective time constant $\tau_{eff}$. This causes frequently accessed memories to live longer, while ignored ones reach the prune_threshold (default 0.05) and are soft-deleted.
Sources: ethos-server/src/subsystems/decay.rs:3-15, README.md:70-76
Spreading Activation
Spreading activation is a graph-based retrieval method where related concepts "light up" associatively. When a search is performed, it doesn't just find the closest semantic match; it propagates relevance through connected nodes in the memory graph.
Mechanism
- Anchor Selection: The top-K cosine similarity matches from the
memory_vectorstable act as initial "anchor" nodes. - Iterative Propagation: Activation scores are passed from anchors to neighboring nodes through edges in the
memory_graph_linkstable. - Scoring Components: The final relevance is a weighted combination of:
- Cosine Similarity: How well the content matches the query.
- Spread Score: How much activation it received from related concepts.
- Structural Score: The node's in-degree centrality (how well-connected it is).
Sources: ethos-core/src/graph.rs:6-14, ethos-core/src/graph.rs:163-176, README.md:21-22
Graph Link Construction (Linker)
The linker subsystem automatically builds these associative edges using Hebbian Learning principles. When a new memory is ingested, the system finds similar memories and creates edges or strengthens existing ones.
| Edge Property | Logic | Source |
|---|---|---|
SIMILARITY_THRESHOLD | Links only created if cosine similarity >= 0.6 | linker.rs:18 |
WEIGHT_INCREMENT | Hebbian strengthening adds 0.1 to weight per match | linker.rs:21 |
MAX_WEIGHT | Weights are capped at 1.0 | linker.rs:24 |
TOP_K_SIMILAR | Links are created to the top 3 similar memories | linker.rs:27 |
The relationship between nodes and their edges is visualized below:
This diagram depicts the ER relationship between memory entities and the graph links that enable spreading activation.
Sources: migrations/001_initial_schema.sql:165-195, ethos-server/src/subsystems/linker.rs:80-95
Neuromorphic Configuration
The behavior of these neuromorphic systems is controlled via the EthosConfig structure, allowing tuning of decay rates, activation strengths, and consolidation thresholds.
| Config Section | Key Parameters | Description |
|---|---|---|
DecayConfig | base_tau_days, ltp_multiplier, prune_threshold | Controls how fast memories fade and how much LTP slows it. |
RetrievalConfig | spreading_strength, iterations, weight_activation | Controls the depth and power of associative retrieval. |
ConsolidationConfig | importance_threshold, retrieval_threshold | Sets the criteria for promoting an episode to a permanent fact. |
Sources: ethos-core/src/config.rs:56-88
Ethos provides a "hippocampal" memory layer that ensures AI agents retain important context, associate related ideas naturally, and let irrelevant noise fade away, mimicking the biological efficiency of human memory.