HyperAIHyperAI

Command Palette

Search for a command to run...

에이전트

에이전틱 컨텍스트 관리: 에이전트 메모리와 비용을 수명 주기 및 아키텍처 문제로 해결하기

Gaurav Dadhich

초록

실무 환경의 AI 에이전트 실패는 추론 능력 부족보다 추론 컨텍스트 내 정보를 관리하지 못하기 때문에 발생하는 경우가 더 많다. 대화 이력, 방대한 프롬프트, 대규모 도구 정의 및 급증하는 도구 출력물 등 컨텍스트에 담아야 할 수많은 요소들 속에서 에이전트는 스스로 축적한 이력에 파묻히고, 매 턴마다 증가하는 토큰 비용을 지불하며 결국 동일 대화 내에서뿐 아니라 여러 대화에 걸쳐 필요한 정보를 상기하지 못하게 된다. 기존의 대응 방식은 이를 저장 및 검색 문제로 다룬다. 우리는 이러한 프레임이 지나치게 협소하다고 주장한다. 에이전트가 마음속에 무엇을 담고 있을지 능동적으로 관리하는 것은 단순한 저장이 아니라 수명 주기라고 제안한다. 이는 무엇을 기억할지 결정하고, 이를 추출 및 구조화하며, 데이터 유형에 맞는 적절한 저장소를 선택하고, 최적의 중복성을 구축하며, 의식적으로 통합하고, 출처를 유지하면서 오래된 정보를 잊고, 현재 턴에 무엇이 관련 있는지 판단하며, 다음에 무엇이 필요할지 예측하고, 예산에 맞추면서도 중요한 것을 잃지 않고 재현율을 훼손하지 않으면서 컨텍스트를 압축하는 일련의 과정을 포괄한다. 진지한 실무 에이전트에서 이는 단일 사용자뿐 아니라 조직적 범위 계층 구조 전반에 걸쳐 작동한다. 우리는 이 분야를 에이전틱 컨텍스트 관리(ACM)라고 명명하고(과거 일부에서도 그렇게 불렀듯이), 이를 설계, 수집, 범위 설정, 예측, 압축 및 통합이라는 다섯 가지 기본 요소로 분해한다. 그런 다음 관리형 수명 주기가 사치가 아닌 이유에 대한 경제적 근거를 제시한다. 순진한 컨텍스트 축적은 대화 길이에 따라 토큰 비용을 2차 함수적으로 증가시키고, 단순한 요약은 정확도 급락을 대가로 선형 비용을 얻는 반면, 검증된 압축만이 충실도를 유지하면서 선형 비용을 달성한다. 우리는 이 다섯 가지 기본 요소를 다중 테넌트 서비스로 구현한 참조 구현체 Maximem Synap을 설명하며, 6장에 자세히 기술된 설정 하에 LongMemEval에서 92%, LoCoMo에서 93.2%의 성능을 보고한다. 마지막으로 기존 벤치마크가 아직 포착하지 못하는 차원, 즉 지연 시간, 토큰 효율성, 컨텍스트 부패 저항성과 이 범주가 지향하는 의사 결정 수준 및 조직 수준 컨텍스트라는 열린 개척지를 언급하며, 이들이 진지한 환경에서 에이전트 효용의 안정성과 사용성을 계속해서 결정할 것이라고 마무리한다.

One-sentence Summary

Gaurav Dadhich introduces Agentic Context Management (ACM), reframing agent memory as a lifecycle problem with five primitives—architecting, ingesting, scoping, anticipating, and compacting & consolidation—that economically reduce token cost from quadratic to linear while preserving fidelity, and a reference implementation, Maximem Synap, achieves 92% on LongMemEval and 93.2% on LoCoMo.

