pydantic-ai-firestore-persistence
Google Firestore backend for pydantic-ai-persistence — a PydanticAI StepStore (durable events / snapshots / tool-effect ledger) and message-history store, on Firestore.
Install
pip install pydantic-ai-firestore-persistence
# or: pip install "pydantic-ai-persistence[firestore]"
Usage
from pydantic_ai import Agent
from pydantic_ai_harness.step_persistence import StepPersistence
from pydantic_ai_firestore_persistence import FirestoreStepStore
store = FirestoreStepStore(
project_id="my-gcp-project",
root_collection="pai_persistence",
max_snapshots_per_run=20,
)
agent = Agent("openai:gpt-4o", capabilities=[StepPersistence(store=store)])
FirestoreHistoryStore(project_id=…) provides save/load message history.
Authentication uses Application Default Credentials (gcloud auth application-default login).
Data model
Each partition key maps to a document <root>/<enc(PK)> whose items subcollection
holds one doc per sort key: <enc(SK)> → {SK, data}. Doc ids are URL-encoded
(Firestore ids can't contain /); the raw SK is a field so prefix/range queries
work within a subcollection without extra indexes.
Note: PydanticAI's
StepStoreis a beta/experimental harness feature.
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_firestore_persistence-0.1.0.tar.gz.
File metadata
- Download URL: pydantic_ai_firestore_persistence-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
495ce0e29f233dea713e7975f951483cf89039135bab74bdd5e99b6b33c3f792
|
|
| MD5 |
43579c8ed7374595f0aa831883e8c8b4
|
|
| BLAKE2b-256 |
b7e1ad1bc4e1f54beb149cc28c4d0730165e865cf5b58035b5f8f69c3dc21c22
|
File details
Details for the file pydantic_ai_firestore_persistence-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pydantic_ai_firestore_persistence-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.4 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 |
c11be450ea341cb32cd711a6fcdc030e86bd54751efd192a2f092a8ad087b356
|
|
| MD5 |
c210bb3167aacc22699f85e062b1a07c
|
|
| BLAKE2b-256 |
9db334284a0a3815453b223450c219a38ca3a61fdf5948d999e33dfb743d8f85
|