Episodic-Semantic Memory Architecture for Long-Horizon Scientific Agents

Nikola Milosevic · 2026

Read Episodic-Semantic Memory Architecture for Long-Horizon Scientific Agents by Nikola Milosevic (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-17625.txt.

Introduction

Nikola Milosevic evaluates a dual-process memory architecture for long-horizon scientific agents. Repeated analysis and hypothesis work saturate even extended contexts, while single-block methods suffer quadratic cost growth. The design splits a constant episodic window from long-term knowledge growing near three tokens per message. Across six language models, full-context models fail at 10,000 messages, while the system holds 70 to 85 percent accuracy with 62 percent fewer tokens. Dual-process memory excels at numeric and temporal queries, while retrieval excels at historical retrieval. Consolidation quality is the main scaling bottleneck.

Catalog record

CREATORNikola Milosevic
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE64135
LICENSEhttp://creativecommons.org/licenses/by-sa/4.0/
RIGHTSCC BY SA
SOURCEarXiv

Source: https://arxiv.org/abs/2605.17625

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Episodic-Semantic Memory Architecture for Long-Horizon Scientific Agents Nikola Milosevic Abstract As Large Language Models (LLMs) evolve into persistent scientific collaborators, context window saturation has emerged as a critical bottleneck. Scientific workflows involving iterative data analysis and hypothesis refinement rapidly saturate even extended contexts with dense technical content, while monolithic approaches suffer from quadratic cost scaling and cognitive degradation. We evaluate a Dual-Process Memory Architecture that decouples immediate episodic needs (constant 10-message window) from long-term consolidated knowledge (growing at ∼ \sim 3 tokens/message). Unlike prior social agent memory systems [ 23 ] , our domain-specific consolidation addresses contradictory parameter evolution, multi-hop reasoning across experimental phases, and precise technical fact retention. Through large-scale evaluation spanning 15,000 messages with cross-model validation across six LLMs from three families (OpenAI, Anthropic, Google), totaling 1,440 queries, we establish three key findings. First, while full-context models fail at 10,000 messages due to context overflow, our system maintains 70–85% accuracy with 1–2 second latency using 62% fewer tokens (45,434 vs 120,000+ limit). Second, cross-model validation reveals architecture-level trade-offs independent of specific LLMs: Dual Process excels at numeric/temporal queries (65–90% accuracy) while RAG excels at historical retrieval (60–85%), suggesting complementary deployment strategies. Third, we identify a “Sim-to-Real” gap where synthetic tests maintain constant memory but realistic workflows exhibit linear growth ( ∼ \sim 3 tokens/message), with consolidation quality emerging as the primary scalability bottleneck. The architecture successfully manages profiles with 14,000+ scientific facts ( 125k tokens), demonstrating that domain-specific memory consolidation enables sustained operation beyond full-context limits. 1 Introduction The deployment of Artificial Intelligence in high-stakes, knowledge-intensive domains such as drug discovery and genomic research necessitates agents that can maintain coherence over extended periods while handling domain-specific memory challenges absent in general conversational AI. A pharmaceutical researcher might engage with an AI assistant over weeks or months, evolving from initial target identification to hit-to-lead optimization. Such longitudinal interaction requires the agent to “remember” not just the current command, but the cumulative context of the user’s scientific hypothesis, preferred methodologies, and negative results from previous weeks. Critically, scientific workflows impose unique memory requirements: (1) evolving hypotheses where initial assumptions (e.g., “FAP+ CAFs drive chemoresistance”) pivot to contradictory conclusions (“PDGFR- \beta + pericytes are the primary mechanism”), (2) parameter evolution through contradictory updates (significance thresholds changing from p<0.05 to p<0.001 across experimental phases), (3) multi-hop technical reasoning requiring synthesis of protocol details, statistical parameters, and biological context across dozens of interactions, and (4) precise fact retention where approximation (“ \sim 180 samples”) versus exactness (“178 samples”) can invalidate downstream analyses. These requirements fundamentally distinguish scientific memory consolidation from the social believability objectives of prior agent architectures. However, the current generation of Transformer-based models [ 31 ] faces fundamental limitations despite extended context windows. While models with context windows exceeding one million tokens have been developed, relying exclusively on expanded context capacity presents two critical challenges. First, economic scalability becomes problematic as the cost of processing a conversation grows linearly (or quadratically in attention mechanics, see [ 10 ] ) with history. For a researcher conducting thousands of interactions, re-processing the entire history for every query is economically prohibitive. Second, cognitive degradation emerges as retrieval accuracy degrades when relevant information becomes obscured by conversational noise. Empirical studies on the “Lost in the Middle” phenomenon [ 19 ] show that accuracy degrades as the ratio of relevant-to-irrelevant tokens decreases. A 10,000-message history full of episodic details acts as noise, obscuring critical facts needed for the current task. 2 Related Work 2.1 Generative Agents and Episodic Memory Park et al. [ 23 ] pioneered the application of LLM-based memory architectures through their Generative Agents framework. Their system employs a three-tier memory hierarchy: observation (raw sensory input), reflection (high-level abstraction), and retrieval (importance-weighted semantic search). This architecture enabled 25 agents to simulate believable social behavior in a virtual town over 48 hours, producing emergent phenomena such as party planning and relationship formation. Complementing this work, Packer et al. [ 22 ] introduced MemGPT, which treats LLMs as operating systems with hierarchical memory management analogous to virtual memory in traditional OS architectures. MemGPT implements a two-tier system: main context (limited working memory, analogous to RAM) and external storage (unlimited archival memory, analogous to disk). The system uses explicit send_message , pause_heartbeat , and core_memory_append functions that the LLM invokes to manage memory paging between tiers. When main context approaches capacity, MemGPT compresses older sections into external storage and retrieves them on-demand using semantic search. This OS-inspired design demonstrated improved performance on document analysis (89% vs 63% for GPT-4 baseline) and multi-session conversations, with the LLM learning to explicitly manage its own memory constraints. Architectural Comparison with MemGPT. While both MemGPT and our Dual-Process architecture address long-horizon memory through hierarchical decomposition, they differ fundamentally in control flow and consolidation philosophy. MemGPT employs explicit LLM-driven memory management : the model must learn to invoke paging functions ( core_memory_replace , archival_memory_search ) to manage its own context, essentially requiring meta-cognitive reasoning about memory operations. This introduces training overhead (the LLM must learn memory management protocols) and potential failure modes (the model may fail to page critical information before context overflow). In contrast, our architecture employs implicit automatic consolidation : every user-agent exchange triggers asynchronous background consolidation via a separate LLM, decoupling memory management from the primary inference path. The user-facing LLM never reasons about memory operations—it simply receives both episodic buffer and consolidated profile as input. This architectural choice trades MemGPT’s flexibility (LLM-controlled paging enables adaptive strategies) for robustness (consolidation failures don’t corrupt the inference path, and the episodic buffer provides graceful degradation). Second, consolidation granularity differs: MemGPT pages arbitrary context segments (potentially mid-conversation) when approaching limits, while our system consolidates incrementally after every message, maintaining temporal coherence. Third, episodic preservation differs: MemGPT’s main context is a sliding window over raw history (similar to Full Context with truncation), while our episodic buffer maintains exactly W=10 recent messages with deterministic replacement, providing constant-time recent state access. Finally, evaluation domains differ: MemGPT validates on document QA and multi-session chat, while we focus on scientific workflows requiring contradictory parameter updates and multi-hop technical reasoning. Empirical comparison on our 15,000-message biomedical benchmark remains important future work to establish whether explicit LLM-driven paging or implicit automatic consolidation better handles domain-specific scientific memory challenges. Wang et al. [ 32 ] further extended agentic memory in their Voyager system, which uses an event-based memory for open-ended learning in Minecraft, accumulating skills through iterative exploration. While Park et al. demonstrate that LLMs can maintain coherent multi-agent social simulations, their work was designed for fundamentally different requirements than scientific research workflows. Four key distinctions separate our contributions: (1) Temporal Dynamics: Park et al.’s agents operate in a simulated sandbox where all information is agent-generated and temporally ordered by the simulation clock. In scientific research, information arrives asynchronously from heterogeneous sources (literature, databases, experiments), creating contradictory updates that require explicit conflict resolution. Our Dual-Process architecture addresses this through episodic windowing and incremental consolidation, which actively reconciles contradictions rather than assuming coherent temporal ordering. (2) Information Density and Precision: Social simulations prioritize behavioral plausibility over factual precision. Park et al.’s agents retrieve memories based on recency, importance, and relevance—a heuristic appropriate for conversational context (”What did I discuss with John?”)

Read the complete text