Skip to main content
Honcho’s SDKs can receive chat answers as a stream of text chunks over server-sent events, so your application can consume the answer through the same streaming interface it uses for other model output.
The dialectic is an agent loop. It will stream when it can but it’s designed to answer as fast as possible.

When to Use Streaming

Streaming is particularly useful for:
  • Chat interfaces that already consume streamed model output
  • Server-sent-event pipelines that forward answers to a client
  • Long answers that hit the agent’s tool-call limit, which stream as they are generated

Streaming with the Chat Endpoint

One of the primary use cases for streaming in Honcho is with the chat endpoint. This lets you receive the answer about a user over the same streaming interface as other model output.

Prerequisites

Streaming from the Chat Endpoint

Streaming Workspace Chat

Workspace chat streams the same way through chat_stream / chatStream on the client. There is no peer to anchor the question; the agent reads across every peer in the workspace.
Over REST, both endpoints return text/event-stream when stream is true. Each event is {"delta": {"content": "..."}, "done": false}, followed by a final {"done": true}.

Working with Streaming Data

When working with streaming responses, consider these patterns:
  1. Progressive Rendering - Update your UI as chunks arrive instead of waiting for the full response
  2. Buffered Processing - Accumulate chunks until a logical break (like a sentence or paragraph)
  3. Token Counting - Monitor token usage in real-time for applications with token limits
  4. Error Handling - Implement appropriate error handling for interrupted streams

Example: Restaurant Recommendation Chat

Performance Considerations

When implementing streaming:
  • Consider connection stability for mobile or unreliable networks
  • Implement appropriate timeouts for stream operations
  • Be mindful of memory usage when accumulating large responses
  • Use appropriate error handling for network interruptions
Streaming responses provide a more interactive and engaging user experience. By implementing streaming in your Honcho applications, you can create more responsive AI-powered features that feel natural and immediate to your users.