Preloading customer profile information into the session context provides the required balance between data availability, consistency, and retrieval efficiency.
The scenario establishes three important constraints: profile attributes must be available before the first interaction, their values remain unchanged during a session, and those values may change between sessions.
Option B meets these requirements by retrieving the relevant records from Lakebase during session initialization.
The agent stores the plan tier, region, and entitlement flags in a session-scoped context object. Because the object is available to every turn handler, subsequent interactions can reuse the information without executing additional database queries.
This eliminates repeated Lakebase round-trips and reduces both latency and database workload.
Option A introduces a shared cache that may return stale values when account information changes between sessions. Option C adds unnecessary database access to individual turns. Option D introduces periodic refresh operations despite the explicit guarantee that the values do not change during an active session.
Databricks supports stateful agent architectures through session management and Lakebase-backed persistence. Session-specific context is appropriate for information needed repeatedly within a single interaction.
The implementation should retrieve the profile using the authenticated user identity, perform initialization before processing the first turn, and create a fresh context object for each new session.
Official Databricks reference: Agent memory and sessions and Agent sessions.
────────────────────────────────────────────────────
Submit