Long-Term Memory Best Practices
Ten practices for deciding what to persist, how to store it, and how to keep it accurate as agents span many sessions.
Search across all documentation pages
Ten practices for deciding what to persist, how to store it, and how to keep it accurate as agents span many sessions.
Use this list when designing personalization, support continuity, or any agent that should "remember" without becoming a black hole of stale text.
| Stage | Habits | Exit criterion |
|---|---|---|
| Scope | 1-3 | Clear list of keys/episode types; SoR boundaries documented |
| Write path | 4-6 | Explicit tools + gated extraction + forget/correct APIs |
| Read path | 7-8 | Budgets + authz tests for isolation |
| Operate | 9-10 | Conflict policy + dashboards/alerts on memory quality |
Treat 6, 8, and secrets hygiene from 1-2 as mandatory. If 8 fails, do not store personal memory at all.
Yes for single-user prototypes if the interface still supports upsert, list-by-user, and delete. Plan the multi-tenant store before SaaS launch.
No. Vectors help retrieval rank episodes and docs. They do not define write policy, trust, or forget.
When continuity is a handful of stable prefs and defaults. Add episodic retrieval when past decisions matter and evals show the need.
Jointly with eng. PM defines user-visible preferences; eng defines schema, budgets, and isolation tests.
Run expiry jobs for TTL rows continuously; review inactive episodes on a quarterly product cadence; honor legal retention separately.
Stale or wrong prefs injected every turn with no forget path, so the agent confidently repeats a fixed error.
Short-term carries the active session. These habits govern what crosses session boundaries. Use both deliberately.
Yes: one shared write policy and least-privilege namespaces per role so specialists cannot corrupt global profile state.
Task success or user satisfaction lift on returning users, plus low correction rate on remembered facts - not raw memory count.
Yes for consumer trust and often for regulation. "What we remember" UIs pair well with habit 6.
Use the architecture guide for tiering, extraction/retrieval articles for pipelines, and the vector section when search quality becomes the bottleneck.
Stack versions: Pins from the category manifest (verify at build): OpenRouter (~315+ models, July 2026 pricing/fees); LangGraph 1.0+; CrewAI 1.14+; Microsoft Agent Framework 1.0; Vercel AI SDK 6; Pydantic AI (latest); LlamaIndex (latest); OpenAI Agents SDK (latest + MCP); MCP (Linux Foundation governance); A2A (HTTP+SSE+JSON-RPC 2.0); Solana
@solana/web3.js+@solana/spl-token.
Reviewed by Chris St. John·Last updated Jul 16, 2026