Examples
Minimal Starter
The simplest m4trix setup: one agent, one request event, one response event, exposed as an SSE endpoint.
Location
Clone the repo and see:
examples/core-example/What It Does
- Defines
MessageEvent(request) and response events - Creates a single agent that echoes or processes the message
- Wires the agent to main → client channels
- Exposes the network as a Next.js API route
Run It
cd examples/core-example
pnpm install
pnpm devThen POST to http://localhost:3000/api/reasoning with a JSON body like {"request": "Hello"}.
Key Files
app/api/reasoning/events.ts— Event definitionsapp/api/reasoning/example-agent.ts— Agent logicapp/api/reasoning/network.ts— Network wiringapp/api/reasoning/route.ts— Next.js route + expose config