# Identity Persistence: v0.6 → v2.5

From v0.6 (15 Feb) to v2.5 (21 Feb): 7,832 words to 8,760 words, 978 words in new or rewritten paragraphs and 50 taken out, 44 paragraphs changed.

## Change note of v2.5

**Generic system description, brain analogy and first deployment figures**

The paper drops "v2" from its name and stops describing one named agent: the system becomes "a representative personal agent". A new section compares persona upkeep to the brain, where connections between memories matter more than how much is stored. A peer-review round by two models (named in the paper's changelog) led to the other changes.

- New section 1.2: connection density versus storage volume, as a neuroscience grounding.
- The expected-outcomes section becomes an evaluation roadmap with early observations: SyncScore between 0.7 and 0.9 in 94% of sessions over three months, about 85% recognition across sessions, under 5% of the token budget spent on the pipeline.
- Notes that the scoring weights are defaults that hold under a ±20% change.
- Adds a paragraph on how often re-injection may fire without breaking the conversation (under 2 per 50 turns).
- Adds the LongMemEval reference.

## Changed paragraphs

Marks: [-removed-] {+added+}.

### Agent Memory: Priority-Aware Context Engineering for Persistent AI Identity

# Agent [-Memory v2:-] {+Memory:+} Priority-Aware Context Engineering for Persistent AI Identity

### Agent Memory v2: Priority-Aware Context Engineering for Persistent AI Identity

[-**Authors:** Oscar Serra, JarvisOne Agent System **Date:** February 15, 2026 **Version:** v0.1 (GPT-5.2-pro reviewed)-]

### Agent Memory: Priority-Aware Context Engineering for Persistent AI Identity

{+**Authors:** Oscar Serra **Date:** February 2026 **Version:** 1.1+}

### Abstract

Personal AI agents operating within bounded context windows face a fundamental tension: the need for persistent identity across unbounded interaction histories versus the finite attention budget of transformer-based language models. We present Agent [-Memory v2,-] {+Memory,+} an integrated architecture addressing persona drift, context rot, and memory inefficiency in long-running AI agent systems. Drawing on recent advances in memory operating systems (MemOS), observational memory (Mastra), persona vectors (Anthropic), hierarchical retrieval (RAPTOR), and behavioral stability benchmarks (PTCBench), we propose seven interconnected components: (1) priority-aware memory injection using multi-signal scheduling, (2) persona-preserving compaction that retains voice and relational markers, (3) automated SyncScore drift detection via exponentially weighted moving averages, (4) mid-context persona re-injection to counter U-shaped attention degradation, (5) RAPTOR-inspired hierarchical memory trees, (6) an observational memory layer achieving high compression with stable context windows, and (7) reinforcement-based memory decay. We ground our design in a production personal agent [-(JarvisOne/OpenClaw)-] {+(OpenClaw)+} and provide implementation specifications, complexity estimates, and a phased roadmap. Our architecture targets significant reduction in persona drift and 30–60% reduction in effective context window usage. All quantitative claims are framed as engineering targets pending ablation studies and human-calibrated evaluation.

### 1.2 Scope and Contributions

[-### 1.2 Scope and Contributions-]

### 1.2 Connection Density vs. Storage Volume: A Neuroscience Grounding

{+### 1.2 Connection Density vs. Storage Volume: A Neuroscience Grounding+}

### 1.2 Connection Density vs. Storage Volume: A Neuroscience Grounding

{+A key insight from neuroscience—surfaced during collaborative design sessions (Serra, 2026-02-19)—provides theoretical grounding for why persona maintenance requires not just storing identity but actively *connecting* identity markers to retrieval pathways.+}

### 1.2 Connection Density vs. Storage Volume: A Neuroscience Grounding

{+**The biological observation:** Intelligence correlates more strongly with connection density (synaptic richness) than with raw storage volume (neuron count). Research on sex differences in brain architecture illustrates this vividly: female brains typically contain fewer neurons but exhibit denser inter-regional connectivity, supporting multi-domain parallel cognition and superior performance on tasks requiring cross-modal integration. Male brains typically contain more neurons but sparser connections, supporting deep single-domain focus [Ingalhalikar et al., 2014; Ritchie et al., 2018]. The cognitive capability of each architecture arises not from how much is stored but from how richly stored elements are interconnected.+}

### 1.2 Connection Density vs. Storage Volume: A Neuroscience Grounding

{+**Mapping to AI agent memory:** In agent memory systems, stored files and memory chunks function as analogues of neurons—units of information storage. Retrieval paths (vector similarity links, anchor-to-cluster mappings, provenance edges, task-state bindings) function as analogues of synapses—the connections that make stored information *accessible* in context.+}

### 1.2 Connection Density vs. Storage Volume: A Neuroscience Grounding

{+Current agent memory systems are **neuron-heavy and connection-light**: they accumulate rich storage (conversation logs, tool outputs, knowledge bases) but maintain sparse retrieval pathways (typically a single vector similarity search or keyword match). The result is the architectural equivalent of a brain with billions of neurons and few synapses—vast latent knowledge that cannot be efficiently activated.+}

### 1.2 Connection Density vs. Storage Volume: A Neuroscience Grounding

{+The CORTEX + HIPPOCAMPUS architecture directly addresses this imbalance:+}

### 1.2 Connection Density vs. Storage Volume: A Neuroscience Grounding

{+- **HIPPOCAMPUS** (Serra, 2026c) adds the connection layer: pre-computed anchor-to-chunk mappings, semantic anchor expansion, cross-source indexing, and importance-weighted cluster ranking. Each anchor→chunk edge is a synapse that did not previously exist. - **CORTEX** (this paper) ensures that persona-defining memories—voice markers, relational stances, behavioral constraints—are not merely *stored* but actively *connected* to retrieval via priority floors (Section 5.1), persona-preserving compaction (Section 5.2), and SyncScore-driven re-injection (Section 5.4). - **TRACE** (Serra, 2026a) provides the lossless substrate, ensuring that connections (pointers, provenance links, task bindings) always resolve to ground-truth events rather than lossy summaries.+}

### 1.2 Connection Density vs. Storage Volume: A Neuroscience Grounding

{+Together, the three-layer stack transforms an agent's memory from a storage-rich, connection-poor system into one where the density of retrieval pathways matches the richness of stored content—mirroring the neuroscience insight that connection density, not storage volume, is the binding constraint on intelligent behavior.+}

### 1.3 Scope and Contributions

{+### 1.3 Scope and Contributions+}

### 1.3 Scope and Contributions

2. **Agent [-Memory v2**,-] {+Memory**,+} a seven-component architecture that treats memory as a managed system resource with lifecycle semantics, priority scheduling, and persona-preservation guarantees.

### 1.3 Scope and Contributions

3. **An implementation roadmap** grounded in a production personal agent system [-(JarvisOne on OpenClaw),-] {+(OpenClaw),+} with concrete tool choices, complexity estimates, and dependency analysis.

### 3. Current Architecture: JarvisOne v1

[-## 3. Current Architecture: JarvisOne v1-]

### 3. Current State: Common Failure Modes in Personal Agent Systems

{+## 3. Current State: Common Failure Modes in Personal Agent Systems+}

### 3.1 Representative System Overview

### 3.1 {+Representative+} System Overview

### 3.1 Representative System Overview

[-JarvisOne is-] {+Consider+} a {+representative+} personal AI agent running on the OpenClaw platform, built atop Claude (Anthropic). [-The-] {+Such a+} system operates as a persistent assistant with voice interface (sherpa-onnx TTS/Whisper STT), multi-channel messaging (WhatsApp, webchat), and extensive tool use. The memory architecture {+described here+} has evolved organically over approximately six months of production [-use.-] {+use and illustrates patterns common across personal agent deployments.+}

### 4. Design Requirements

Based on the failure analysis (§3.5) and the literature survey (§2), we derive the following requirements for Agent [-Memory v2:-] {+Memory:+}

### 5. Proposed Architecture

## 5. Proposed [-Architecture: Agent Memory v2-] {+Architecture+}

### Mechanism

[-// Weighted combination (tunable hyperparameters) return ( 0.35 * similarity + // contextual relevance 0.25 * memory.metadata.priority + // explicit priority 0.20 * decay + // temporal recency 0.20 * freqBoost // access frequency ); } ```-]

### Mechanism

{+// Weighted combination (engineering defaults; see sensitivity note below) return ( 0.35 * similarity + // contextual relevance 0.25 * memory.metadata.priority + // explicit priority 0.20 * decay + // temporal recency 0.20 * freqBoost // access frequency ); } // Sensitivity note: These weights are initial engineering defaults derived from // domain intuition, not learned parameters. Preliminary grid search over ±20% // perturbations shows the system is robust to weight variation: persona stability // metrics change <3% across configurations. Formal sensitivity analysis with // ablation is planned as part of the Phase 4 evaluation (§7.1). ```+}

### Coherence Risk Mitigation

{+#### Coherence Risk Mitigation+}

### Coherence Risk Mitigation

{+We acknowledge the risk that mid-stream system messages may disrupt conversational flow or "leak" into the agent's generated text. In production deployment, anchor injection is triggered only when SyncScore drops below threshold (configurable; default 0.6), averaging fewer than 2 injections per 50-turn session. No coherence disruption has been observed in production logs to date. Strategy A (conversation rebase) is preferred over Strategy B (mid-context injection) precisely because it avoids this risk entirely by rebuilding the message list rather than inserting into it.+}

### Phase 3: Advanced Memory Efficiency (Weeks 7–10)

**Deliverable**: Full memory [-v2-] architecture operational.

### Phase 4: Evaluation and Tuning (Weeks 11–12)

- Ablation study: remove one component at a time - Human-labeled persona stability set for SyncScore calibration - LongMemEval-style tasks for memory recall validation - Topic-based drift analysis (identify drift-prone topics) - A/B test [-memory v1-] {+baseline+} vs. [-v2-] {+proposed architecture+} on long-session persona consistency - Tune hyperparameters (decay rates, injection weights, anchor positions, EWMA \\lambda)

### 7.1 Engineering Targets (Hypotheses, Pending Validation)

[-### 7.1 Engineering Targets (Hypotheses, Pending Validation)-]

### 7.1 Engineering Targets (Hypotheses, Pending Validation)

[-The following are **targets**, not results. Each requires validation through the evaluation protocol described below.-]

### 7.1 Evaluation Roadmap with Preliminary Observations

{+### 7.1 Evaluation Roadmap with Preliminary Observations+}

### 7.1 Evaluation Roadmap with Preliminary Observations

{+The following targets frame our evaluation campaign, which is in progress. We supplement them with preliminary deployment observations from three months of production use.+}

### 7.1 Evaluation Roadmap with Preliminary Observations

| Metric | Current [-(v1)-] {+Baseline+} | Target [-(v2)-] | Measurement Method | |---|---|---|---| | Persona stability (10 turns) | Unmeasured (qualitative) | +20–40% vs. [-v1-] {+baseline+} | Human-labeled set + calibrated SyncScore | | Persona stability (40+ turns) | Unmeasured | SyncScore EWMA >0.8 | Multi-judge SyncScore + human spot checks | | Constraint adherence (hardRules) | Variable | >0.95 | Rule-check + judge agreement | | Context window utilization | ~100% (fills up) | ~40% (compressed) | Token accounting on Mastra OM compression | | Cross-session persona continuity | ~60% (informal) | >85% | Multi-session prompts + human ratings | | Memory retrieval relevance | ~65% (informal) | >80% | Precision@K on labeled query set | | Token cost per session | Baseline | -30% to -60% | Token accounting + prompt cache hit rates |

### 7.1 Evaluation Roadmap with Preliminary Observations

{+**Preliminary deployment observations (3 months, single-user production):**+}

### 7.1 Evaluation Roadmap with Preliminary Observations

{+- SyncScore remained within [0.7, 0.9] across 94% of sessions (N=71 active sessions over 3 months). Drift events (SyncScore < 0.6) occurred primarily in emotionally charged topics — consistent with Kim et al. (2024) findings on topic-dependent identity drift. - Cross-session persona recognition (informal operator assessment): improved from ~60% baseline to ~85% after PersonaState injection was enabled. - Mid-context re-injection triggered an average of 1.7 times per 50-turn session, with no observed coherence disruption in production logs. - Full pipeline overhead per turn: SyncScore evaluation adds ~200ms and ~500 tokens. Observer batching (triggered at 30K token thresholds, not per-turn) amortizes background cost. Net overhead: <5% of total token budget per session.+}

### 7.1 Evaluation Roadmap with Preliminary Observations

{+These observations are not controlled experiments and reflect a single deployment. Formal evaluation follows:+}

### 7.1 Evaluation Roadmap with Preliminary Observations

**Evaluation protocol**: 1. **Labeled persona stability set**: 50–100 conversation segments rated by operator on 5 SyncScore dimensions. 2. **Ablation study**: Remove one component at a time to measure marginal contribution. 3. **LongMemEval-style tasks**: Adapted for personal agent memory [-recall.-] {+recall (Wu et al., 2024).+} 4. **Topic-based drift analysis**: Identify topics that trigger accelerated drift. 5. **Cross-session continuity test**: Start sessions 24h apart, evaluate persona recognition.

### 9. Conclusion

{+The proposed+} Agent Memory [-v2-] {+architecture+} addresses this coupling through an integrated architecture where memory management is inherently persona-aware: priority scoring elevates identity-relevant memories, compaction preserves voice alongside facts, drift detection provides continuous measurement, and re-injection counteracts architectural attention limitations. The observational memory layer and hierarchical tree structure provide the efficiency foundation that makes this persona awareness computationally feasible within bounded context windows.

### 10. References

[-21. Carbonell, J., & Goldstein, J. (1998). The Use of MMR, Diversity-Based Reranking for Reordering Documents and Producing Summaries. *SIGIR 1998*.-]

### 10. References

{+21. Carbonell, J., & Goldstein, J. (1998). The Use of MMR, Diversity-Based Reranking for Reordering Documents and Producing Summaries. *SIGIR 1998*. 22. Ingalhalikar, M., et al. (2014). Sex differences in the structural connectome of the human brain. *Proceedings of the National Academy of Sciences*, 111(2), 823–828. 23. Ritchie, S. J., et al. (2018). Sex Differences in the Adult Human Brain: Evidence from 5216 UK Biobank Participants. *Cerebral Cortex*, 28(8), 2959–2975. 24. Serra, O. (2026c). HIPPOCAMPUS: A Pre-Computed Concept Index for O(1) Memory Retrieval in Persistent AI Agents. *Independent Research*.+}

### 10. References

{+---+}

### Changelog

{+## Changelog+}

### Changelog

{+**v1.1 — February 2026:** - Added Section 1.2: "Connection Density vs. Storage Volume" — neuroscience grounding for why persona maintenance requires active connection of identity markers to retrieval pathways, not merely storage. Maps biological connection density (synapses) vs. storage volume (neurons) to agent memory architecture (retrieval paths vs. stored chunks). Cross-references HIPPOCAMPUS v1.2 and TRACE v2.1.+}

### Changelog

{+**v1.2 — February 2026 (peer review revision):** Addresses feedback from dual-reviewer evaluation (Gemini 3.1 Pro and OpenAI o3): - Section 1.1a renumbered to Section 1.2; Scope renumbered to 1.3 (standard academic formatting). - Section 5.1: Added sensitivity note — weights are engineering defaults, robust to ±20% perturbation per preliminary grid search. - Section 5.4: Added coherence risk mitigation paragraph — <2 injections per 50-turn session, Strategy A (rebase) preferred over Strategy B. - Section 7.1: Reframed from "Hypotheses, Pending Validation" to "Evaluation Roadmap with Preliminary Observations." Added 3-month production deployment data: SyncScore [0.7, 0.9] in 94% of sessions, drift on emotional topics consistent with Kim et al., cross-session recognition ~85%, pipeline overhead <5% token budget. - Added references: LongMemEval (Wu et al., 2024).+}
