Checkpoint backends — deep dive
DynamoDB, Bedrock AgentCore, plugin authoring, SDK usage, and source thread keys. For the overview and quick start, see Checkpointing.
DynamoDB backend
Recommended for multi-instance deployments (Lambda / ECS / Fargate): no persistent connections, IAM-native auth, per-request billing. Unlike bedrock_agentcore, pending tool_calls are persisted alongside the checkpoint, so interrupt/resume works correctly with approvals.
Uses the AWS-maintained langgraph-checkpoint-aws package — single unified table, native async, optional TTL + zstd compression + S3 offloading for checkpoints > 350 KB.
Agents that read images or PDFs
Binary read_file results land in the message history, and so in every checkpoint, and DynamoDB caps an item at 400 KB. Two ways to deal with it: s3_offload_config below spills the whole oversized checkpoint to S3, so it keeps the media across runs but still writes it on every step; flags.offload_binary_content keeps the media out of the checkpoint (a ~1 KB reference instead), but the media does not outlive the run, so a later run or an approval resume on the same thread no longer sees it.
# agents/my_agent.md frontmatter
checkpoint:
backend: dynamodb
config:
table_name: my-checkpoints-table
region_name: eu-west-1
# ── optional production hardening ──────────────────────────
ttl_seconds: 604800 # GC 7d after last write
enable_checkpoint_compression: true # zstd-compress payload
s3_offload_config: # spill >350 KB to S3
bucket_name: my-checkpoint-overflow-bucket
Config reference
config key |
Env var | Default | Purpose |
|---|---|---|---|
table_name |
ABT_CHECKPOINT_DYNAMODB_TABLE |
required | Single unified checkpoint table. |
region_name |
ABT_CHECKPOINT_DYNAMODB_REGION |
boto3 default chain | AWS region. |
endpoint_url |
ABT_CHECKPOINT_DYNAMODB_ENDPOINT |
none | DynamoDB Local / moto / VPC endpoints. |
ttl_seconds |
ABT_CHECKPOINT_DYNAMODB_TTL_SECONDS |
none | Auto-delete after N seconds (requires TTL enabled on table). |
enable_checkpoint_compression |
ABT_CHECKPOINT_DYNAMODB_COMPRESSION |
false |
zstd-compress payloads — cuts RCU/WCU. |
s3_offload_config |
(no env shortcut) | none | Keys: bucket_name (required), endpoint_url, key_prefix. |
Attribute names are fixed by the upstream library
The checkpoint table attribute names (PK, SK, ttl) are hard-coded in langgraph-checkpoint-aws. You can rename the table but not the attributes.
Provisioning the table
Use required_tables_schema() to get the exact create_table kwargs:
from abt.checkpoint.backends.dynamodb import required_tables_schema
import boto3
schema = required_tables_schema(table_name="my-checkpoints-table")
ddb = boto3.client("dynamodb", region_name="eu-west-1")
ddb.create_table(**schema["checkpoints"])
ddb.get_waiter("table_exists").wait(TableName=schema["checkpoints"]["TableName"])
ddb.update_time_to_live(**schema["time_to_live"]) # only if using ttl_seconds
| Table | PK | SK | TTL attribute |
|---|---|---|---|
| checkpoints | PK (S) |
SK (S) |
ttl (N, epoch seconds) |
AWS Console walkthrough
One table, On-demand capacity, no secondary indexes:
| Step | Field | Value |
|---|---|---|
| 1 | Table name | your table_name value |
| 2 | Partition key | PK / String |
| 3 | Sort key | SK / String |
| 4 | Capacity mode | On-demand |
| 5 | TTL attribute (if using ttl_seconds) |
ttl — enable |
Minimum IAM permissions
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"dynamodb:GetItem", "dynamodb:PutItem", "dynamodb:UpdateItem",
"dynamodb:DeleteItem", "dynamodb:Query", "dynamodb:BatchWriteItem",
"dynamodb:DescribeTable"
],
"Resource": "arn:aws:dynamodb:<region>:<account-id>:table/<checkpoints-table>"
}]
}
If using s3_offload_config, add s3:GetObject / s3:PutObject / s3:DeleteObject on the overflow bucket.
Bedrock AgentCore backend
checkpoint:
backend: bedrock_agentcore
config:
memory_id: "arn:aws:bedrock:us-east-1:123456789012:memory/my-memory"
actor_id: "user-alice"
region_name: "us-east-1"
Or via environment:
ABT_CHECKPOINT_BACKEND=bedrock_agentcore \
ABT_CHECKPOINT_BEDROCK_MEMORY_ID=arn:aws:bedrock:us-east-1:123456789012:memory/my-memory \
ABT_CHECKPOINT_BEDROCK_ACTOR_ID=user-alice \
ABT_CHECKPOINT_BEDROCK_REGION=us-east-1 \
abt dispatch -s my_workflow
Thread-ids are normalised automatically: characters outside [A-Za-z0-9_-] become _, non-alphanumeric leads get an s prefix, an 8-hex SHA256 suffix of the original id is always appended (collision guard), and the result is truncated to 128 characters.
AWS credentials & region
Uses the default boto3 credential chain. Declare credentials in profiles.yaml env: block:
# profiles.yaml
default:
target: dev
outputs:
dev:
model_id: bedrock_converse:your-model-id
region: eu-central-1
env:
AWS_PROFILE: <your-aws-profile>
AWS_REGION: eu-central-1
Precedence, per variable name:
1. profiles.yaml → outputs.<target>.env: — published into the process environment when the profile loads, overwriting any value already set for that key.
2. Whatever the shell / CI already had set, for any key the profile's env: block doesn't mention.
3. boto3 default chain (~/.aws/credentials, instance profile), if neither of the above set the key.
In other words, profiles.yaml wins over the shell for any key it declares — it does not merely fill gaps. SDK callers that want process isolation can pass publish_env=False to load_profile() and read credentials only from the returned ProfileTarget.
The backend's region_name overrides AWS_REGION specifically for the saver.
Third-party backends (plugins)
A backend implements the CheckpointerProvider protocol: a build() async context manager that yields a LangGraph saver, and extra_configurable(). Decorate the class with @checkpoint_backend("<name>"), which instantiates it. Then register it with the abt.checkpoint_backends entry point (or drop the module into providers/):
from contextlib import asynccontextmanager
from abt.checkpoint import checkpoint_backend
@checkpoint_backend("postgres")
class PostgresBackend:
@asynccontextmanager
async def build(self, *, spec_config, workspace_dir):
from langgraph.checkpoint.postgres.aio import AsyncPostgresSaver
async with AsyncPostgresSaver.from_conn_string(spec_config["dsn"]) as saver:
await saver.setup()
yield saver
def extra_configurable(self, spec_config):
return {}
# pyproject.toml
[project.entry-points."abt.checkpoint_backends"]
postgres = "my_package.postgres_backend:PostgresBackend"
Or skip the class entirely with wrap_checkpointer:
from contextlib import asynccontextmanager
from abt.checkpoint import wrap_checkpointer
@asynccontextmanager
async def _make_postgres_saver(spec_config):
from langgraph.checkpoint.postgres.aio import AsyncPostgresSaver
async with AsyncPostgresSaver.from_conn_string(spec_config["dsn"]) as saver:
await saver.setup()
yield saver
postgres_backend = wrap_checkpointer("postgres", _make_postgres_saver)
Then use --checkpoint-backend postgres.
SDK usage
import asyncio
from pathlib import Path
from abt.checkpoint import build_checkpoint_spec, resolve_checkpointer
spec = build_checkpoint_spec(
cli_backend="sqlite",
cli_thread_id="my-session",
)
async def main() -> None:
async with resolve_checkpointer(spec, workspace_dir=Path(".")) as saver:
... # pass `saver` as the checkpointer of your LangGraph graph
asyncio.run(main())
Source thread keys
Source adapters can declare a thread key so abt derives the thread-id automatically from fetched data (e.g. Slack thread URL → slack:C01234:1699999999.123).
Override in source YAML
thread_key_override is a template rendered at dispatch. It takes precedence over the provider's own key.
# sources/slack_thread.yaml
name: slack_thread
type: slack_thread
credentials: slack
thread_key_override: "slack:{{ var('channel_id') }}:{{ var('thread_ts') }}"
config:
channel_id: "{{ var('channel_id') }}"
thread_ts: "{{ var('thread_ts') }}"
abt compile needs the var() values too. Pass --vars '{channel_id: C01234, thread_ts: "1699999999.123"}' or set them under vars: in abt.yaml. Without them it stops with Missing required template variable(s) 'channel_id', 'thread_ts'.
Register in Python (custom providers)
from abt.sources.registry import source_thread_key
@source_thread_key("my_source_type")
def my_source_thread_key(*, credentials, config):
return f"my_source:{config['item_id']}"
Return None if no thread key is derivable from the current config.