Skip to main content
Cedar enables streaming responses by default in your chat interface. Responses appear in real-time as they’re generated. You can disable streaming by setting the stream prop to false on any chat component or ChatInput.
Partial Object Streaming Not Supported: Cedar currently doesn’t support partial object streaming. For structured data to be handled via Cedar’s automatic handlers, only complete objects should be streamed or streaming should be turned off.

Quick Start

With Pre-built Components

Streaming is enabled by default for all pre-built chat components:
To disable streaming, set stream={false}:

With Individual Components

The ChatInput component has streaming enabled by default, but you can override it:

How It Works

When streaming is enabled:
  1. Real-time Updates: Text streams in character by character as it’s generated
  2. Out of the box support for streaming flexible objects: Handle structured objects and custom events (see Custom Message Rendering)
  3. Smooth Animation: Built-in typewriter effect for natural reading experience
  4. Error Handling: Graceful fallbacks if streaming fails

Additional Configuration necessary by provider

  • OpenAI and AI SDK: Streaming is supported out of the box
  • Mastra and Custom backend: The backend is required to send a data-only SSE stream of information in either streamed text or entire objects
Server-Sent Events (SSE) are part of a one-way streaming protocol to deliver a sequence of data: messages over a single HTTP connection. The stream mixes plain text and structured JSON, sent as newline-delimited chunks prefixed with data:.Under the hood, the server emits:Text chunks for incremental message rendering
JSON objects for structured data or tool outputs
Our client handlers will parse each data: line as it arrives and handle parsed text or JSON accordingly. This enables real-time, mixed-format updates with minimal overhead.
Feel free to drop these handlers into your backend to take care of Cedar-OS-compatible streaming.1. Example Usage:
2. Core SSE Stream Creator:

Next Steps