Session state helps an agent hold a conversation. Customer records establish longer-lived facts and commitments. Copying everything from one into the other can preserve guesses, leak client context, or lose work when a process ends.
LiveKit's job-lifecycle guide describes loading application-specific data for a job and passing contextual information. That does not make room metadata or conversation history your customer system of record. Design the durable boundary explicitly.
Classify the state before choosing storage
Temporary state includes a candidate appointment, a partially heard address, or a question waiting for clarification. Durable business state includes verified identity references, authorized requests, accepted policy versions, remote results, and owned follow-up.
Store only the context the session needs and enforce client scope during retrieval. A matched phone number can identify candidates without establishing authority to overwrite a customer's address or cancel a visit.
Work through a fictional address correction
A caller first says 14 Oak Street, then corrects it to 41. During the conversation, both values may appear in working context. Only the final confirmed service property should enter the approved request, with uncertainty preserved if confirmation fails.
The customer's master address should change only through the separate authorized update policy. A service request at another property is not necessarily a correction to the customer's profile.
| State example | Proposed handling |
|---|---|
| Partly heard address | Temporary uncertain value |
| Confirmed service property | Request context with verified reference |
| Caller suspects a fault | Reported statement, not diagnosis |
| Approved booking intent | Durable action record |
| Remote appointment identifier | Verified outcome evidence |
Make commits intentional
Define which fields can be written, their verification requirements, and the operation that makes them official. Keep before-and-after evidence for consequential changes under the data policy. Avoid automatically dumping an entire chat summary into structured customer fields.
A separate durable model adds mapping work but supports recovery and review. Using session context as the only record is faster to prototype while making restarts and post-call reconciliation fragile. A narrow first release can persist requests and let staff approve master-data changes.
Test two concurrent calls for the same customer and ensure one session cannot silently overwrite another's confirmed update. Review customer detail collection for readback and corrections.
Questions about session state
Should a returning caller inherit the previous conversation?
Only through an approved retrieval policy with current identity and purpose. Do not reuse old context indiscriminately.
Is metadata a substitute for authorization?
No. Validate trusted client and account context at the action boundary regardless of where a value was stored.
What survives a session ending?
The durable records your application has successfully persisted. Operators should be able to recover customer actions without depending on a live conversation process.