The LibraryField notes on AI agent memory
Evidence-first deep-dives on evaluation, context engineering, and the science of how AI agents remember.
Evidence-first deep-dives on evaluation, context engineering, and the science of how AI agents remember.
Six persistent memory APIs for AI agents compared on the six questions that actually decide fit: memory model, cross-client sharing, outcome feedback, multi-agent sharing, cost, and each vendor's own admitted gap.
ReadSix persistent memory APIs for AI agents compared on the six questions that actually decide fit: memory model, cross-client sharing, outcome feedback, multi-agent sharing, cost, and each vendor's own admitted gap.
Hindsight and Graphiti answer the same question at different moments: Graphiti at write time with a bi-temporal graph, Hindsight at read time with standing answers. How to choose, and what neither settles.
A ranked list cannot express supersession, retraction, or authority. Why retrieval flattens conflicts the store holds, and what a response with relations needs.
At query time a memory layer runs the same hybrid retrieval a RAG stack does, and the shipping source proves it. The difference is on the write path, and it is narrower than the category claims.
Knowledge graph vs retrieval for AI agent memory: the split that matters is learned vs asserted structure, connected by provenance. Evidence-first guide.
Agent memory splits into evidence and policy, not short versus long term: three scopes, the fields each entry needs, and why closing a fact beats replacing it.
Agent memory learns most from explicit feedback, but production agents rarely send it. Measurements show what changes and how to prescribe feedback.
Agent OS means six things: a metaphor, academic kernels, a memory pager, a platform, an OS feature, and an inversion. One test tells them apart.
Agent memory interoperability needs rules for identity, schema, provenance, consistency, and permissions. A2A and MCP do not define them.
AI introspection is real but unreliable. Chain-of-thought and self-reports cannot replace durable audit records outside the model.
Anthropic's global workspace research reveals Claude's transient working memory, and why AI agent memory must persist outside the model.
Knowledge-graph memory reframes agent memory from transcript to navigable substrate — GraphRAG, temporal graphs, PPR, and why it shouldn't rewrite itself.
AI agent memory explained: what it is, how it works, the approach families, how it is evaluated, and how to choose a real memory layer.
What an A2A Agent Card is: JSON at a well-known URL describing an agent's skills, endpoint, and auth — fetched to discover and call it.
A2A tutorial for Python: install the SDK, publish an Agent Card, run a server, delegate a task, stream artifacts, and add domain-scoped memory.
A2A protocol explained: Agent2Agent primitives, transports, how it complements MCP, and why shared agent memory stays a separate layer.
A2A vs MCP compared: MCP connects agents to tools; A2A connects agents to agents. They compose as complementary layers, not rivals — and leave memory open.
Hebbian memory for AI agents: how learned associations, automatic query expansion, and outcome feedback differ from static vector database similarity retrieval.
Is Mnemoverse a vector database? No. A vector DB does static similarity retrieval; Mnemoverse adds learning, recency, and consolidation on top.
Rescorla-Wagner for agent memory: how prediction-error outcome feedback updates valence and improves recall in Mnemoverse.
Shared memory for AI agents needs explicit domains, isolation, and hierarchical reads. Protocols coordinate work; memory preserves context.
Shared memory poisoning can expose many agents to one bad write. Use a three-trust matrix and consumer-side hygiene to limit the risk.
Agent-to-agent trust is a 4-layer stack borrowed from web auth (signed cards, OAuth/mTLS, token exchange) — and the injection gap none of it closes.
Least privilege bounds what a tricked AI agent can do — not whether it's tricked: authz policy, JIT tokens, and the confused-deputy ceiling it can't cross.
Prompt injection is a 3-stage credential kill chain: injection lands, the agent reads a secret, it leaves via an allowed channel. Three defenses matter.
Six rungs of protecting an AI agent's secret, weakest to strongest—each defeats a different threat, but none stops a tricked agent misusing what it unlocks.
Credential the LLM never sees: resolve secrets below the model, inject them on the wire, and account for MCP, logs, and confused deputies.
A poisoned AI agent memory can wait weeks, then leak an API key. Persistence and key-theft are each demonstrated; chaining them isn't—yet. Here's the fix.
AI agents warn about API keys because the risk is real. But warning after a secret enters context is not protection.
AI coding agents repeat corrected mistakes because nothing records whether past suggestions worked. Outcome memory attaches results to recalled facts.
Vector stores return deprecated APIs and dead conventions forever. Closing, decay, and suppression keep agent memory current without destroying history.
Transformer attention is equivalent to one update step of a modern Hopfield network under specific query, key, value substitutions.
Types of memory in computing, mapped from DRAM and virtual memory to KV caches, model weights, context windows, and persistent agent memory.
Transactive memory divides the labor of remembering across a group — a directory of who knows what — mapped, with its limits, to multi-agent AI memory.
Agent memory consolidation turns raw writes into reusable structure between uses — what works, what ships, and what remains unproven.
Multimodal memory integration binds text, image, and audio into one representation. A sourced guide to binding: TPR, VSA/HDC, SDM, and Hopfield networks.
Self-organizing memory systems explained: Adaptive Resonance Theory, Self-Organizing Maps, and Growing Neural Gas, including GNG-U utility-based pruning.
Tulving's episodic vs semantic split is a design decision for AI agents: an event log beside a fact store, plus a step deciding when episodes become facts.
Memory has dozens of named kinds because no one has drawn its boundary. A guided tour of the list, the reasons it grew, and why the seams never close.
Schema theory explains how memory turns episodes into reusable structure. For AI agent memory, it clarifies why episodes and consolidation should stay separate.
Working memory is the bounded active workspace of cognition; its capacity debate (Miller's 7 vs Cowan's 4) and models map onto AI context-window design.
Bernard Widrow's 1960 LMS delta rule taught machines to learn and still runs in adaptive filtering; late in life he turned to content-addressable memory.
Geoffrey Hinton's 1985 Boltzmann machine made memory generative: a stochastic, energy-based network with hidden units that learns a distribution and samples it.
Jeff Hawkins argues the brain is a memory system for prediction; Hierarchical Temporal Memory uses sparse representations, sequences, and continual learning.
Hopfield's 1982 PNAS associative memory, the 0.138N capacity limit (Amit, Gutfreund, Sompolinsky, 1985), and how attention became one read from it.
BLEU, ROUGE, F1, accuracy, and SARI explained by metric question, Evaluate I/O shape, failure mode, and routing.
LLM-as-judge reliability explained: assess position bias, verbosity, self-preference, rubrics, retrieval recall, and benchmark comparability.
A map of how AI-agent memory is actually measured — LoCoMo, LongMemEval, BEAM, long-context tests — what each checks, what it misses, and which to trust.
Swap only the grading prompt on the same answers and an AI-memory benchmark score moves ~40 points — you can't trust a leaderboard without the recipe.
DeepEval turns LLM evals into pytest tests that fail CI builds. 50+ metrics, but most are LLM-as-a-judge (G-Eval: 0.514 vs humans) — DAG adds determinism.
Practical Hugging Face evaluate docs: evaluate.load() + compute(predictions, references), the BLEU list-of-lists trap, and no information_retrieval metric.
How to evaluate AI agent memory: the framework, the dimensions, a benchmark map (LoCoMo, LongMemEval, BEAM), and why latency and cost are co-equal axes.
LLM-as-a-judge leniency and bias explained: how a "be generous" grader, MT-Bench failures, and the LoCoMo judge shape the memory-benchmark numbers vendors cite
LangChain/LangSmith evaluation explained: datasets, LLM-as-judge biases, the eval tool landscape, and the blind spot none cover — whether your agent remembers.
The format has no required fields and one sentence about precedence. Seven tools that list themselves as supporting it describe seven different mechanisms, and one of them says outright that a closer file overrides an earlier one because it comes later in the combined prompt.
A rules file is text placed in a context window. All three vendors say so on their own pages, in their own words. What delivers a rule, what the wrapper around it says, and what does enforce, because something does.
MCP standardises how a client discovers a tool, calls it, and reads the answer. It does not standardise memory. Walking the whole path with the specification and the public reference server open.
How prompt cache keys are derived across Anthropic, OpenAI, Gemini, vLLM, and SGLang, and the six agent mistakes that silently break the stable prefix.
Thirteen memory MCP servers across knowledge-graph, vector, Markdown and SQL storage, with pricing, maintenance reality, and the local-first vs hosted decision.
The final MCP 2026-07-28 specification removes protocol sessions, the Mcp-Session-Id header, and the handshake. Durable agent memory remains external.
Context budgeting allocates finite agent tokens across system, tools, retrieval, history, outputs, and response buffer.
Context optimization for AI agents unifies KV-cache hit rate, prefix stability, token budget, latency, cost, and placement into one runtime decision.
Where flow control ends and window assembly begins: the boundary between orchestrator and context compiler in LLM agent systems.
Deterministic context assembly improves cacheability and auditability; LLM-directed assembly adds adaptivity. Most agent systems need both.
Context engineering is the discipline. The context compiler is the per-turn runtime layer that ranks, budgets, secures, and assembles each model call.
Memory MCP servers explained: what they are, how to choose one by where data lives and what it does, and how to install so an agent remembers across sessions.
MCP federation in 2026: what gateways and the June 2025 spec solved for running multiple MCP servers, and which problems, like auth propagation, remain open.
How prompt-cache keys are canonicalized, why a stable prefix decides your KV-cache hit rate, and what each provider actually discounts on a cache read.
Six agent-memory systems, read at pinned commits: hardcoded similarity thresholds, no published error rate, and no way to undo a merge.
Is memory hyperbolic? Cognitive maps are real, but one narrow CA1 result and indirect odor evidence do not establish a universal memory geometry.
AI agent consensus can be weak evidence when agents share models, sources, prompts, or memory. Count independent provenance chains instead.
When voting, reputation, and consensus can fail for multi-agent memory — and the published alternatives: outcomes, meta-knowledge, independence, reasons.
Bitemporal memory tracks valid time and transaction time — settled engineering. One reviewed agent system ships it; none of seven benchmarks tests it.
Provenance in agent memory is who asserted a fact, on what evidence, by what derivation. Timestamps keep the when and drop the who — what to record instead.
Graph memory MCP comparison of Graphiti, Cognee, Neo4j, and server-memory across traversal, temporal support, provenance, and STOP gaps.
GraphRAG vs RAG decision guide: when a knowledge graph's build, query, and latency cost pays off for multi-hop retrieval — and when it doesn't.
AI agent knowledge graph traversal depends on navigation policy, read-side tools, resolution, provenance, and stopping budget — not just graph size.
Hypergraph vs hyperbolic graph for AI memory: one grows the edge to many vertices (n-ary); the other curves the space for hierarchy. Where Mnemoverse bets.
Building memory that scales: a memory engine from 0.116 to 0.862 on LoCoMo over seven versions, quality held at 14x growth, with a 3D graph to watch it grow.
What is the best AI agent memory in 2026? A decision map across Mem0, Zep, Letta, Cognee, Supermemory, LangMem, and Mnemoverse, with the vendor position flagged up front.
AI agent memory compared for anyone weighing Mem0 alternatives: integration posture, self-host reality, temporal handling, and what benchmark scores hide.
Ontology vs schema vs topology: one shared commitment, five different contracts, and what missing data means — false, unknown, or forbidden.
OpenAI's Record & Replay for Codex and Anthropic's composable skills arrived the same week. Two stacks, one shift: encoding how work is done and making the procedure callable. The ownership question follows.
Cursor's valuation, Anthropic's dreaming preview, Google's Memory Bank: different architectures, same shift. Persistent memory has stopped being a research conversation and become a choice builders can no longer defer.
Orogat and Mansour name four failure modes of treating agent memory as storage, and propose GEM: four state-level operations instead of record-level CRUD. Why the abstraction, not the engine, is the problem.
AI agent memory fails three ways: statelessness, context rot, and lost-in-the-middle. Bigger context windows trade one failure for another and add token spend.
AI memory landscape 2026: how persistent memory became a production discipline — platform features, funded startups, the LoCoMo benchmark, and open problems.
When AI cites what does not exist: a case study of a recombination hallucination that passed four of five checks, and why persistent memory needs verification.
AI memory market 2025-2026: platform memory from OpenAI, Anthropic, Google, Microsoft, xAI, plus startups, funding rounds, and context-management trends.