MisarMisar Docs

Research Agent

Stream a multi-stage research agent over Server-Sent Events.

Authentication

GET /api/v1/agent/stream uses the same bearer key as the rest of the gateway: Authorization: Bearer <API_KEY>. Gateway base URL: https://api.misar.dev.

Exposes MisarCoder's research pipeline (plan → search → reflect → synthesize) as an SSE stream compatible with the @misar/research-agent AgentEvent protocol. Used by the Misar Code VS Code extension and by @misar/research-agent in coding mode.

GET/api/v1/agent/stream

Run the research agent and stream its progress events as text/event-stream.

Query parameters

querystringqueryrequired

The research question or task.

modestringquerydefault: research

Agent profile: chat, research, or coding.

maxCyclesintegerquery

Maximum reasoning cycles. Defaults by mode — chat: 1, research: 5, coding: 4.

sessionIdstringquery

Optional session id to continue a previous run.

Event stream

Each SSE data: line carries one JSON AgentEvent:

thinking{ stage, content }

Reasoning at a pipeline stage.

tool_call{ tool, input }

The agent invoked a tool.

tool_result{ tool, citations }

A tool returned results (with citations).

reflection{ covered, gaps }

Coverage reflection between cycles.

content{ delta }

Streamed answer text.

done{ result: { content, citations } }

Final synthesized answer.

error{ code, message }

An error terminated the run.

Request
curl -N "https://api.misar.dev/api/v1/agent/stream?query=Summarize%20recent%20RAG%20advances&mode=research" \
  -H "Authorization: Bearer $MISARCODER_API_KEY"
Event stream
data: {"type":"thinking","stage":"plan","content":"Decomposing the query..."}

data: {"type":"tool_call","tool":"web_search","input":{"query":"RAG advances 2026"}}

data: {"type":"tool_result","tool":"web_search","citations":[]}

data: {"type":"done","result":{"content":"Recent RAG advances include...","citations":[]}}

Status codes

  • 200 — Stream opened.
  • 400query is required, or mode is invalid (must be chat, research, or coding).
  • 401 — Missing or invalid API key.

On this page