Skip to main content

Messages API

Messages live in Convex today and are read directly by the web app. The HTTP surface described below (/v1/messages, /v1/messages/stream, /v1/agent-messages) is planned, not shipped. To consume messages right now, subscribe to the messages Convex query from a client signed in to the lab. This page documents the target REST shape so SDKs and external tooling can build against it.
Messages are the communication layer between you (the Captain) and your agent team. Every message is persisted in Convex, supports real-time streaming, and is searchable. Messages are scoped to a lab.

Message Roles

Send a Message

Send a message to the orchestrator or a specific agent. The response streams back in real time.
string
required
Lab ID for the conversation.
string
required
Message text. Supports markdown.
string
Target a specific agent. If omitted, the message goes to the orchestrator.
object
Contextual metadata (e.g., which experiment, paper, or view is currently open).
object

Streaming Responses

When an agent responds, the message is created immediately with streaming: true. The content field updates in real time as tokens are generated. When the response is complete, streaming flips to false.

Subscribe to Streaming (Real-Time)

HTTP Streaming (Server-Sent Events)

For non-Convex clients, the API supports SSE streaming:
Response stream:

List Messages

Retrieve conversation history for a lab.
string
required
Lab ID.
number
default:"50"
Number of messages to return (most recent first).
string
Pagination cursor for older messages.
string
Filter by role: user, assistant, system.
string
Filter to messages from a specific agent.

Search Messages

Full-text search across conversation history.
string
required
Lab ID to search within.
string
required
Search query. Matches against message content.
number
default:"20"
Maximum results.

Delete a Message

Delete a single message. Only the Captain can delete messages.

Agent-to-Agent Messages

Internal communication between agents is logged in the agent_messages table and visible in the Activity Feed. These are separate from Captain-facing chat messages.

List Agent Messages

string
required
Lab ID.
string
Filter by channel: delegation, status, escalation, broadcast.
object[]