SDK

SDK foundation

Use the hosted reply API from an agent product that controls its own chat UI.

Persona reply API

curl -X POST https://orkestrate.space/api/v1/personas/reply \
  -H "Authorization: Bearer ork_mcp_..." \
  -H "Content-Type: application/json" \
  -d '{
    "handle": "keiyara",
    "message": "I am here.",
    "host": { "app": "Spreadjam", "surface": "AI Citation Report" },
    "environment": { "context": { "citationGaps": 6 } }
  }'

Response

{
  "persona": {
    "id": "per_...",
    "handle": "keiyara",
    "name": "Keiyara",
    "avatarUrl": null
  },
  "finalText": "Yep, I am here with you...",
  "traceId": "trc_...",
  "memory": {
    "mode": "suggested",
    "suggestions": []
  }
}

Host app flow

  1. Detect @keiyara or a persona selector state.
  2. Call the reply API with user token, message, thread, and environment.
  3. Render finalText as Keiyara.
  4. Leave the default host agent unchanged for normal turns.

Future SDK shape

const mention = orkestrate.detectMention(message);

if (mention) {
  const reply = await orkestrate.personas.reply({
    userToken,
    handle: mention.handle,
    message: mention.message,
    environment,
  });

  renderPersonaMessage(reply);
} else {
  runNormalHostAgent();
}