userID and sessionID. They support multi-turn context, tool-call history, and event recovery.
Minimal Runner Example
For local development, use ADK Go’ssession.InMemoryService(). Reusing the same userID and sessionID gives the agent access to the same conversation history.
context.Context controls cancellation, deadlines, and request-scoped values. It is not the conversation context. Conversation state comes from userID, sessionID, and ShortTermMemory / SessionService.
Persistent Short-Term Sessions
session.InMemoryService() is fine for examples and single-process debugging, but data disappears when the process exits. Production deployments should use persistent storage. VeADK Go provides the NewShortTermMemoryService entry point:
When
config is nil, VeADK reads the matching database config from the global config. Pass the backend-specific config struct when you need explicit settings.
App Integration
When using a VeADK Go app launcher,apps.RunConfig.ShortTermMemory is an alias for SessionService. It uses the same session concept as direct Runner usage.
Multi-Turn Rules
Reuse the same
userID and sessionID for multi-turn conversations. A different sessionID starts a new conversation. A different userID should be treated as a different user context even when the session ID string is the same.
Session versus Long-Term Memory
They can be configured together. Short-term sessions keep one conversation continuous. Long-term memory lets separate conversations recall important information.