Skip to main content

strands-sql-storage

A SQL (SQLAlchemy) implementation of the Strands Agents unified Storage interface — durable bytes-under-string-keys that backs session snapshots, context offloading, memory stores, and anything else that consumes strands.storage.Storage. One provider for any SQLAlchemy-supported database (SQLite, PostgreSQL, MySQL, …), selected purely by connection URL.

pip install strands-sql-storage
from strands.storage import Storage
from strands_sql_storage import SQLStorage

storage = SQLStorage("postgresql://user:pass@localhost/db")   # or engine=<Engine>
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

Implements the four Storage operations over opaque bytes:

Method Behaviour
write(key, data) Upsert bytes under a /-separated key
read(key) Return the bytes, or None if the key is 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 BLOB), created automatically. An optional prefix= namespaces all keys within the table. Blocking SQLAlchemy calls run in a thread so the async interface never blocks the event loop.

License

MIT

Metadata

Release files for strands-sql-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-sql-storage 0.1.1
File Size Uploaded Provenance
strands_sql_storage-0.1.1.tar.gz 4.9 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 9.1 kB

Release files / strands_sql_storage-0.1.1.tar.gz

Download URL strands_sql_storage-0.1.1.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2382c121bd9f2a6ca47b1ff12e8a9a52344ccadf67cfccbaeafd3daee1f1b9d8
BLAKE2b-256 checksum
How to use checksums
ade68d2b3fbe6ba4bd8552473c2cbc4c2ba95374c90bd9a1cdec76ce2d6ac049
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_sql_storage-0.1.1-py3-none-any.whl

Download URL strands_sql_storage-0.1.1-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5ff9aa50c46e2855bedf4d9b00f4395e6831ae893f333654f6f2351d443f660
BLAKE2b-256 checksum
How to use checksums
f22fcd25929daa6976c791541e7da0d1a6464657f087367d788ab3ff3e13e5e5
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-sql-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