strands-mongodb-storage
A MongoDB 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.
pip install strands-mongodb-storage
from strands.storage import Storage
from strands_mongodb_storage import MongoDBStorage
storage = MongoDBStorage("mongodb://localhost:27017")
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
One document per key: {_id: <key>, data: <BinData>} in a single collection (strands_storage.storage by default). An optional prefix= namespaces all keys. Blocking PyMongo calls run in a thread so the async interface never blocks the event loop.
License
MIT
Metadata
Release files for strands-mongodb-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)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| strands_mongodb_storage-0.1.1.tar.gz | 4.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| strands_mongodb_storage-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.3 kB
Release files / strands_mongodb_storage-0.1.1.tar.gz
| Download URL | strands_mongodb_storage-0.1.1.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
72cbaa686a4e9a8ad8fe7fe1df56c360dfc6261841e13ca9f7c123a4c207f7b8
|
|
BLAKE2b-256 checksum How to use checksums |
0f952134b349d4b4ca233f487b656ecd00e3319220f48d719ab0e645f136e9ca
|
| 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_mongodb_storage-0.1.1-py3-none-any.whl
| Download URL | strands_mongodb_storage-0.1.1-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e35d0794674dd3993a51d5b42c76701530bab6683cb62b595a4c4c0f7fd1d9b
|
|
BLAKE2b-256 checksum How to use checksums |
a4d5c5334f12afc5457b1a4675f455a7e7ffd90154ef12ad765a67bd9e52965a
|
| 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-mongodb-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.