OpenAI Agents SDK Memory
https://openai.github.io/openai-agents-python/ref/memory/
OpenAI's agent SDK. Sessions for working context within an agent loop; RunContextWrapper for structured persistent state. April 2026 update added categorised long-term memory: project / user / policy. Long-term tier typically backed by external vector DBs (Pinecone, etc.).
At a glance
- Type
- Sessions + RunContextWrapper + categorised long-term
- Tier
- T2
- Section
- Framework-embedded memory
- Created
- 2025-03 (launched March 2025 as production-ready evolution of Swarm)
- Latest release
- not applicable — not OSS
- License
- not applicable — not OSS
- GitHub
- not applicable — no GitHub repo
- Pricing
- SDK OSS free; pay for OpenAI API model usage at standard token pricing (e.g. GPT-5.4: $2.50/$15 per M tokens)
- Funding
- OpenAI raised $40B+ total funding across multiple rounds; $300B+ valuation; no independent funding for SDK
Taxonomy
- storage
- kv
- retrieval
- injection
- persistence
- cross-session
- update
- overwrite
- unit
- episode
- governance
- inspectable
- conflict
- overwrite
When to use
Optimised for: OpenAI-native agent SDK with Sessions + categorised memory
Anti-fit: not for non-OpenAI providers (provider-coupled)
Pros & cons
Pros
First-party from OpenAI — fastest path if you're building exclusively on OpenAI models.
Cons
Vendor-locked; less feature surface than dedicated memory layers.
Claims & capabilities
Sessions-based working-context layer over Responses API; SDK handles context length, history, and continuity automatically. Storage backends: SQLite (default), SQLAlchemy (production), Dapr, OpenAI Conversations API. Compaction via OpenAIResponsesCompactionSession. April 2026 added categorised long-term memory (project / user / policy)
Technical surface
- API surface
- REST, SDK: Python, JS/TS
- Backend storage
- custom (OpenAI-managed)
- Deployment
- Both (OSS library self-hosted; relies on OpenAI or Azure OpenAI API endpoints; no dedicated SDK hosting)
- Embedding model
- multiple supported
- Multi-tenancy
- hard-isolation
- MCP
- native (first-party) — Agents SDK MCP support
- A2A
- searched not found
- OpenTelemetry
- via adapter — OpenAI traces + OTel exporters
Similar systems
Other framework-embedded memory in the catalog, ranked by inbound references.
- LangGraph Persistence T2
Distinct from LangMem. Built-in checkpointer saves graph state per super-step (short-term, thread-scoped). Store System adds long-term hierarchical key-value memory across threads with optional vector search + TTL. Postgres / Mongo / Redis stores for production.
- AutoGen Memory T2
ListMemory chronological context + teachable agents that vectorise corrections. Integrates with Mem0/Zep rather than building deep memory natively.
- CrewAI Memory T2
Memory subsystem inside the CrewAI orchestration framework; integrates with Mem0 for the long-term tier.
- AGiXT Adaptive Memory T2
Open-source AI automation platform. Routes between short-term and long-term memory adaptively across any LLM provider; plugin system for storage backends. Memory managed at the instruction-management layer — task context, instruction state, conversation history as unified agent state.
- Agno (Phidata) Memory T2
Agno (formerly Phidata). AgentStorage persists sessions to a DB; AgentMemory auto-classifies/store user preferences and conversation summaries. Single-line integrations with LanceDB, Pinecone, Weaviate, Qdrant.
- Botpress LLMz T1
Per-plan vector-DB storage quota + LLMz autonomous engine (in-session working memory) + Knowledge Base (semantic search over uploaded docs). Long-term user memory persists across sessions.
Related systems
References (2)
- OpenAI GPT family (GPT-5 / GPT-4o / o3 / o4) depends on at runtime — adjacent-infrastructure cell: requires OpenAI API; BYO persistence layer
- Pinecone builds on — Long-term tier typically backed by external vector DBs (Pinecone, etc.).