Agentic infrastructure
Event-driven agent orchestration. Type-safe events, channels, sinks. @m4trix/core/matrix. Build, wire, stream.
Agent network
↓ events
↓ sink
↓ SSE
Most frameworks make you draw a graph before you write a line of code. m4trix doesn't.
Agents declare what events they care about. The network figures out the rest at runtime.
The six primitives below compose into any topology — a linear chain, a fan-out, a multi-tenant swarm. You never redraw a graph when requirements change; you change which channel an agent subscribes to.
Write a typed async function. Tell the factory which events trigger it and which it can emit. No base class, no decorator, no node to register — just logic and a schema.
AgentFactory.run().listensTo([evt]).logic(fn).produce({})coresetup() is the only wiring ceremony. Subscribe an agent to a channel, tell it where to publish. Chain, fan-out, fork — always the same two lines.
AgentNetwork.setup(({ registerAgent }) => …)coreThe payload you emit in AgentA is the typed triggerEvent in AgentB. Effect Schema validates every handoff at runtime — a schema mismatch fails loudly, not silently in production.
AgentNetworkEvent.of('request', S.Struct({…}))typesafeCall .expose() on a network and you have a streaming HTTP endpoint. The Next.js adapter is a one-liner. Your frontend reads a Server-Sent Events stream, not a polling loop.
NextEndpoint.from(network.expose({…})).handler()streamChannels are named message buses. Swap an httpStream sink for Kafka without touching a single agent. The agent doesn't know — or care — where its events go.
createChannel('client').sink(sink.httpStream())infrauseConversation() manages SSE state in React. Pump chains transforms over streams. AiCursor renders a live typing indicator. Nothing to assemble separately.
@m4trix/core | @m4trix/stream | @m4trix/reactecosystem