做科学计算或长期实验分析的AI开发者,终于有了对抗上下文饱和的实用方案——双过程架构直接省62% tokens还保持高精度,值得在长链推理任务中试试。
本文提出一种双过程记忆架构,将即时情景记忆(固定10条消息窗口)与长期知识(约3 tokens/消息增长)解耦,解决LLM在科学协作中的上下文窗口饱和问题。在15,000条消息、跨6个模型(OpenAI、Anthropic、Google)的1,440次查询评估中,该架构在10,000条消息时仍保持70-85%准确率,延迟1-2秒,且比全上下文模型节省62% tokens。研究发现双过程架构在数值/时间查询上表现优异(65-90%准确率),而RAG在历史检索上更优(60-85%),并揭示了合成测试与现实工作流之间的“模拟到现实”差距。该架构成功管理了14,000+科学事实(125k tokens),证明领域特定记忆整合可支持超长上下文持续运行。
Episodic-Semantic Memory Architecture for Long-Horizon Scientific Agents
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 approximately 3 tokens/message). Unlike prior social agent memory systems, 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 (about 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.