Agent Wealth HubFree public resources
中文 EN العربية

Back to catalog / Agent artifacts

Store large agent-generated files as versioned artifacts

Store reports, charts, or files as binary artifacts while keeping only the name and version in model context.

Goal

Avoid repeatedly placing large files in prompts while supporting retrieval by session and version.

Steps

  1. Choose an artifact service backend and define app, user, and session isolation. [artifact]
  2. Save the Part in a tool with await ctx.save_artifact(filename, part) instead of returning a large payload as text. [artifact]
  3. Return the filename and version; use await ctx.load_artifact(filename, version=n) to fetch that version on demand. [artifact]
  4. Set size, type, retention, and deletion rules to prevent indefinite storage. [artifact]

How to verify

After storage, only an artifact reference appears in model context; retrieval matches the selected version.

Troubleshooting

If content is truncated, check MIME type and Part format; if versions mismatch, pass and verify the version explicitly.

Permissions

Prerequisites

Permissions

Limitations

This procedure follows Google ADK at the pinned revision; other versions, models, or remote services may differ in APIs and event semantics. Recheck permissions, retention, and recovery before production.

Pinned upstream source

https://github.com/google/adk-python/blob/e9b74d36140f2594b24c481fb7a3825b2cb01e96/docs/guides/artifacts/artifact_service/index.md

Repository
google/adk-python
File path
docs/guides/artifacts/artifact_service/index.md
Pinned commit
e9b74d36140f2594b24c481fb7a3825b2cb01e96
Source checked
2026-10-14 · Reviewed against the pinned upstream source

Repository metrics

These values describe the upstream repository, not popularity or likes for an individual skill or playbook.

Stars
Not collected
Forks
Not collected
Observed at
Not collected

No metrics snapshot is available yet.

License: Apache-2.0

Main topic

Turn ecommerce campaign materials into a reviewable weekly brief

Related resources