Documentation Index
Fetch the complete documentation index at: https://docs.nadoo.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Nadoo AI provides WebSocket endpoints for bidirectional real-time communication. While SSE handles unidirectional server-to-client streaming, WebSocket connections enable interactive scenarios such as live chat with streaming responses, workspace collaboration, user notifications, and plugin debugging.Chat
Real-time bidirectional chat with token-by-token AI response streaming, typing indicators, and message cancellation.
Notifications
Push notifications to connected users for system events, workflow completions, and workspace activity.
Workspace Collaboration
Real-time workspace events — document updates, application changes, and member activity broadcasts.
Plugin Debug
Live debug streaming during plugin execution with step-by-step traces, variable inspection, and API call logs.
Endpoints
| Endpoint | Purpose | Auth |
|---|---|---|
ws://.../ws/chat/{session_id} | Real-time chat streaming | JWT token (query param) |
ws://.../ws/notifications/{user_id} | User notifications | JWT token (required) |
ws://.../ws/workspaces/{workspace_id} | Workspace collaboration | JWT token (required) |
ws://.../api/v1/ws/plugin/debug/{execution_id} | Plugin debug console | None (execution ID scoped) |
Authentication
WebSocket connections authenticate via atoken query parameter containing a valid JWT access token. The server decodes the token before accepting the connection.
Chat WebSocket
The chat WebSocket provides real-time bidirectional communication for interactive AI conversations.Connection
Client-to-Server Messages
chat -- Send a message
chat -- Send a message
Send a chat message to the AI agent:If
chat_id is omitted, a new chat session is created automatically.typing -- Typing indicator
typing -- Typing indicator
Broadcast a typing indicator to other participants in the session:
ping -- Keep alive
ping -- Keep alive
Send a ping to keep the connection alive:The server responds with:
Server-to-Client Messages
| Message Type | Description |
|---|---|
connected | Connection established successfully |
response_start | AI response generation has begun |
text-delta | A chunk of the AI response text |
sources | Knowledge base sources used in the response |
response_end | AI response is complete, includes full text and token usage |
typing | Another user is typing |
user_disconnected | A user left the session |
error | An error occurred processing the message |
Streaming Response Flow
When the server receives achat message, it streams the AI response as a sequence of events:
Client Example
- JavaScript
- Python
Notifications WebSocket
The notifications endpoint delivers real-time push notifications to authenticated users.Connection
The
user_id in the URL must match the sub claim in the JWT token. Mismatched values result in an immediate connection close with code 1008.Message Format
Workspace Collaboration WebSocket
The workspace endpoint enables real-time collaboration features within a shared workspace.Connection
Events
When you join the workspace, all other connected users receive auser_joined event. When you disconnect, they receive user_left.
Supported broadcast event types:
| Event Type | Description |
|---|---|
user_joined | A user connected to the workspace |
user_left | A user disconnected from the workspace |
document_updated | A document in the knowledge base was modified |
application_changed | An application’s configuration was updated |
member_added | A new member was added to the workspace |
Example
Plugin Debug WebSocket
The plugin debug endpoint streams real-time execution data during plugin runs, enabling live debugging.Connection
This endpoint does not require a JWT token. Access is scoped by the
execution_id, which must correspond to an existing plugin execution record.Message Types
| Type | Description |
|---|---|
execution_info | Initial execution metadata (plugin ID, tool name, status) |
debug_data | Previously recorded debug data (sent if execution has historical data) |
log | Log output from the plugin |
trace | Execution trace data |
step | A discrete execution step |
variable | Variable state snapshot |
api_call | An external API call made by the plugin |
execution_complete | Plugin execution finished successfully |
execution_error | Plugin execution failed |
error | Connection or validation error |
Example
Connection Management
Reconnection Strategy
WebSocket connections do not auto-reconnect like SSE. Implement reconnection logic in your client:Connection Statistics
Monitor active WebSocket connections via the stats endpoint:WebSocket vs SSE
For most chatbot and streaming use cases, SSE is the recommended protocol. It is simpler to implement, reconnects automatically, and works reliably through HTTP proxies and load balancers. Use WebSocket only when you need bidirectional communication.
| Feature | SSE | WebSocket |
|---|---|---|
| Direction | Server to client | Bidirectional |
| Protocol | HTTP (text/event-stream) | ws:// or wss:// |
| Reconnection | Built-in auto-reconnect | Manual implementation required |
| Mid-stream input | Not supported | Supported (cancel, interrupt, new messages) |
| Typing indicators | Not supported | Supported |
| Browser support | Native EventSource API | Native WebSocket API |
| Proxy compatibility | Excellent (standard HTTP) | May require proxy configuration |
| Best for | Chat streaming, workflow progress | Interactive chat, collaboration, debugging |
Next Steps
SSE Events
Server-Sent Events for unidirectional streaming
Error Handling
API error codes and response format
Authentication
JWT tokens and API key authentication
Chat Streaming
Frontend integration for real-time chat