Key Contributions

  • The paper introduces Agentic Context Management (ACM) as a lifecycle decomposed into five primitives (architecting, ingesting, scoping, anticipating, and compacting and consolidation), shifting the framing from static storage to active, multi-turn context orchestration.
  • An economic analysis shows that naive context accumulation leads to quadratic token cost growth, crude summarization yields linear cost but suffers an accuracy cliff, and only validated compaction achieves linear cost with preserved fidelity, establishing the lifecycle as a practical necessity.
  • A reference multi-tenant service, Maximem Synap, implements the five ACM primitives and reports 92% on LongMemEval and 93.2% on LoCoMo, while also identifying benchmarking gaps in latency, token efficiency, and context-rot resistance.

Introduction

The authors observe that production AI agents often stumble not from reasoning failures but from undisciplined context management: agents forget earlier instructions, hallucinate from overloaded windows, and incur ballooning costs when entire histories are blindly appended. The dominant framing treats this as a “memory” problem that merely stores and retrieves facts, but it ignores essential lifecycle decisions—what to retain, how to structure it, which fraction belongs in the current turn, what to anticipate next, and how to safely compact context under a budget. The authors reframe the challenge as Agentic Context Management, a system organized around five primitives—architecting, ingesting, scoping, anticipating, and compacting/consolidation—that operate coherently across user, customer, and organizational scopes. They demonstrate that naive full-append context leads to O(n2)O(n^2)O(n2) token costs, while managed compaction reaches the efficient frontier of linear cost with verified fidelity, and they supply a reference implementation (Maximem Synap) that materializes the complete lifecycle.

Method

The authors introduce Maximem Synap, a multi-tenant hosted context-management platform that realizes the five primitives of agentic context management as a coherent lifecycle rather than as disconnected tools. The system is designed to address the failures of naive store-and-retrieve approaches: cost explosion from unbounded contexts, accuracy collapse from unchecked compaction, and reasoning insufficiency from retrieval that scores hits but misses the bridge context needed for agents to produce correct answers.

At the heart of Maximem Synap lies an autonomous architecting step. When an agent is connected, the system synthesizes a bespoke memory architecture from the customer’s description of the agent’s purpose and reference material. This design, generated via multi-agent LLM reasoning and validation, determines which memory categories to capture (facts, preferences, episodes, emotions, temporal events, etc.), how they should be extracted, stored, retrieved, and compacted, and what entities and relationships matter. This architecture governs every downstream primitive, making the coupling among primitives concrete: a support agent and a coding agent receive different category schemas, retention policies, and compaction rules, all embodied in a single generated artifact.

Ingestion is an asynchronous, queue-backed pipeline. A document or conversation turn is submitted through an async-first SDK that returns an ingestion identifier immediately without blocking the calling application. In the background, the pipeline qualifies content, extracts memory categories as dictated by the agent’s architecture, and resolves entities. Entity resolution runs a confidence-ordered cascade of matching strategies—from exact identifiers through lexical, semantic, and contextual signals—linking surface mentions to canonical identities at the customer scope. Public entities are validated against a global knowledge layer; new ones are registered. The extraction and resolution results are persisted across a polyglot stack: a relational store as source of truth, a vector store for embedding-based search, a graph store for entity–relationship traversal, an object store for original content, and specialized stores for time-series telemetry and queuing/caching. The immediate consistency trade-off is deliberate: read-after-write within a session is satisfied by carrying recent turns verbatim in memory, so the agent operates on the latest information while durable, structured availability is deferred without blocking.

Retrieval is a scope-aware, budget-conscious pipeline that resolves the organizational hierarchy narrowest-first: user, then customer, then client, under strict isolation enforced at both storage and query layers. It assembles provenance-tagged, ranked memory items fitted to a token budget. Two retrieval modes are offered: a low-latency path and a higher-accuracy path that adds query decomposition and LLM reranking. Crucially, the system combines vector similarity with vector-guided multi-hop traversal of the knowledge graph. Semantic similarity informs where to enter the graph and which relationships to follow, surfacing related memories that pure vector search would miss—directly addressing the bridge-document problem that causes reasoning insufficiency.

