From adk-sessions-memory
Use this skill to handle artifacts (files, images, PDFs, audio, blobs) in ADK 2.0 agent sessions — store, retrieve, attach to events, and pass between agents. Triggers on: "ADK artifacts", "ADK file upload", "attach image to ADK agent", "ADK binary output", "store PDF in ADK session", "agent file handling", "ArtifactService ADK". Generates code using ArtifactService to save_artifact / load_artifact and reference artifacts from agent events.
How this skill is triggered — by the user, by Claude, or both
Slash command
/adk-sessions-memory:artifact-handlerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
ADK 2.0 separates large/binary content from session events via the ArtifactService. Use it for files, images, audio, and other non-text payloads.
ADK 2.0 separates large/binary content from session events via the ArtifactService. Use it for files, images, audio, and other non-text payloads.
Session ──┬── events (text, tool calls, references)
└── artifacts (blobs, stored separately)
Events stay small; artifacts are loaded on-demand by version.
from google.adk.artifacts import InMemoryArtifactService
from google.adk.runners import Runner
from google.adk.agents import LlmAgent
artifact_service = InMemoryArtifactService()
runner = Runner(
agent=root_agent,
artifact_service=artifact_service,
)
from google.adk.tools import ToolContext
async def generate_chart(data: list, ctx: ToolContext) -> dict:
"""Generate a PNG chart from data and store as an artifact."""
import matplotlib.pyplot as plt, io
fig, ax = plt.subplots()
ax.plot(data)
buf = io.BytesIO()
fig.savefig(buf, format="png")
buf.seek(0)
artifact_id = await ctx.save_artifact(
filename="chart.png",
content=buf.read(),
mime_type="image/png",
)
return {"artifact_id": artifact_id, "filename": "chart.png"}
async def annotate_chart(artifact_id: str, ctx: ToolContext) -> dict:
"""Load a chart artifact and add annotations."""
art = await ctx.load_artifact(artifact_id)
# art has: bytes, mime_type, filename, version, created_at
annotated = add_annotations(art.bytes)
new_id = await ctx.save_artifact(
filename="chart_annotated.png",
content=annotated,
mime_type="image/png",
)
return {"artifact_id": new_id}
from google.adk.artifacts import GcsArtifactService
artifact_service = GcsArtifactService(
bucket_name="my-adk-artifacts",
project="my-project",
)
Stores artifacts in GCS; URLs signed on demand.
Saving the same filename twice creates a new version. List versions:
versions = await artifact_service.list_artifact_versions(
session_id=session.id,
filename="chart.png",
)
session-migrate — artifacts migrate alongside sessions when using export_sessionCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub healthcare-ai-consulting-llc/adk-2-toolkit --plugin adk-sessions-memory