The Memory Protocol
The Memory Protocol is our proprietary data pipeline that extracts, structures, and prunes long-term context from your logs to feed our relational AI companion, ARIA.
Why a Memory Protocol?
Large Language Models (LLMs) are stateless. To simulate memory, standard applications typically send your entire chat history with every prompt. However, this is token-heavy, costly, and lacks cognitive structure. It leads to context drift and makes it impossible for an AI companion to recall patterns over months or years.
The Memory Protocol solves this by parsing your daily reflections into a Personal Knowledge Graph (PKG). This structures your experiences as nodes (e.g. entities, events, habits) and edges (relationships).
How it works
The pipeline runs in four stages:
1. Entity Extraction: When you save a journal entry or mood check-in, the system parses the text for entities (e.g. `Work`, `Sleep`, `Yoga`) and emotional states.
2. Relationship Mapping: The system draws links (edges) between these entities (e.g., `Yoga` -> `mitigates` -> `Anxiety`).
3. Graph De-duplication: The new nodes are merged with your existing graph to avoid duplicates, updating the weight of active nodes.
4. Context Synthesis: When you chat with ARIA, the system fetches your active graph nodes and summarizes your current "life chapter" in the prompt, allowing ARIA to reference your habits naturally.
[User Log] ──> (Entity Extraction) ──> [New Nodes: Sleep, Stress]
│
▼
[Updated Graph] <── (De-duplication) <── (Relationship Mapping)
│
▼
[Context Synthesizer] ──> (Injects Life Chapter) ──> [ARIA Chat Model]
Node Weighting & Decaying
To prevent the graph from becoming cluttered, every edge and node has a weight from 1 to 10. Every time a relationship is confirmed or logged, its weight increases. Conversely, we apply a time-based decay formula:
$$W_{new} = W_{old} \times e^{-\lambda t}$$
Where:
- $W$ is the node/relationship weight.
- $\lambda$ is the decay constant (defaults to $0.05$ per day).
- $t$ is the elapsed time in days since the last reference.
Nodes with weights falling below a threshold of $1.5$ are pruned from the active prompt context, ensuring ARIA focuses on your active life themes while archiving older chapters.