Expand description
§adk-session
Session management and state persistence for ADK agents.
§Overview
This crate provides session and state management:
InMemorySessionService- Simple in-memory session storageVertexAiSessionService- Vertex AI Session API backend (vertex-sessionfeature)Session- Conversation session with state and eventsState- Key-value state with typed prefixesSessionService- Trait for custom session backends
§Quick Start
use adk_session::InMemorySessionService;
let service = InMemorySessionService::new();
// Sessions are created and managed by the Runner
// State is accessed via the session§State Prefixes
ADK uses prefixes to organize state:
| Prefix | Constant | Purpose |
|---|---|---|
user: | KEY_PREFIX_USER | User preferences |
app: | KEY_PREFIX_APP | Application state |
temp: | KEY_PREFIX_TEMP | Temporary data |
Re-exports§
pub use event::Events;pub use inmemory::InMemorySessionService;pub use service::AppendEventRequest;pub use service::CreateRequest;pub use service::DeleteRequest;pub use service::GetRequest;pub use service::ListRequest;pub use service::SessionService;pub use session::KEY_PREFIX_APP;pub use session::KEY_PREFIX_TEMP;pub use session::KEY_PREFIX_USER;pub use session::Session;pub use state::ReadonlyState;pub use state::State;pub use state_utils::extract_state_deltas;pub use state_utils::merge_states;
Modules§
- event
- inmemory
- migration
- Lightweight, embedded migration runner for SQL-backed session services.
- service
- session
- state
- state_
utils - Shared state utility functions for session backends.
Structs§
- Event
- Event represents a single interaction in a conversation. This struct embeds LlmResponse to match ADK-Go’s design pattern.
- Event
Actions