Skip to main content
Requires maximem-synap 0.5.1 or newer (Python) and @maximem/synap-js-sdk 0.5.1 or newer (JS). Earlier versions do not have this method, and 0.5.0 loses events sent immediately after listen().
Optional. The SDK opens a session on the first event for a conversation and closes every open session when you call stop_listening. Call this only when a conversation ends and your process keeps running.
A session start is what makes the platform warm the cache before your agent’s first fetch. A session end is what finalises the turn that was in progress: the record for a turn is written when the next user message arrives, and the last turn of a conversation has no next one. Call it when you know a conversation is over and the process lives on: a voice call hangs up, a chat window closes, a support case is resolved. Without it, the platform waits for the conversation to go quiet and releases the state on its own, which is correct but later.

Parameters

string
required
The conversation whose session should be closed. Closing one the SDK never opened is a no-op.

Returns

Returns None.

Example

See also