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.
Advanced — for real-time integrations. Requires an active
instance.listen stream. If the stream is not active, this call raises ListeningNotActiveError.send_message() publishes a single agent activity event onto the bidirectional gRPC stream that listen() established. Each event tells the Synap platform what just happened in your agent — a user turn, an assistant reply, a tool call, or an explicit context request — so the platform can anticipate what context the agent will need next and push it back over the stream.
Parameters
The message content. For
user_message and assistant_message events this is the natural-language turn; for tool_call events it can be a short description of the tool invocation.Either
"user" or "assistant".External identifier for the conversation this event belongs to. Required to associate the event with the right conversation scope.
External user identifier. Omit for customer- or client-scope events.
External customer identifier.
External session identifier.
The kind of event being reported. Common values:
user_message, assistant_message, tool_call, context_request.Additional string key-value metadata attached to the event.
For
tool_call events — the name of the tool the agent is invoking. The platform uses this to classify the tool call and anticipate the agent’s next data needs.For
tool_call events — a JSON-encodable arguments dict for the tool invocation.For
tool_call or context_request events — the retrieval queries the agent plans to run. Used as direct anticipation hints.For
tool_call or context_request events — the memory categories the agent plans to fetch.Returns
ReturnsNone. The coroutine resolves once the event has been written to the stream.
Example
Raises
ListeningNotActiveError— wheninstance.listenhas not been called or the stream has been closed.
See also
- instance.listen — open the stream this method writes to.
- instance.stop_listening — close the stream.