SME Agent Middleware

Lightweight JSON-over-HTTP middleware for multi-agent orchestration. Register agents, route tasks, manage state, and transform payloads.

API Reference

All endpoints accept and return application/json.

POST/registerAgent

Register a new agent with its capabilities and callback URL.

Request

{ "agentId": string, "capabilities": string[], "callbackUrl": string }

Response

{ "success": true, "registeredAt": "ISO8601" }
POST/routeTask

Route a task to an agent that matches the target capability.

Request

{ "taskId": string, "payload": any, "targetCapability": string }

Response

{ "routed": boolean, "agentId"?: string, "error"?: string }
GET/state/:agentId

Retrieve the current state for an agent.

Response

{ "state": any }
POST/state/:agentId

Overwrite the state for an agent.

Request

{ "state": any }

Response

{ "updated": true }
POST/transform

Transform a payload - return as-is or base64-encoded.

Request

{ "payload": any, "transformer": "json" | "base64" }

Response

json → payload
base64 → { "transformed": string }

Interactive Demo

Try each endpoint live. Results appear at the bottom of this section.

POST/registerAgent

Register Agent

POST/routeTask

Route Task

POST/state/demo-agent

Set Agent State

GET/state/demo-agent

Get Agent State

POST/transform

Transform Payload

Sample Script

Open the console and load /sample-tasks.js to run a demonstration of all endpoints.

$ node public/sample-tasks.js