Your personal memory, across sessions, agents, and devices.

OpenAI Responses API and Agents SDK: How They Work

memU Team memU Team

The Responses API is OpenAI's recommended API for new projects, and the Agents SDK is its open-source framework for building agents on top of it. The SDK's repository dates from March 11, 2025. The older Assistants API was sunset on August 26, 2026, which leaves Responses as OpenAI's API for durable, server-side conversation threads. By the end you will know how each stores state, how to leave Assistants, and what neither remembers.

What are the Responses API and the Agents SDK, in one sentence?

The Responses API is OpenAI's model endpoint that can run a tool-calling loop in one request, and the Agents SDK is a framework for building single or multi-agent workflows on top of it.

OpenAI's migration guide calls Responses "an evolution of Chat Completions" and recommends it for all new projects. Chat Completions remains supported. The Agents SDK docs say the SDK uses the Responses API by default for OpenAI models. The Python SDK repository dates from March 11, 2025 and is MIT-licensed. Version 0.24.0 shipped on October 15, 2026. A JavaScript and TypeScript version lives in a separate repository.

How does the Responses API differ from Chat Completions?

Responses returns typed items and can keep state on OpenAI's side. It can also call tools that OpenAI hosts.

Chat Completions Responses API
Output shape choices[].message A typed output array of items
Tool calls per request Your code runs each tool round trip An agentic loop can call several tools in one request
Hosted tools None. You write your own integrations Web search, file search, computer use, code interpreter, remote MCP, image generation
Server-side state Stored by default for new accounts Stored by default, chainable with a previous response ID
Durable threads No Through the Conversations API
Status Supported Recommended for new projects

Source: OpenAI's migration guide. OpenAI reports, from its own internal tests, a 40% to 80% improvement in cache use, which lowers cost. To migrate, OpenAI advises moving one flow at a time, starting with plain text generation.

How do the Responses API and Agents SDK keep conversation state?

There are three options in the API, described in OpenAI's conversation state guide.

Chaining is the simplest. You pass the previous response's ID and OpenAI threads the next request onto it. Response objects are saved for 30 days by default. Chaining does not save money, because all earlier input tokens in the chain are billed again as input. It also does not carry over the earlier response's top-level instructions, so you resend them.

For durable threads, use the Conversations API. A conversation is a long-running object with its own durable ID. You can reuse it across sessions and devices. Conversation objects and their items are not subject to the 30-day limit.

Or manage state yourself. You set store to false and replay the output items, including reasoning items, on each turn. Zero Data Retention organizations get this mode enforced automatically.

For long threads, the same guide describes server-side compaction, which you configure on the request. A standalone compact endpoint lets you compact a thread when you choose.

The Agents SDK wraps these choices in Sessions. Per the Sessions docs, a session loads the stored history before each run, prepends it to the new input, and saves the new items afterwards. Backends include a local SQLite file, Redis and OpenAI's Conversations API. Wrappers add compaction or encryption, and you can write your own backend.

from agents import Agent, Runner, SQLiteSession

agent = Agent(name="Assistant", instructions="Reply very concisely.")
session = SQLiteSession("conversation_123")

result = await Runner.run(agent, "What city is the Golden Gate Bridge in?", session=session)
result = await Runner.run(agent, "What state is it in?", session=session)

The docs add a security note: a session ID does not authenticate a user. Your application must authorize access to each session.

What does the Agents SDK add beyond the API?

The SDK overview lists these primitives:

  • Agents are models with instructions and tools, run in a loop until the task is done.
  • Handoffs and agents-as-tools let one agent delegate work to another.
  • Guardrails validate inputs and outputs in parallel with the run and fail fast.
  • Function tools turn Python functions into tools with generated schemas.
  • MCP support exposes remote MCP tools next to function tools.
  • Tracing records runs for debugging and monitoring.

Newer additions include sandbox agents that work in isolated workspaces. Realtime voice agents and human-in-the-loop steps are also documented. Install it with pip install openai-agents.

What happened to the Assistants API?

OpenAI sunset the Assistants API on August 26, 2026, and the migration guide says it "is no longer available." OpenAI points everyone to the Responses API. Compare behavior and token use on each migrated flow before you shift more traffic.

Read the fine print

The cache improvement and the "recommended for all new projects" wording are OpenAI's. We found no independent benchmark comparing Responses and Chat Completions on cost or quality. Stored responses stay with OpenAI for 30 days unless you set store to false. Conversation items are exempt from that 30-day limit. Check that against your retention policy before you turn on hosted state.

The bottom line

Start new OpenAI projects on the Responses API. Add the Agents SDK for handoffs and tracing, and keep chat history in Sessions or the Conversations API. Plan separately for anything your agents should know beyond one conversation, because neither stores facts or preferences across threads.

Where should agent memory live beyond one conversation?

Sessions and conversations hold history. The Sessions docs describe loading and saving conversation items, with compaction to shorten them. They do not describe pulling out durable facts or procedures that a new conversation should start with. You hit the same gap while building: your coding agent forgets your SDK conventions between sessions.

memU covers the coding-agent case today. It is a shared memory for coding agents such as Codex and Claude Code, stored as a wiki of readable Markdown. A scheduled background task slices new session logs into jobs, and the agent distills them into memory and skill files. memU itself makes no LLM calls and only stores and retrieves what the agent wrote. A standing instruction in AGENTS.md or CLAUDE.md tells the agent to retrieve before answering. memU is not an Agents SDK session backend, so it will not replace Sessions inside your product.

To try the hosted version, which is free and syncs across devices, get an API key from memu.so and send your agent one message:

Read https://memu.pro/SKILL.md, follow its instructions to install and configure memU, API Key is YOUR_MEMU_API_KEY.

The support matrix and self-hosted setup are in the memU GitHub repository.

FAQ

Is the Responses API replacing Chat Completions?

No. OpenAI says Chat Completions remains supported, while it recommends Responses for all new projects.

Is the Assistants API still available?

No. OpenAI sunset the Assistants API on August 26, 2026, and it is no longer available. The migration path is the Responses API.

How long does OpenAI store Responses API data?

Response objects are saved for 30 days by default. Set store to false to turn this off. Items in a Conversation are not subject to the 30-day limit.

Does the OpenAI Agents SDK have memory?

It has Sessions, which store conversation history in a backend such as SQLite or OpenAI's Conversations API. The docs describe history only. Long-term facts across conversations are left to you.

Is the OpenAI Agents SDK open source?

Yes. The Python SDK is MIT-licensed on GitHub and installs with pip. OpenAI also publishes a JavaScript and TypeScript version.