Skip to main content

pydantic-ai-cosmosdb-persistence

Azure CosmosDB backend for pydantic-ai-persistence — a PydanticAI StepStore (durable events / snapshots / tool-effect ledger) and message-history store, on CosmosDB.

Install

pip install pydantic-ai-cosmosdb-persistence
# or:  pip install "pydantic-ai-persistence[cosmosdb]"

Usage

from pydantic_ai import Agent
from pydantic_ai_harness.step_persistence import StepPersistence
from pydantic_ai_cosmosdb_persistence import CosmosDBStepStore

store = CosmosDBStepStore(
    endpoint="https://<acct>.documents.azure.com:443/",
    key="<key>",
    database_name="pai",
    container_name="steps",
    max_snapshots_per_run=20,
)
agent = Agent("openai:gpt-4o", capabilities=[StepPersistence(store=store)])

CosmosDBHistoryStore(endpoint=…, key=…, database_name=…, container_name=…) provides save/load message history.

Data model

A container partitioned by /PK; each item is {id, PK, SK, data} (the id is a URL-encoded SK since Cosmos ids can't contain # / \ ?; the raw SK is a field for range queries). Database and container are auto-created (key-based auth).

Note: PydanticAI's StepStore is a beta/experimental harness feature.

License

MIT

Metadata

Release files for pydantic-ai-cosmosdb-persistence 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydantic-ai-cosmosdb-persistence 0.1.0
File Size Uploaded Provenance
pydantic_ai_cosmosdb_persistence-0.1.0.tar.gz 4.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pydantic-ai-cosmosdb-persistence 0.1.0
File Interpreter ABI Platform
pydantic_ai_cosmosdb_persistence-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.4 kB

Release files / pydantic_ai_cosmosdb_persistence-0.1.0.tar.gz

Download URL pydantic_ai_cosmosdb_persistence-0.1.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5cdcc2866da9b88da42f8cd21e7d4e5e4438a24a9ed31b339699c76358e824d5
BLAKE2b-256 checksum
How to use checksums
2f3f90b61fc316d980bb29afd7a652b20cb635e3cffa401845941053c79072d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Release files / pydantic_ai_cosmosdb_persistence-0.1.0-py3-none-any.whl

Download URL pydantic_ai_cosmosdb_persistence-0.1.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9cecfbb74bfab335caa12d3eeb1f909f41e69044b81eb663a53728950568c505
BLAKE2b-256 checksum
How to use checksums
ac98a11a941f2f698d14f510d1aaba6103df02e4600896e74f5a690275cbee44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Security for pydantic-ai-cosmosdb-persistence 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page