Spokes.wiki Search About
Tech Article source ↗ source url updated Thu Jun 18 2026 00:00:00 GMT+0000 (Coordinated Universal Time)

ADK Sessions docs

Google ADK’s reference page for Session, State, and Events — the concrete persistence machinery under this spoke’s durable-agents thread, beyond the blog-level treatment in adk-long-running-agents.

The Session object

A Session (google.adk.sessions.Session) is the container for one conversation thread. It carries an id, app_name, userId, a lastUpdateTime, an events field holding “a chronological sequence of all interactions (Event objects — user messages, agent responses, tool actions),” and a state field that serves as “a scratchpad for the agent during the interaction.” The split between durable state and replayable events is exactly the “separate workflow state from conversation history” move durable-agents names.

The persistence tiers

Three SessionService implementations trade off durability:

  • InMemorySessionService — stores everything in process memory; data is “lost if the application restarts.” For development and testing.
  • DatabaseSessionService — connects to PostgreSQL / MySQL / SQLite for persistent storage, with “row-level locking (via SELECT ... FOR UPDATE)” for concurrent safety, and async drivers (sqlite+aiosqlite).
  • VertexAiSessionService — managed persistence via Google Cloud Agent Runtime.

The resume mechanism

Progress is saved by “Appending new interactions (Event objects) to a session’s history,” which is also “the mechanism through which session state gets updated”sessionService.append_event(session, event). A crash resumes from the last persisted event, the checkpoint primitive behind multi-week durable runs.

Tier T1 — vendor documentation. Cited by durable-agents.