Conversation state
By default the agent server encrypts a conversation's state and stores the ciphertext in Search2o Cloud. With these three hooks, the state is stored by your own code instead and never leaves your organization. The three are set together, or none of them.
| Hook | When it is called | The dict holds |
|---|---|---|
saveSave conversation state | When a run ends successfully or pauses on an ask, in place of storing the state in the cloud. | convid, state, the state as a JSON string, userEmail, agentName and isValidation. |
restoreRestore conversation state | When a follow-up request continues the conversation, and when the GUI opens a past conversation. It returns the string that save stored, or None when there is none, which ends the conversation as expired. | convid, userEmail and isValidation. |
deleteConversationDelete conversation state | When a user deletes the conversation. | convid and isValidation. |
Three things follow from storing the state yourself. The agent server hands save the state in plain form, and you are free to encrypt it before storing it. Search2o Cloud does not check who continues a conversation whose state your code holds; restore receives userEmail so that your code can check that the conversation belongs to that person. And deleting stored state is your decision: the agent server calls deleteConversation when a user deletes a conversation, and expires nothing else. The cloud keeps the conversation's entry, the encrypted title and the time of the last run, and applies the plan's retention to that entry, so an unpinned conversation still leaves the conversation list after 7 days on the Free plan and 90 days on Paid. Validation runs keep their state in the cloud, whatever the hooks. See Conversation state.

