Skip to content
awesome-applied-ai
← all layers

Memory & State

Decide what survives the turn

What should the system still know tomorrow?

13 entries · 2 categories · 3 equations

The arithmetic

Bi-temporal fact
f  =  (s,p,o,  [tvalid,tinvalid),  tingest)f \;=\; \big(s,\, p,\, o,\; [\,t_{\text{valid}},\, t_{\text{invalid}}\,),\; t_{\text{ingest}}\big)

Two independent time axes: when the fact was true in the world, and when the system learned it. Drop the second and you cannot reconstruct what the agent believed at the moment it acted — which is exactly what an incident review asks for. This interval is Graphiti's actual differentiator over flat fact stores.

Recency-weighted recall
score(m)  =  λsim(q,m)  +  (1λ)eΔt/τ\mathrm{score}(m) \;=\; \lambda\,\mathrm{sim}(q, m) \;+\; (1-\lambda)\,e^{-\Delta t / \tau}

Almost every memory layer implements some version of this. The failure mode is structural: a stale fact with high similarity outranks a fresh correction, because exponential decay only discounts age — it never marks the old fact false. Temporal invalidation does.

Memory selection is a knapsack
maxivixis.t.icixiB,    xi{0,1}\max \sum_i v_i x_i \quad \text{s.t.} \quad \sum_i c_i x_i \le B,\;\; x_i \in \{0,1\}

B is the token budget you allocate to memory, not the model's advertised window. Every memory system is solving this approximately and none of them will tell you what B is — set it yourself.

Memory systems

Third-party stores for facts, sessions and entities.

9
01

Graphiti

Bi-temporal graph where edges carry valid-from and invalid-at, so facts expire

Temporal invalidation is the clearest differentiator against native memory tools.

temporalgraph
Apache-2.0open sourceproduction viableself-host
02

Mem0

Extracts facts into a vector, graph and KV store scoped by user, session or agent

fact-extractionpopular
Apache-2.0open coreproduction viableboth
03

Zep

Async summarization and entity extraction layered over Graphiti

summarizationservice
Apache-2.0open coreproduction viableboth
04

Cognee

ECL pipeline building an ontology-typed graph alongside a vector index

ontologygraph
Apache-2.0open sourceearlyself-host
05

Hindsight

Retain, recall and reflect over memory banks with fact extraction and an MCP server

mcpreflection
MITopen sourceearlyself-host
06

LangMem

Extracts and updates memories into a LangGraph store

Recent activity is largely dependency bumps, with no tagged releases.

langgraphcheck-before-adopting
slowingMITopen sourceearlyself-host
07

Letta (ex-MemGPT)

LLM-as-OS paging between main context, recall and archival stores

Core repo took ~5 commits in three months; development moved to sibling repos. Still widely recommended in roundups.

pagingcheck-before-adopting
slowingApache-2.0open coreearlyboth
08

MemOS

OS-style abstraction over plaintext, activation (KV) and parametric memory

research-derived
Apache-2.0open sourceearlyself-host
09

Supermemory

Memory API and RAG over user context, with a router SDK and MCP

mcpapi
MIT clientopen coreearlyboth

Native platform state

Memory and state primitives shipped by model vendors.

4
01

Anthropic context editing

Server-side clearing of stale tool results and thinking blocks before token counting

nativeanthropicpruning
Commercialcommercialproduction viablesaas
02

Anthropic memory tool

Claude issues CRUD against a /memories directory; you own the storage backend

Stores nothing itself. Budget for path-traversal defenses, per-tenant isolation and retention policy.

nativeanthropic
Commercialcommercialproduction viablesaas
03

Gemini context caching

Explicit cached-content handles or implicit auto-cache on repeated prefixes

nativegoogle
Commercialcommercialproduction viablesaas
04

OpenAI Responses API state

Server-stored response items chained via previous_response_id, 30-day retention

nativeopenai
Commercialcommercialproduction viablesaas