Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.maximem.ai/llms.txt

Use this file to discover all available pages before exploring further.

await sdk.instance.stop_listening()
Advanced — for real-time integrations. Pair this with instance.listen and call it during shutdown (or in a finally block) so the stream is closed cleanly.
stop_listening() ends the bidirectional gRPC stream that listen() established, cancels the underlying transport, and clears the SDK’s reference to it. After this call returns, instance.is_listening is False and any subsequent instance.send_message calls raise ListeningNotActiveError. Calling stop_listening() when no stream is active is a safe no-op.

Parameters

This method takes no parameters.

Returns

Returns None.

Example

import asyncio
from maximem_synap import MaximemSynapSDK

sdk = MaximemSynapSDK(api_key="synap_your_key_here")
await sdk.initialize()

listen_task = asyncio.create_task(sdk.instance.listen())
try:
    await sdk.instance.send_message(
        content="Hello",
        user_id="user_789",
        conversation_id="conv_abc",
    )
finally:
    await sdk.instance.stop_listening()
    listen_task.cancel()

Raises

This method does not raise SDK errors under normal use. See Error Codes for the full SDK exception hierarchy.

See also