Yoke

HTTP server

Serve the runtime over HTTP, Express-style.

runtime.serve({ port }) starts the runtime and serves it over HTTP.

const server = await runtime.serve({ port: 3000 });

Endpoints

MethodPathWhat it does
POST/api/eventsPublish an event to the bus
POST/api/agents/:name/messagesSend a message to an agent instance
GET/api/healthLiveness
GET/api/eventsList registered event definitions
GET/api/agentsList registered agent definitions
GET/api/actorsList registered actor definitions
GET/api/toolsList registered tools

The reference pattern: message in, agent out

  1. A client POST /api/events with { topic: "messages.incoming", payload }.
  2. An actor subscribes to messages.incoming, filters, and forwards the payload to an agent via sendMessage.
  3. The agent processes it and replies; the reply is itself an event (or a response to the originating request).
curl -X POST http://localhost:3000/api/events \
  -H 'content-type: application/json' \
  -d '{
    "topic": "messages.incoming",
    "type": "user.message",
    "source": "curl",
    "payload": { "text": "hello from curl" }
  }'

Send a message directly to an agent instance:

curl -X POST http://localhost:3000/api/agents/assistant/messages \
  -H 'content-type: application/json' \
  -d '{ "text": "What is the weather in Mumbai?" }'

On this page