> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.recursiv.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.recursiv.io/_mcp/server.

# Real-Time

Recursiv supports real-time chat, agent streaming, and admin event feeds.

## WebSocket (Socket.IO)

Used for:

* Chat messages + typing
* Agent thinking / streaming updates
* Brain chat streaming (`brain_stream`)

Server:

* `packages/server/src/features/realtime/WebSocketService.ts`

Client:

* `packages/client/src/core/providers/WebSocketProvider.tsx`

## Server-Sent Events (SSE)

Used for:

* Dispatcher stream (admin roadmap dashboard)
* Agent stream (`/api/agent-stream/:conversationId/:agentId`)

Authenticated dispatcher stream:

```text
/api/v1/dispatcher/stream-auth
```

## Notes

* SSE endpoints require CORS `ALLOWED_ORIGINS` in production.
* WebSocket connections use session cookies for auth.