Anticipating is treated as a retrieval primitive distinct from explicit query-time retrieval. Maximem Synap implements an anticipatory path that predicts from an agent’s evolving behavior the context it will likely need before an explicit request arrives. This prepared context is available as a cache read when needed, moving retrieval off the agent’s critical path and reducing latency. The prediction mechanism is proprietary; the authors report a sustained hit-rate above 60% in production, with the value being latency reduction rather than deduplication.

Compacting and consolidation are designed as verified operations. For long conversations, Maximem Synap compresses the context and then validates the result against the original: it tests whether key information remains recoverable and emits an explicit validation score together with a compression ratio. If the score falls below a threshold, compaction is automatically retried with less aggressive compression. This category-aware compaction—what must be preserved verbatim versus what may be abstracted is determined by the agent’s generated architecture—prevents the catastrophic accuracy loss that unvalidated summarization causes. To keep validation overhead linear, compaction operates periodically on the already-compacted context plus recent turns, not on the full transcript. The total token cost over NNN turns follows NW(1+c/p)N \cdot W \cdot (1 + c/p)NW(1+c/p), where WWW is the token budget, ppp the compaction frequency, and ccc a fixed factor; this is a linear cost raised by a constant factor, providing dramatic savings compared to the quadratic blow-up of appending full history.

The platform exposes a simple three-call integration pattern per model invocation: scoped retrieval of past context, validated compaction of the current conversation, and non-blocking ingestion of the new turn. The application code never touches schema design, embedding models, index management, or isolation logic; those are handled entirely by the lifecycle’s primitives and the generated architecture. The design choices—synthesized architecture, verified compaction, asynchronous ingestion, first-class scoping with enforced isolation, hybrid semantic-relational retrieval, and anticipatory latency design—directly address the production failure modes observed in store-and-retrieve systems and implement the lifecycle that the paper argues is necessary for agentic memory at scale.

Experiment

The evaluation uses LongMemEval and LoCoMo to validate conversational memory, where multi-session reasoning is hardest, reflecting a broader reasoning-sufficiency gap: standard retrieval benchmarks measure hits but not whether all necessary context appears, with vector and keyword search winning in complementary regimes. Despite this gap, the system achieves strong results driven by its context layer rather than a large answer model, underscoring the need for hybrid retrieval and new evaluations that directly score sufficiency and production dimensions.

Production memory systems fail in distinct modes that correspond to missing context-management primitives. Ingesting and architecting gaps cause junk accumulation, lost detail, and identity fragmentation; scoping deficits lead to scope bleeding and cross-session amnesia; unvalidated compaction creates an accuracy cliff that can drop performance below a no-context baseline. Junk accumulation, lost detail, and identity fragmentation all stem from missing ingestion and architecting primitives, including a real-world 99.6% junk rate when storing raw signals without extraction. Scope bleeding and cross-session amnesia arise without scoping, while unvalidated compaction produces an accuracy cliff where performance drops below a no-context baseline after aggressive compression.

Three context-management strategies are compared: full-append, crude summarization, and validated compaction. Full-append incurs quadratic token cost and suffers from context degradation like the lost-in-the-middle effect, while crude summarization has linear cost but risks an accuracy cliff from discarding relevant detail. Validated compaction achieves linear cost with preserved and checked fidelity, as demonstrated by Maximem Synap's 92.0% LongMemEval score, avoiding both failure modes. Full-append has O(n²) token cost and eventually fails through context rot, such as the lost-in-the-middle phenomenon. Crude summarization cuts cost to O(n) but is lossy and unvalidated, creating an accuracy cliff when the summarizer discards what matters downstream. Validated compaction maintains O(n) token cost while preserving and checking needed information, making it the target with no inherent failure mode. An implementation of validated compaction reached 92.0% on LongMemEval, confirming that preserved and checked fidelity prevents the accuracy cliff seen with crude summarization.

