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 throughchat_stream / chatStream on the client. There is no peer to anchor the question; the agent reads across every peer in the workspace.
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:- Progressive Rendering - Update your UI as chunks arrive instead of waiting for the full response
- Buffered Processing - Accumulate chunks until a logical break (like a sentence or paragraph)
- Token Counting - Monitor token usage in real-time for applications with token limits
- 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