Skip to content

Memory and artifact docs have no Go coverage of Memory Bank, GCS artifacts or metadata #2379

Open

Description

@karolpiotrowicz

The Memory page documents Memory Bank for Python and Kotlin only, and its comparison table opens with "The Python ADK ships three MemoryService implementations". The Artifacts page has a Go tab for the in-memory artifact service but not for the Cloud Storage one, and shows custom artifact metadata only in one Python sentence. ADK Go v2.5.0 has a Memory Bank service, a Cloud Storage artifact service and artifact custom metadata, so Go developers moving from local development to Google Cloud find only the in-memory services in the docs. Code links below point to ADK Go v2.5.0.

Memory Bank with memory/vertexai.NewService

vertexai.NewService in the memory/vertexai package returns a memory.Service backed by Vertex AI Agent Engine Memory Bank. Its ServiceConfig embeds AgentEngineData (ProjectID, Location, ReasoningEngine) and has WaitForCompletion and StateKeySessionLastUpdateTime. When StateKeySessionLastUpdateTime is set, the service reads a time.Time from that session state key and generates memories only from events after it. When it is empty, the whole session is used.

This is the only managed, persistent memory service in ADK Go, and without docs Go developers assume the in-memory service is the only option. The Go service implements AddSessionToMemory and SearchMemory only, with no equivalent of Python's direct add_memory ingestion, so Go docs text has to stay within those two methods. The doc comment on StateKeySessionLastUpdateTime says the state value should be set as early as possible, for example in a before-run callback.

This belongs in Memory Bank and its Configuration subsection, and the comparison table sentence needs to cover Go. Documented for Python and Kotlin in the same section.

Cloud Storage artifacts with gcsartifact.NewService

gcsartifact.NewService(ctx, bucketName, opts...) returns an artifact.Service that stores each artifact version as a separate Cloud Storage object. Credentials and other client settings are passed as option.ClientOption values. Save assigns the next version number with a write precondition and retries with jittered backoff when a concurrent writer takes the same version. After 16 attempts it returns an error wrapping gcsartifact.ErrVersionConflict, which callers test with errors.Is and can safely retry.

This is the only persistent artifact backend in ADK Go. The versioning bullet in the GcsArtifactService section describes only Python's save_artifact.

This belongs in GcsArtifactService and its versioning bullet. Documented for Python, TypeScript, Java and Kotlin in the same section.

Artifact custom metadata

artifact.SaveRequest.CustomMetadata attaches key-value metadata to a saved artifact version, and artifact.ArtifactVersion.CustomMetadata, returned by GetArtifactVersion, reads it back. Both the in-memory and Cloud Storage services support it, and the Cloud Storage service writes it as object metadata.

Metadata lets a Go developer tag artifacts with a source, owner or content hash without encoding them in file names. Go stores every value as its string form (through fmt.Sprint) and always returns a non-nil map of strings, so a number or struct saved as metadata comes back as a string. Any Go docs text needs to say that.

This belongs in the Go tab of Saving Artifacts and the version metadata bullet, which mentions custom metadata for Python only.

  • Add a Go tab for Memory Bank with memory/vertexai.NewService, and cover Go in the comparison table
  • Add a Go tab for gcsartifact.NewService, including ErrVersionConflict
  • Document artifact CustomMetadata for Go, including the string conversion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions