How to build advanced features for AI chatbots on SSE
The article discusses how to implement advanced features like resumable streams, cancellations, and multi-device synchronization for AI chatbots using Server-Sent Events (SSE). It explains the challenges of maintaining durable and responsive chatbot sessions when transitioning from synchronous to background agent models. While these features are feasible with SSE and proper handling of token streams, the process is more complex than commonly assumed.
- ▪Resumable streams allow users to refresh a page mid-response and continue receiving tokens without waiting for the full response to be stored.
- ▪Cancellation enables stopping an LLM-generated response mid-stream, even if the connection has dropped and reconnected.
- ▪Multi-device support lets users view and interact with the same chat session across different devices in real time.
- ▪SSE can support these features using mechanisms like Last-Event-ID, but implementation complexity is often underestimated.
- ▪Different LLM APIs structure their streaming responses differently, but all include start, delta, and end events for parsing generated content.
Hacker News (Front Page) files mainly under programming. We currently carry 773 of its stories. Top-voted stories on Hacker News.
Story provenance
Source · retrieval · rights · ranking — open for full record
inspect →
Story provenance
Attribution is not the same as permission. This drawer separates discovery metadata, excerpts, WeSearch-generated summaries, reuse status, and whether the publisher receives the visit. Nothing here claims a legal grant the publisher has not made.
Record
| Original publisher | /dev/knill |
| Canonical URL | https://zknill.io/posts/everyone-said-sse-token-streaming-was-easy/ |
| Publication time | Tue, 28 Apr 2026 07:49:37 +0000 |
| Retrieval time | 2026-04-28T08:00:23.299Z |
| Last seen | 2026-04-28T08:00:23.299Z |
| Headline source | Publisher (no WeSearch rewrite) |
| Excerpt source | publisher body |
| Excerpt method | First ~120 words (~800 chars) of extracted publisher body, fair-use limited. |
| Summary | WeSearch · cerebras-chat (WeSearch summarizer) |
| Summary source text | contentText |
| Citation coverage | Summary is a WeSearch-generated derivative; primary citation is the original publisher URL. |
| Cluster | xyWcsRNOWyuR |
| Cluster logic | Grouped by semantic title/content similarity across sources within a rolling window. Same-publisher template collisions are excluded from coverage comparison. |
| Ranking reason | Story pages are not engagement-ranked. Hub feeds use recency, with optional source-diversified chronological ordering (cap consecutive stories per source). No personalized ranking. |
| Publisher visit | Yes — open original |
| Substitutes article? | No — link-out required for full text |
Rights status (four layers)
WeSearch handling by dimension
| Indexing | May the item be indexed (stored, ranked, made findable)? | Allowed |
| Snippet | May a short excerpt of the publisher's text be shown? | Allowed |
| AI summary | May WeSearch generate its own short summary of the article? | Limited |
| Retrieval / RAG | May the content be exposed for third-party retrieval-augmented generation? | Not asserted |
| Model training | May the content be used to train AI models? | Not asserted |
| Commercial reuse | May the content be reused commercially? | Not permitted |
Basis: Derived from the published RSS/Atom feed. Contact: [email protected]. Reviewed: 2026-07-24.
Opening excerpt (first ~120 words) tap to expand
Apr 23, 2026 · 9 minHow to make SSE token streams resumable, cancellable, and multi-deviceAgents used to be a thing you talked to synchronously. Now they’re a thing that runs in the background while you work. When you make that change, the transport breaks.But a lot of folks are saying: “No, you can just use Server-Sent Events (SSE) with Last-Event-ID to get a durable stream, it’s easy”. And yes, all of this is do-able. But I contest that it’s easy. So let’s walk through how to do it, and you can decide for yourself.Catch up on the previous article and discussionhttps://news.ycombinator.com/item?id=47832720The advanced chatbot features I want to walk through are:Resumable streams — refresh the page mid-response and get the in-progress tokens back, instead of waiting for the full response…
Excerpt limited to ~120 words for fair-use compliance. The full article is at /dev/knill.