What's the difference between the OpenAI Agents SDK and LangChain?
The OpenAI Agents SDK is a small, fixed set of primitives, agents, handoffs, and guardrails, that you compose directly in code, while LangChain is a much bigger harness whose current architecture describes itself as “Model + Harness,” assembling an agent from a model, tools, a prompt, and middleware. The OpenAI SDK’s own docs call it lightweight, with “few enough primitives to make it quick to learn”; sessions, a separately documented persistent memory layer, sit alongside that core set rather than inside it. LangChain’s own docs state plainly that its agents are “built on top of LangGraph” underneath, so you inherit LangGraph’s checkpointed state without hand-building the graph yourself.
That difference shows up in what each defaults to. The OpenAI SDK uses OpenAI’s own Responses API by default, though it can reach other providers; LangChain’s own selling point is one interface across many model and tool providers, built from an ecosystem the OpenAI SDK doesn’t try to match. LangGraph itself, the runtime LangChain’s harness now sits on, saves state at every step so a failed run can resume from there instead of starting over, a capability with no equivalent in the Agents SDK’s own handoffs.
sources
- OpenAI Agents SDK documentation fetched
- LangChain documentation: Overview fetched