Skip to main content

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 underlying AsyncKV (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 StepStore is 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

pydantic_ai_dynamodb_persistence-0.1.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file pydantic_ai_dynamodb_persistence-0.1.0.tar.gz.

File metadata

File hashes

Hashes for pydantic_ai_dynamodb_persistence-0.1.0.tar.gz
Algorithm Hash digest
SHA256 41cc40f92d0c36e8db0016250cf453ca626f9fe71a30f62db4004feffab600f4
MD5 afb5eaf188cc5f5db64433ae9deed232
BLAKE2b-256 f1b438d85631b010e0f2b7c62c0d66cf707ad8f21047844423a791c6a4aab5d4

See more details on using hashes here.

File details

Details for the file pydantic_ai_dynamodb_persistence-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pydantic_ai_dynamodb_persistence-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e1ef48bd4a6895c82ac65f54d9010c7db6cba9ccfb11de84286c3a9cfb01ca2
MD5 e1ce7e2fe41fa42bf0173b25e6993fd4
BLAKE2b-256 c007f2169b8cee03d726f8361d85a0f3e058691753dca2865e8760aee024d548

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page