Maximem Synap achieved 92.0% overall accuracy on the LongMemEval conversational memory benchmark and 93.2% on LoCoMo categories 1–4, both evaluated with a transparent configuration and a small answer model (gpt-5-mini). Multi-session reasoning proved the most challenging LongMemEval category (75.2%), consistent with a broader pattern across systems. The consistent use of a smaller answer model suggests that performance gains arise from the memory and context retrieval layer. The system reached 92.0% on LongMemEval (all 500 questions) and 93.2% on LoCoMo categories 1–4, both using gpt-5-mini as the answer and judge model. Multi-session reasoning, which requires joining information from separate conversations, was the weakest category at 75.2%, underscoring a well-known difficulty across published systems. LoCoMo's adversarial unanswerable category (category 5) was excluded following the official convention, preventing an artificial score swing and maintaining comparability with prior work. The evaluation harness (maximem-ai/memory_and_context_eval_harness) and methodology are publicly documented, and per-run artifacts are available on request to support reproducibility. Using a smaller answer model than many competitor configurations indicates that the performance advantage originates from the context pipeline rather than from the scale of the answering model.

Self-reported LongMemEval scores show Maximem Synap at 92.0% with a smaller answer model than competing configurations, while other systems exhibit sensitivity to answer model swaps. Because each row uses a different methodology, judge, and setup, the numbers are not directly comparable; multi-session reasoning remains the hardest category for all documented systems. Maximem Synap achieves 92.0% on LongMemEval using gpt-5-mini, a smaller answer model than those in the strongest competitor configurations, indicating that the gain comes from the context layer rather than the answer model. SuperMemory's LongMemEval results span 81.6% to 85.2% across answer models alone, demonstrating how sensitive memory benchmarks are to evaluation choices. Multi-session reasoning is the weakest category for Maximem Synap at 75.2% and is described as the hardest published category for every known system. The the table a landscape of each vendor's own best self-reported figure under differing methodologies and cannot be treated as a head-to-head comparison.

Across the surveyed memory systems, no system publicly declares full primary coverage of all five primitives. Ingesting and Scoping appear most often as either primary or partial capabilities, while Compacting & Consolidation is a primary focus for only one system. Architecting is a primary concern for some systems and absent from others, revealing divergent design priorities. MemGPT/Letta is the only system that lists Compacting & Consolidation as a primary focus. Ingesting is supported at least partially by every system except ACE/Dynamic Cheatsheet, making it the most widespread primitive. Architecting is a primary focus for MIRIX, Mem0, and SuperMemory, but it is not a stated focus for MemGPT/Letta, Zep/Graphiti, or Cognee. Scoping is partially or fully covered by six of the seven systems, with Zep/Graphiti and MemGPT/Letta giving it primary emphasis. Anticipating is never listed as a primary focus; it appears only as a partial or optional capability in four systems.

These experiments evaluate failure modes and strategies in production memory systems, showing that missing ingestion and architecting primitives lead to junk accumulation and identity fragmentation, while scoping deficits cause scope bleeding and amnesia. A comparison of full-append, crude summarization, and validated compaction finds that only validated compaction maintains linear cost and accuracy, as demonstrated by Maximem Synap's 92.0% on LongMemEval with a small answer model. Multi-session reasoning remains the hardest category across systems, and a survey of seven systems reveals no one covers all five primitives, with compacting and anticipating being the least addressed.


AI로 AI 구축

아이디어에서 출시까지 — 무료 AI 코코딩, 즉시 사용 가능한 환경, 최적의 GPU 가격으로 AI 개발을 가속화하세요.

AI 협업 코딩
바로 사용 가능한 GPU
최적의 가격

HyperAI Newsletters

최신 정보 구독하기
한국 시간 매주 월요일 오전 9시 에 이번 주의 최신 업데이트를 메일로 발송합니다
이메일 서비스 제공: MailChimp