Skip to content

Explore S3-compatible SDK file extension #2136

Description

@jezekra1

S3 Extension

Implement a new extension in agentstack-sdk that would use s3-compatible storage with the minimum supported functionality:

  • download file
  • upload file from agent

Create a PoC with python client and server using the new SDK extension:

  • Agent should accept a file, transform it (e.g. translate to different language) and send back the result
  • S3 Extension should be automatically scoped to upload and download on behalf of a user - this should prevent leaking files by accident

Explore two modes:

Pre-signed URL

  • Send file to agent -> use default File part from a2a-sdk with url=presigned url (native concept, nothing to extend)
  • Send file from agent -> use File part with url + a way to upload to a predefined location (pre-signed url for upload?). This would need to be specified in the communication - e.g. extra message meatadata {"file-extension-uri: {"upload-location: "http://s3-storage/context/123/files"}}
  • pre-signed url timeout needs to be addressed for longer conversations - send new url with each message?

Persistent credentials for upload/download

  • Send file to agent -> use default File part from a2a-sdk with url=custom id, for example http://files/context/123, the extension would for example define that you can get files using connection specified by agent env variables (access/secret key, s3 endpoint)
  • Send file from agent -> use File part with url=http://files/context/123/result.txt
  • Advantage of this method is that credentials don't expire contrary to the pre-signed urls.

Optional identity

If user identity is required, pass it from the client:

  • this can be proper OIDC token obtained through keycloak after a user login flow (implemented in CLI, would require new OIDC auth middleware in agent)
  • or it can be just a dummy "user-id", the point is to demonstrate end-to-end that files are stored and isolated per user

dev s3

For development you can use seaweedfs from the platform in dev mode mise run agentstack-server:dev:start will make seaweed available localy at the url http://seaweedfs-all-in-one:9009, ui at http://seaweedfs-all-in-one:8888, or just spin minio in docker for example

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions