Skip to content
Stoa Labs

Research · Area 04 of 07

Context, Memory & Knowledge

Agent behavior depends on the state it receives: context can bloat, memories can go stale, and retrieval can return the plausible instead of the true.

Stoa Labs studies agent state as an engineering discipline: context curation and compaction, memory that persists without quietly becoming wrong, and knowledge systems whose provenance and freshness can be trusted.

The field’s loudest open problem is evaluation, because benchmark scores do not predict production behavior and no memory system wins in general, so our work concentrates on methodology: measuring what state an agent should receive and proving what its memory actually does.

01 · Definition

Three layers of agent state

This area is the engineering of agent state: what occupies the context window at every step, what persists across sessions, and how agents retrieve and maintain knowledge. The reframe that defines it: agent failures are state-management failures, not prompt failures.

Three layers make up the area, distinct but overlapping:

  1. Context engineering. The umbrella discipline, broadly treated as the successor to prompt engineering: curating the optimal set of tokens at every step of a multi-turn agent run, deciding what to evict, compress, or offload. Core techniques: just-in-time retrieval over preloading, compaction, structured note-taking, progressive disclosure, and sub-agent context isolation.
  2. Agent memory. Persisting state beyond the window and across sessions. The standard taxonomy borrows from cognitive science: episodic (what happened), semantic (what is known), and procedural (how things are done), with procedural still early-stage. File-based memory is now standardized practice: authored instruction files (CLAUDE.md, AGENTS.md) plus auto memory the agent writes itself.
  3. Knowledge management. RAG reframed from a top-k fetch pipeline into a knowledge runtime: retrieval, verification, reasoning, access control, and audit, driven by an agent that decides when, how, and what to retrieve. Knowledge graphs (including temporal graphs that timestamp when facts were true) are the structured end of this layer.

02 · Why it matters

State quality, not window size

  • Bigger context windows did not repeal the ceiling. The "context rot" research showed accuracy degrades as input grows across every major model, and the 2026 BEAM benchmark showed memory scores collapsing between one million and ten million tokens. The frontier is temporal abstraction and state quality, not window size.
  • Memory moved from library to product. Managed memory offerings from Anthropic and Cloudflare mark the shift.
  • No memory system wins in general. The honest vendor-comparison consensus is that selection is use-case dependent, which makes methodology, not tooling, the scarce asset.

03 · Open questions

What we are trying to find out

Exploration-mode questions: pursued to learn something, allowed to not pan out.

  • Compaction fidelity. Good compaction preserves the facts that constrain future actions (what failed, what was invalidated, open uncertainties) while dropping noise. Current practice is heuristic; can it be made measurable and domain-tuned?
  • Evolving facts and staleness. Most systems add or replace facts rather than evolving beliefs, so high-relevance memories become confidently wrong when circumstances change. What does belief revision look like for agent memory?
  • Procedural memory. How agents accumulate and reuse procedures, not just facts, is the least mature memory type and genuine open exploration territory. This connects directly to the skill-acquisition work in the Agent Extensibility & Tooling area.
  • The evaluation gap. Benchmark scores do not predict performance on domain-specific production workloads. What does a memory evaluation on real traffic look like?

04 · Directions

What this work could become

Candidate development directions, not commitments or year-one programs.

  • Context and compaction engineering as a practiced craft. Measurably better compaction and context curation, tuned per domain, model-agnostic. Directly adjacent to our own dogfooding.
  • Memory evaluation on representative workloads. A lightweight harness and methodology developed on Stoa-owned, public, licensed, or independently synthetic traffic, then applied to a client’s memory system inside the engagement. The loudest open problem in the space, and nobody owns it.
  • Governed, auditable memory for regulated verticals: consent, retention, deletion, and per-write audit built into the architecture rather than bolted on.

05 · Boundaries

What we deliberately avoid

Building another general-purpose memory framework. The field already spans roughly 21 frameworks with no winner; the differentiation is methodological and empirical, not another library.

06 · Landscape · 2026-07

The landscape, July 2026

Anthropic’s September 2025 context-engineering post remains the foundational text, with Chroma’s context-rot research as the load-bearing evidence. The memory vendor field: Mem0 (adoption leader, general-purpose default), Zep/Graphiti (temporal knowledge graph, strongest on temporal reasoning), Letta (memory-as-operating-system, self-hosted control), and LangMem (LangGraph ecosystem).

File-based memory standardized: Anthropic’s memory tool is GA with large token savings when paired with context editing, and AGENTS.md became the de facto open instruction-file standard under Linux Foundation stewardship, read by a dozen major tools.

H1 2026 brought managed memory products (the Anthropic managed-agents memory beta and Cloudflare Agent Memory), large algorithmic gains on temporal and multi-hop reasoning, and the BEAM benchmark reframing the frontier as temporal abstraction at scale.

Landscape notes are dated on purpose. This layer moves monthly, and we treat any claim older than a quarter as due for reverification.

07 · Sources

Selected sources

  • Anthropic, "Effective Context Engineering for AI Agents"; Anthropic memory tool documentation
  • Chroma, context-rot research; BEAM benchmark (2026)
  • Mem0, "State of AI Agent Memory 2026"; five-system memory comparison (May 2026)
  • AGENTS.md field guide (2026); A-MEM (arXiv 2502.12110)

Where this work goes

This research informs our evaluation and agentic development services.