08 section
Memory and State
How an AI system remembers: the tiered memory hierarchy, live context management, cross-session persistence, extracted-fact stores, semantic caching, and agent state that survives a crash
What is in here
Memory architectures sets the L1/L2/L3 frame that the next three pages fill in one tier at a time. Semantic caching sits slightly apart — it is a cost lever rather than a memory tier — and state management is the engineering layer underneath everything else. Pairs directly with Agentic Systems; read that section first if you have not.
01
3 min
Memory Architectures
A three-tier model for machine memory — L1 context, L2 episodic vectors, L3 semantic knowledge — with the latency, cost and consolidation rules between tiers
memoryfundamentalsstate
02
3 min
Short-Term Context
Managing the live context window as a resource: KV cache tiling, prefix caching for system prompts, and sliding windows versus summarizing what falls off
contextcachingmemory
03
3 min
Long-Term Memory
Persistence across sessions, built from vector and graph stores together, with pruning and decay policies plus the tenancy isolation any multi-user memory store needs
memoryvector-dbknowledge-graph
04
2 min
Agentic Memory with Mem0
Mem0 stores extracted facts instead of transcripts: the digest loop, self-updating and conflicting memories, LangGraph integration, and what personalization costs at scale
memorypersonalizationagents
05
3 min
Semantic Caching
Cache on meaning, not string equality — the embedding-threshold pipeline, RedisVL and GPTCache, and the drift risk of serving a near-miss answer as correct
cachingcostlatency
06
3 min
State Management Patterns
The agent state object as single source of truth, driven through LangGraph state machines with checkpoint-and-resume, fork/join parallelism, and time-travel rewrites
stateorchestrationreliability