Skip to main content

Crate adk_managed

Crate adk_managed 

Source
Expand description

§adk-managed

Managed agent runtime for ADK-Rust — a provider-neutral, durable, resumable agent execution engine.

§Overview

adk-managed provides the ManagedAgentRuntime trait and its default implementation. It takes a declarative ManagedAgentDef, builds a runnable agent, and operates it as a durable, resumable, event-streaming background session. The runtime composes existing shipping components behind a unified lifecycle trait.

§Architecture

The runtime is a library, not a service. The platform hosts it. This means:

  • Testable in isolation: Zero HTTP/auth/billing dependencies
  • Embeddable: Self-hosted deployments use the same runtime trait directly
  • Swappable platform: Different platforms can host the same runtime
  • Provider-neutral: Identical event sequences regardless of model provider

§Quick Start

use adk_managed::types::ManagedAgentDef;

// Define an agent declaratively
let def = ManagedAgentDef {
    name: "my-agent".to_string(),
    model: ModelRef::Shorthand("gemini-2.5-flash".to_string()),
    system_prompt: "You are a helpful assistant.".to_string(),
    // ...
};

Re-exports§

pub use agent_builder::BuildError;
pub use agent_builder::ManagedBuiltinTool;
pub use agent_builder::ManagedCustomTool;
pub use agent_builder::build_agent;
pub use checkpoint::CheckpointManager;
pub use checkpoint::RunState;
pub use default_runtime::DefaultManagedAgentRuntime;
pub use event_mapping::RunnerOutput;
pub use event_mapping::ToolKind;
pub use event_mapping::custom_tool_use_id;
pub use event_mapping::map_runner_output;
pub use event_mapping::requires_parking;
pub use parking::ToolParkingLot;
pub use replay::create_event_stream;
pub use replay::get_seq;
pub use resolver::DefaultModelResolver;
pub use resolver::ModelResolver;
pub use resolver::ResolverError;
pub use resolver::ResolverResult;
pub use runtime::AgentHandle;
pub use runtime::EnvironmentConfig;
pub use runtime::ManagedAgentRuntime;
pub use runtime::SessionHandle;
pub use schema_normalization::normalize_for_provider;
pub use schema_normalization::representative_mcp_schema;
pub use sequence::SequenceCounter;
pub use session_loop::SessionLoop;
pub use testing::ScriptedLlm;
pub use testing::ScriptedToolCall;
pub use testing::ScriptedTurn;
pub use usage::SessionUsageTracker;
pub use usage::UsageReport;

Modules§

agent_builder
Agent builder — constructs a runnable agent from a ManagedAgentDef.
checkpoint
Checkpoint management for durable sessions.
default_runtime
Default implementation of the ManagedAgentRuntime trait.
event_mapping
Provider-neutral event mapping from Runner output to SessionEvent.
parking
Custom tool parking lot for the managed agent runtime.
replay
Event replay for SSE Last-Event-ID reconnection.
resolver
Model resolution — maps a ModelRef to a live Arc<dyn Llm>.
runtime
Core trait and handle types for the managed agent runtime.
schema_normalization
Schema normalization for cross-provider MCP tool compatibility.
sequence
session_loop
Supervised session loop for the managed agent runtime.
testing
Testing utilities for the managed agent runtime.
types
Wire types for the managed agent runtime.
usage
Uniform usage reporting across all providers.