Skip to main content

strands-postgres-storage

A PostgreSQL implementation of the Strands Agents unified Storage interface — durable bytes-under-string-keys that backs session snapshots, context offloading, memory stores, and anything that consumes strands.storage.Storage.

pip install strands-postgres-storage
from strands.storage import Storage
from strands_postgres_storage import PostgresStorage

storage = PostgresStorage("postgresql://user:pass@localhost:5432/db")
assert isinstance(storage, Storage)

await storage.write("sessions/abc/state.json", b"...bytes...")
data = await storage.read("sessions/abc/state.json")   # -> bytes | None
keys = await storage.list("sessions/")                 # sorted, prefix-matched
await storage.delete("sessions/abc/state.json")        # no-op if absent

Interface

Method Behaviour
write(key, data) Upsert bytes under a /-separated key
read(key) Return the bytes, or None if absent
delete(key) Delete the key (no-op if missing)
list(prefix) Full keys matching the prefix, sorted ascending

Data model

A single table (strands_storage by default) of (key VARCHAR PRIMARY KEY, data BYTEA), created automatically. An optional prefix= namespaces all keys. Built on the SQLAlchemy-backed strands-sql-storage — PostgresStorage is SQLStorage under a PostgreSQL-specific name; blocking calls run in a thread so the async interface never blocks the event loop.

License

MIT

Metadata

Release files for strands-postgres-storage 0.1.1

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

Source distribution (sdist)

Source distribution for strands-postgres-storage 0.1.1
File Size Uploaded Provenance
strands_postgres_storage-0.1.1.tar.gz 4.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for strands-postgres-storage 0.1.1
File Interpreter ABI Platform
strands_postgres_storage-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.8 kB

Release files / strands_postgres_storage-0.1.1.tar.gz

Download URL strands_postgres_storage-0.1.1.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6faa07ea05da068ca5a5855b1b7bdd78721269a168da010e47631bcefbb99ada
BLAKE2b-256 checksum
How to use checksums
6a04aa2984a9cfd0563880958f6954052dc15e804f3c5ffc06fe9e4a3294265e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / strands_postgres_storage-0.1.1-py3-none-any.whl

Download URL strands_postgres_storage-0.1.1-py3-none-any.whl
Size 2.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ac0d1859118c8cc66ea00c37bec43b52f66a7fffba83a8bd8f782ac82789af1
BLAKE2b-256 checksum
How to use checksums
e6571f65c2ed6aa1bcdaa771bef35035fdd6181c15659a10e220bd12c77bcadd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for strands-postgres-storage 0.1.1

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.1 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