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
/registerAgentRegister a new agent with its capabilities and callback URL.
{ "agentId": string, "capabilities": string[], "callbackUrl": string }{ "success": true, "registeredAt": "ISO8601" }POST
/routeTaskRoute a task to an agent that matches the target capability.
{ "taskId": string, "payload": any, "targetCapability": string }{ "routed": boolean, "agentId"?: string, "error"?: string }GET
/state/:agentIdRetrieve the current state for an agent.
{ "state": any }POST
/state/:agentIdOverwrite the state for an agent.
{ "state": any }{ "updated": true }POST
/transformTransform a payload - return as-is or base64-encoded.
{ "payload": any, "transformer": "json" | "base64" }json → payload
base64 → { "transformed": string }Interactive Demo
Try each endpoint live. Results appear at the bottom of this section.
Sample Script
Open the console and load /sample-tasks.js to run a demonstration of all endpoints.
$ node public/sample-tasks.js