Streaming
m4trix uses Server-Sent Events (SSE) for streaming responses to clients. When an agent emits events to a channel with ansse() proxy, those events are streamed as SSE to the browser.
SSE Format
Streaming from Agents
Emit multiple events during an LLM stream:Proxies
Proxies declare how events leave a channel:proxy.sse()— Streams events as SSE to HTTP clientsproxy.kafka({ topic })— Publishes events to a Kafka topic
Adapters
Adapters expose the network as an HTTP API:- NextEndpoint — Next.js App Router (
GET/POSThandlers) - ExpressEndpoint — Express.js route handlers

