Models

What Is a Memory Management Hierarchy?

Layered storage structures used in AI systems to balance recall, latency, and cost across working, session, episodic, and semantic memory tiers.

What Is a Memory Management Hierarchy?

Memory management hierarchies are the tiered storage structures an AI system uses to trade recall against latency and cost across several memory layers. Typical tiers are working memory (the current context window), session memory (short-term buffer for one conversation), episodic memory (chronological log of prior events and tool calls), and semantic memory (long-term knowledge in a vector or graph store). Each tier has its own write policy, retention window, and retrieval cost. The hierarchy decides which tier answers a query first, when to promote or demote facts between tiers, and how to summarise upward without losing critical detail.

Why It Matters in Production LLM and Agent Systems

A flat memory design forces a brutal choice. Keep everything in the context window and you blow the token budget within minutes. Keep everything in a single cold vector store and every turn pays a 200 ms retrieval tax. Production agents need a tiered design where the most-frequently-touched facts live in fast working memory, mid-frequency facts in a session buffer, and the long tail in semantic memory.

Without a hierarchy, three failure modes appear consistently. First, latency p99 inflates because every turn round-trips to the cold store. Second, cost-per-conversation drifts upward because the model is re-attending to redundant chunks pulled from a flat retriever. Third, the agent loses critical mid-session context — the user’s stated goal at turn three — because the summariser collapsed it into a vague semantic blurb that no longer retrieves on the right query.

For 2026-era multi-agent stacks the hierarchy is the coordination contract. One agent’s working memory is another’s episodic input. Crews share semantic memory but maintain private session memory. Workflow memory — captured patterns of past successful trajectories — sits as a fifth tier above semantic. Without explicit promotion and demotion rules between these tiers, parallel agents corrupt each other’s state and emit inconsistent plans.

How FutureAGI Handles Memory Management Hierarchies

FutureAGI does not own a memory store, but it evaluates whether the hierarchy is preserving the right facts at each tier transition. The pattern teams use is to instrument each memory tier with a traceAI integration so writes and reads emit span attributes such as agent.memory.tier, agent.memory.write.bytes, and agent.memory.read.hit. A Dataset.add_evaluation then runs ContextUtilization per tier — the working tier should be near 1.0 (everything pulled in is used), the semantic tier may be 0.4–0.6 (broader retrieval, lower utilisation expected). Drift on any tier flags that promotion or summarisation is misbehaving.

A concrete workflow: a long-running customer-support agent uses a 4-tier hierarchy (working → session → episodic → semantic). FutureAGI’s approach is to define an evaluation cohort per tier transition. ContextEntityRecall checks that every order ID stored in episodic survives the summarisation into semantic. CustomerAgentContextRetention scores whether the agent’s response retains facts from session-tier memory across a 20-turn conversation. The Agent Command Center’s semantic-cache primitive sits at the top of the hierarchy as a fast-path; its hit-rate is exposed as a dashboard signal so the platform engineer can see when the cache is paying for itself versus when it has gone stale and is poisoning answers. Regression-eval gates fire whenever any tier-transition score drops below threshold between releases.

How to Measure or Detect It

A healthy memory hierarchy is measurable per tier and per transition:

  • Tier-level ContextUtilization — fraction of retrieved chunks that are referenced in the response, scored separately for working, session, episodic, and semantic tiers.
  • Promotion-recall — fraction of facts written to a higher tier that survive summarisation; ContextEntityRecall is the canonical metric.
  • Latency-by-tier — p50/p99 retrieval latency reported as OpenTelemetry span attributes; alarm on the tier above SLA.
  • Cache hit-rate — semantic-cache hit-rate dashboard signal; sudden drops indicate stale or poisoned cache entries.
  • Cost-per-tier — token spend attributed to each tier; surfaces when a tier is paying for itself.

Minimal Python:

from fi.evals import ContextUtilization, ContextEntityRecall

util = ContextUtilization()
recall = ContextEntityRecall(expected_entities=["order_id", "user_email"])

for tier in ["working", "session", "episodic", "semantic"]:
    score = util.evaluate(
        input=query, output=response, context=memory_by_tier[tier]
    ).score
    print(tier, score)

Common Mistakes

  • Single-tier memory pretending to be a hierarchy. A flat vector store with a TTL is not a hierarchy — promotion and demotion logic are what define one.
  • Lossy summarisation between tiers. Summarising session→semantic without ContextEntityRecall evals silently drops IDs and dates the agent will need later.
  • No eviction policy. Episodic memory grows unbounded and slows every retrieval; set a write-time TTL and a read-time relevance floor.
  • Caching without invalidation. A stale semantic-cache entry is worse than no cache; tie invalidation to a versioned knowledge-base update.
  • Ignoring tier-level cost. A 0.1% improvement in answer quality from semantic memory can cost 10× the working-tier latency budget — measure both.

Frequently Asked Questions

What are memory management hierarchies?

They are the tiered storage layers — working, session, episodic, and semantic — that an AI system uses to balance recall against cost. Each layer has its own retention window and retrieval policy.

How are memory hierarchies different from a single vector store?

A single vector store gives one retrieval surface with one cost-recall tradeoff. A hierarchy uses multiple stores, each tuned to a tier — e.g. fast in-process buffer for the current turn, vector DB for episodic, knowledge graph for semantic.

How does FutureAGI evaluate a memory hierarchy?

FutureAGI runs `ContextUtilization`, `ContextEntityRecall`, and conversation-context-retention evaluators across each tier, so you can see whether promotions and summarisation between tiers are preserving the right facts.