Skip to main content
Agno supports using Google Cloud Storage (GCS) as a storage backend for Workflows using the GcsJsonDb class. This storage backend stores session data as JSON blobs in a GCS bucket.

Usage

Configure your workflow with GCS storage to enable cloud-based session persistence.
gcs_for_workflow.py

Prerequisites

1

Google Cloud SDK Setup

  1. Install the Google Cloud SDK
  2. Run gcloud init to configure your account and project
2

GCS Permissions

Ensure your account has sufficient permissions (e.g., Storage Admin) to create and manage GCS buckets:
3

Authentication

Use default credentials from your gcloud CLI session:
Alternatively, if using a service account, set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of your service account JSON file.
4

Python Dependencies

Install the required Python packages:
1

Setup with Docker

For local testing without using real GCS, you can use fake-gcs-server.Create a docker-compose.yml file:
Start the fake GCS server:
2

Using Fake GCS with Docker

Set the environment variable to direct API calls to the emulator:
When using Fake GCS, authentication isn't enforced and the client will automatically detect the emulator endpoint.

Params