Anthropic enables distributed agent memory with Claude Agent SDK session adapters

ClaudeClaude

· Updated

Anthropic launched session store adapters for the Claude Agent SDK, allowing developers to mirror agent transcripts to external databases like S3, Redis, and Postgres. This update enables persistent agent memory across distributed hosts, ensuring that sessions started on one server can be resumed on another.

Anthropic released session store adapters for the Claude Agent SDK, the framework for building agentic applications powered by Claude. By default, the SDK stores session transcripts as local files. The new SessionStore interface mirrors transcripts to external backends like Amazon S3, Redis, and PostgreSQL. Reference implementations are available in TypeScript and Python.

This update builds on the capability for production-grade concurrent task management. Local storage is insufficient for serverless functions or workers lacking a shared filesystem. By standardizing mirroring, developers can extend the cross-device continuity seen in the desktop app to custom deployments, ensuring durability when containers are ephemeral.

You can implement the append and load methods to connect the SDK to your infrastructure for compliance and multi-host deployments. This follows Anthropic's recent introduction of persistent agent memory for managed agents. The SDK uses a dual-write architecture that prioritizes local durability while asynchronously forwarding transcript batches to your store.

Noah Zweben
Noah Zweben
@noahzweben
X

Session store adapters in Agent SDK are now live! We published example adapters in TS and Python for S3, Redis, and Postgres adapter shapes. You can now mirror transcripts to your own backend, so a session created on one host can be resumed on another. https://t.co/Tsig9T9hsd

56likes
View on X

Still wondering? A few quick answers below.

A SessionStore adapter is an interface that allows the Claude Agent SDK to mirror session transcripts to external backends instead of just the local filesystem. By implementing required methods like append and load, developers can persist agent conversation history and reasoning steps to databases, ensuring that session data is durable and accessible across different environments.

The SDK uses a dual-write architecture where the Claude Code subprocess always writes to the local disk first. The SDK then forwards these transcript entries in batches to the external store via the append method. This best-effort approach ensures that a temporary outage of the external database does not interrupt the agent or cause local data loss.

Anthropic provides runnable reference implementations for Amazon S3, Redis, and PostgreSQL. These examples are available in both TypeScript and Python. While these specific adapters are provided as starting points, developers can write their own custom adapters for any backend by implementing the standard SessionStore interface provided within the SDK.

External storage is essential for multi-host deployments like serverless functions, autoscaled workers, or CI runners that do not share a filesystem. It allows a session created on one host to be resumed on another. It also provides better durability for ephemeral containers and helps meet corporate compliance and audit requirements for transcript retention.

Yes, the SDK can mirror subagent transcripts to external storage using a specific subpath key. To fully support subagent resume and discovery, the custom adapter must implement the optional listSubkeys method. Without this method, the SDK will only be able to restore the main conversation transcript when resuming a session from the external store.

Every HeadsUpAI update is written based on its original source and reviewed before it's published. Read our editorial standards →

Share this update