Skip to content

Add snapshots documentation for point-in-time agent state capture and restore#733

Open
zastrowm wants to merge 3 commits intostrands-agents:mainfrom
zastrowm:snapshot_documentation
Open

Add snapshots documentation for point-in-time agent state capture and restore#733
zastrowm wants to merge 3 commits intostrands-agents:mainfrom
zastrowm:snapshot_documentation

Conversation

@zastrowm
Copy link
Copy Markdown
Member

@zastrowm zastrowm commented Apr 2, 2026

Description

Adds documentation for the new Snapshots feature, which lets users capture and restore agent state at any point in time. The page covers basic usage (take/load), field selection with presets and include/exclude, application data, serialization, and practical use cases like checkpointing and branching conversations. Both Python and TypeScript examples are included via tabbed code blocks.

Also updates the State Management page to cross-link to the new Snapshots page alongside the existing Session Management reference.

Related Issues

strands-agents/sdk-python#1138

Type of Change

  • New content

Checklist

  • I have read the CONTRIBUTING document
  • My changes follow the project's documentation style
  • I have tested the documentation locally using npm run dev
  • Links in the documentation are valid and working

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@@ -0,0 +1,136 @@
import { Agent } from '@strands-agents/sdk'
import { takeSnapshot, loadSnapshot } from '@strands-agents/sdk/agent/snapshot'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: Import path verification needed

Suggestion: Please verify that @strands-agents/sdk/agent/snapshot is the intended public API path in the TypeScript SDK. If snapshots are part of the core SDK exports, consider using import { takeSnapshot, loadSnapshot, type Snapshot } from '@strands-agents/sdk' instead for consistency with other SDK imports.

```python
import json
from strands import Agent
from strands.types._snapshot import Snapshot
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: Import from private module

The import from strands.types._snapshot import Snapshot uses an underscore-prefixed module (_snapshot), which typically indicates a private/internal API in Python conventions.

Suggestion: Verify if Snapshot should be exported from a public path (e.g., from strands.types.snapshot import Snapshot or from strands import Snapshot). If the SDK intends this to be the public API, consider removing the underscore prefix from the module name in the SDK.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Assessment: Comment

This is well-structured documentation for a new feature. The content is clear, comprehensive, and includes practical use cases that demonstrate real-world value (checkpointing, branching conversations).

Review Categories
  • API Exposure: The Python example imports Snapshot from strands.types._snapshot, which uses underscore-prefixed module naming. Consider using a public API path.
  • SDK Parity: The session preset captures different fields between Python and TypeScript without explicit explanation of why they differ.
  • Import Paths: The TypeScript import path @strands-agents/sdk/agent/snapshot should be verified as the intended public API.

The documentation itself is well-written with good structure and helpful examples. The suggestions above are about ensuring the API references align with SDK conventions.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Documentation Preview Ready

Your documentation preview has been successfully deployed!

Preview URL: https://d3ehv1nix5p99z.cloudfront.net/pr-cms-733/docs/user-guide/quickstart/overview/

Updated at: 2026-04-02T22:42:42.461Z

--8<-- "user-guide/concepts/agents/snapshots.ts:take_snapshot"
```

The `"session"` preset captures `messages`, `state`, and `systemPrompt`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: Session preset differences not explained

The Python "session" preset captures messages, state, conversation_manager_state, and interrupt_state (excluding system_prompt), while the TypeScript "session" preset captures messages, state, and systemPrompt. This difference could confuse users switching between SDKs.

Suggestion: Add a brief note explaining why the presets differ between languages, or consider adding a callout/admonition that highlights this SDK-specific difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant