Memory
TouAI Memory provides project-scoped object storage through client.object_storage. Projects themselves are created and managed in the web console — the SDK stores and retrieves data inside them.
Permissions are enforced per project role: viewer reads, member writes, admin deletes. A project API key carries its project as the default context.
Simple API
Use the simple API when you want the key's project and default bucket resolved automatically.
stored = client.object_storage.store(open("data.csv", "rb"))
print(stored.key)
stored = client.object_storage.store_text(
'{"users": [{"name": "Alice"}]}',
"data.json",
)
files = client.object_storage.files(prefix="data/")
info = client.object_storage.file_info("data/file.csv")
url = client.object_storage.download_url("data/file.csv", expires_in=3600)
client.object_storage.delete_file("data/old.csv")
overview = client.object_storage.info()| Method | Return Type | Description |
|---|---|---|
store(file) | StoredObject | Upload a binary file |
store_text(content, filename) | StoredObject | Store text or JSON |
files(prefix=...) | list[StoredFile] | List files |
file_info(key) | FileInfo | Get file metadata |
download_url(key) | str | Get a pre-signed download URL |
delete_file(key) | None | Delete a file (project admin) |
info() | StorageInfo | Visible projects, buckets, and usage |
Project-Scoped API
client.object_storage.project(project_id) pins every call to one
platform project (the X-Project-Id header). Use it to target another
project your key can access, or for the full bucket/object surface.
Buckets
project = client.object_storage.project("proj_01H...")
buckets = project.buckets()
bucket = project.create_bucket("raw-data", description="Landing zone")
bucket = project.bucket(bucket.id)
project.update_bucket(bucket.id, description="Renamed")
project.delete_bucket(bucket.id) # project admin onlyObjects
project.upload(bucket.id, open("file.csv", "rb"), path="data/")
# Presigned direct-to-S3 upload: PUT the bytes yourself, then confirm
# so creator/time metadata and usage attribution are recorded.
signed = project.upload_signed_url(bucket.id, "reports/q1.pdf", "application/pdf")
# httpx.put(signed.url, content=data, headers={"Content-Type": "application/pdf"})
project.confirm(bucket.id, "reports/q1.pdf", content_type="application/pdf")
page = project.objects(bucket.id, prefix="reports/", delimiter="/", limit=100)
url = project.download(bucket.id, "reports/q1.pdf")
info = project.object_info(bucket.id, "reports/q1.pdf")
project.delete_object(bucket.id, "reports/q1.pdf") # project admin
project.bulk_delete(bucket.id, ["old1.csv", "old2.csv"]) # project adminFolders
folder = project.create_folder(bucket.id, "reports/2026/")
project.delete_folder(bucket.id, "reports/2026/") # deletes the subtree; admin onlyLarge-file upload
upload_large streams a local file directly from the SDK process to S3
over presigned URLs — bytes never pass through the service pod. It
auto-selects a single PUT for files under 5 GiB and S3 multipart
(64 MiB parts) for anything larger, aborting the session on failure so
partial bytes don't accumulate.
result = project.upload_large(
bucket.id,
"benchmarks/video.mp4",
key="raw/video.mp4", # optional; defaults to local filename
content_type="video/mp4", # optional; guessed from the path
part_size=64 * 1024 * 1024, # multipart-path only
)
print(result["key"], result["size"], result["etag"])The multipart primitives (multipart_initiate, multipart_sign_part,
multipart_sign_parts, multipart_complete, multipart_abort) are
also exposed on the project surface for custom resumable or parallel
flows.
The simple API (store, store_text, files, file_info,
download_url, delete_file, info) is available on the project
surface too, scoped to that project's default (or named) bucket.