gadk-session
Sessions and events for gadk: the data model a runner reads and writes as an agent converses, and the storage interface behind it.
SessionServiceis the async storage trait (create,get,list,delete,append_event);Sessionis one conversation (its ID, app, user,Stateand ordered events).InMemorySessionServiceis the in-process implementation. Persistent implementations live ingadk-session-database(relational databases) andgadk-vertexai(Vertex AI Agent Engine).Eventis one interaction: a model response plus author, invocation ID, timestamp andEventActions(state delta, artifact delta, agent transfer, escalation, compaction).- Session state keys are scoped by prefix:
app:(shared by every user of an app),user:(shared by a user's sessions) andtemp:(dropped after the current invocation). compactionsummarizes older events so the prompt stays small as a conversation grows;toolauthholds the auth data model (Scheme,Credential,Config) in the JSON format ADK clients exchange;state_utilhas helpers shared bySessionServiceimplementations.
Most applications reach these types through the gadk facade (gadk::session, and
gadk::compaction) and only depend on this crate directly to implement a SessionService.
Example
use ;
use json;
let service = new;
let mut state = new;
state.insert;
let session = service
.create
.await?;
let again = service
.get
.await?;
assert_eq!;
Features
testsuite: thetestsuitemodule, a reusable conformance suite forSessionServiceimplementations.