v8

latestOpenAPI 3.1.0Apache-2.0raw.githubusercontent.com2026-05-1633352.9 KB
Plan

Open a plan; stream SSE of the orchestration.

Accepts a user question + agent catalog, starts (or resumes) a session, and streams Server-Sent Events as the planner runs.

Session continuation (stateless model — Path A)

The gateway no longer owns durability. Each /plan call is its own ephemeral session: pass prior turns in history and the latest compaction summary (if you have one) in prior_summary. The client is the canonical record; the gateway is pure compute.

session_id is now just a correlation tag echoed back on the first SSE frame — it doesn't index a server-side store. The durable conversation lives in your application (in the Bindu reference frontend, that's comms's SQLite events log).

Compaction-summary sidechannel

When the planner compacts overflowing history, it emits an event: compaction-summary SSE frame mid-stream. Clients should persist the summary field locally and ship it back as prior_summary on the next call so the planner keeps the compacted context across requests.

Catalog immutability per request

The agents catalog applies to a single /plan call. Each request is independent — there's no first-plan / subsequent- plan distinction in stateless mode.

Streaming & abort

Closing the HTTP connection aborts the plan — in-flight A2A calls receive an AbortSignal and the planner loop terminates. Clients that want a partial result should buffer text.delta frames client-side rather than relying on final.

post/plan

Request body

questionstring required

The user's natural-language question. Non-empty — an empty string is rejected upstream because some LLM providers (Anthropic) reject empty user messages with a 400 mid-stream, surfacing as a vague "Provider returned error". Validating here gives a clean 400 with invalid_request instead.

session_idstring

Opaque correlation tag the caller chooses. Echoed back on the first SSE session frame as external_session_id. In the stateless gateway this is NOT a resumption key — the gateway has no persistent session store. Pass prior turns explicitly via history (and optionally a prior_summary) to give the planner context across calls.

prior_summarystring

Compaction summary the gateway emitted on a prior call, persisted by the client. The planner sees it as a synthetic user turn at the head of history: "[Prior session context, compacted]\n\n...". Omit on first call.

Example request

{
  "question": "Summarize the latest quarterly results for Apple.",
  "agents": [
    {
      "name": "research",
      "endpoint": "http://localhost:3773",
      "auth": {
        "envVar": "PEER_A_TOKEN"
      },
      "trust": {
        "pinnedDID": "did:bindu:research-agent-key-1"
      },
      "skills": [
        {
          "id": "search",
          "description": "Search the open web and return a ranked list of passages.",
          "outputModes": [
            "text/plain",
            "application/json"
          ],
          "tags": [
            "research",
            "web"
          ]
        }
      ]
    }
  ],
  "preferences": {
    "timeout_ms": 1800000,
    "max_steps": 8
  },
  "session_id": "client-session-42",
  "prior_summary": "[Prior session context, compacted]\n\nUser asked about Apple Q3 earnings; planner ran research_agent.search then summarizer.summarize…"
}

Response

SSE stream of the plan. Each event is one of the types documented under SSEEvent below. The stream closes after event: done.

All 3 operations