adk-artifact 0.1.8

Binary artifact storage for Rust Agent Development Kit (ADK-Rust) agents
Documentation

adk-artifact

Binary artifact storage for Rust Agent Development Kit (ADK-Rust) agents.

Crates.io Documentation License

Overview

adk-artifact provides binary data storage for the Rust Agent Development Kit (ADK-Rust):

  • InMemoryArtifactService - Simple in-memory artifact storage
  • Artifact Management - Store, retrieve, and list artifacts
  • MIME Types - Automatic content type handling
  • Versioning - Multiple versions per artifact

Artifacts are useful for storing images, documents, audio, and other binary data that agents produce or consume.

Installation

[dependencies]
adk-artifact = "0.1.8"

Or use the meta-crate:

[dependencies]
adk-rust = { version = "0.1.8", features = ["artifacts"] }

Quick Start

use adk_artifact::InMemoryArtifactService;

// Create artifact service
let service = InMemoryArtifactService::new();

// Store an artifact
let artifact = service.save_artifact(
    "app_name",
    "user_123",
    "session_456",
    "report.pdf",
    pdf_bytes,
).await?;

// Retrieve artifact
let data = service.load_artifact(
    "app_name",
    "user_123",
    "session_456",
    "report.pdf",
    None, // Latest version
).await?;

Use with LoadArtifactsTool

Artifacts integrate with agents via LoadArtifactsTool:

use adk_tool::LoadArtifactsTool;

let tool = LoadArtifactsTool::new(vec!["image.png", "document.pdf"]);

let agent = LlmAgentBuilder::new("assistant")
    .tool(Arc::new(tool))
    .build()?;

The LLM can then request artifacts to be loaded into context.

Features

  • Async storage and retrieval
  • Automatic MIME type detection
  • Version history support
  • Thread-safe concurrent access

Related Crates

License

Apache-2.0

Part of ADK-Rust

This crate is part of the ADK-Rust framework for building AI agents in Rust.