pydantic-ai-dynamodb-persistence
Amazon DynamoDB backend for pydantic-ai-persistence — a PydanticAI StepStore (durable events / snapshots / tool-effect ledger) and message-history store, on DynamoDB.
Install
pip install pydantic-ai-dynamodb-persistence
# or via the core extra:
pip install "pydantic-ai-persistence[dynamodb]"
Requires Python 3.10+.
Usage
Durable step persistence
from pydantic_ai import Agent
from pydantic_ai_harness.step_persistence import StepPersistence
from pydantic_ai_dynamodb_persistence import DynamoDBStepStore
store = DynamoDBStepStore(table_name="pai-steps", region_name="us-east-1",
max_snapshots_per_run=20)
agent = Agent("openai:gpt-4o", capabilities=[StepPersistence(store=store)])
Message history
from pydantic_ai_dynamodb_persistence import DynamoDBHistoryStore
store = DynamoDBHistoryStore(table_name="pai-history", region_name="us-east-1")
await store.save("conv-1", result.all_messages())
prior = await store.load("conv-1")
API
DynamoDBStepStore(table_name, *, region_name=None, boto_session=None, endpoint_url=None, max_snapshots_per_run=None)DynamoDBHistoryStore(table_name, *, region_name=None, boto_session=None, endpoint_url=None)DynamoDBAsyncKV(...)— the underlyingAsyncKV(offloads sync boto3 to a thread).
Standard boto3 auth (env / profile / SSO / IAM role). Single table, PK + SK string keys, auto-created (on-demand billing).
Note: PydanticAI's
StepStoreis a beta/experimental harness feature; its API may still change.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydantic_ai_dynamodb_persistence-0.1.0.tar.gz.
File metadata
- Download URL: pydantic_ai_dynamodb_persistence-0.1.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41cc40f92d0c36e8db0016250cf453ca626f9fe71a30f62db4004feffab600f4
|
|
| MD5 |
afb5eaf188cc5f5db64433ae9deed232
|
|
| BLAKE2b-256 |
f1b438d85631b010e0f2b7c62c0d66cf707ad8f21047844423a791c6a4aab5d4
|
File details
Details for the file pydantic_ai_dynamodb_persistence-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pydantic_ai_dynamodb_persistence-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e1ef48bd4a6895c82ac65f54d9010c7db6cba9ccfb11de84286c3a9cfb01ca2
|
|
| MD5 |
e1ce7e2fe41fa42bf0173b25e6993fd4
|
|
| BLAKE2b-256 |
c007f2169b8cee03d726f8361d85a0f3e058691753dca2865e8760aee024d548
|