---
title: "Sidekick’s Improved Streaming Experience"
description: "Shopify's Sidekick fixes two LLM chat streaming problems: Markdown rendering jank, where partial syntax shows up as raw text, and the long wait while tool calls finish."
url: "https://swe.quest/articles/sidekick-s-improved-streaming-experience-14ee0919ebe52814"
canonical: "https://shopify.engineering/sidekicks-improved-streaming"
source: "Shopify Engineering"
published: "2023-08-01"
difficulty: "medium"
kind: "Case study"
reading_minutes: 6
tags: ["llms","realtime","frontend","javascript","product-engineering"]
---

# Sidekick’s Improved Streaming Experience

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2023-08-01, 6 min read, Case study. Original: [https://shopify.engineering/sidekicks-improved-streaming](https://shopify.engineering/sidekicks-improved-streaming)

## Summary

Shopify's Sidekick fixes two LLM chat streaming problems: Markdown rendering jank, where partial syntax shows up as raw text, and the long wait while tool calls finish. A character-level finite state machine in a Node.js Transform stream buffers ambiguous Markdown sequences, such as links and asterisks, until they either complete or prove to be false positives. The LLM is prompted to emit special "card:" Markdown links as placeholders. The same parser detects these links and kicks off asynchronous content resolution, which is multiplexed into one Server-Sent Events stream that the UI demultiplexes, so the main answer streams immediately and tool results fill in later.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Real-time systems](https://swe.quest/tags/realtime.md) (Backend & APIs)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Product engineering](https://swe.quest/tags/product-engineering.md) (Engineering organization)

## Prerequisites

- Markdown syntax
- Node.js streams ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- LLM tool calling ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- Server-Sent Events

## Keywords

Sidekick, Shopify, Markdown, Server-Sent Events, Node.js Transform stream, finite state machine

## Related posts

- [The making of the Yelp Assistant UI](https://swe.quest/articles/the-making-of-the-yelp-assistant-ui-8429a21baaf76a80.md): Yelp Engineering · 2026-09-29 · Medium · 13 min read · Mobile, Frontend, Product engineering, LLMs
  Yelp Assistant, Yelp's LLM-powered chat for scoping projects with local pros, uses a hybrid UI.
- [From OpenAI to Open LLMs with Messages API on Hugging Face](https://swe.quest/articles/from-openai-to-open-llms-with-messages-api-on-hugging-face-98058f09a7d2acc1.md): Hugging Face · 2024-02-08 · Medium · 7 min read · Inference & serving, LLMs, API design, RAG & retrieval
  Text Generation Inference 1.4.0 adds a Messages API compatible with OpenAI's Chat Completion API, so open LLMs on Inference Endpoints can be called from existing OpenAI client code by changing the base URL and token.
- [Speeding up agentic workflows with WebSockets in the Responses API](https://swe.quest/articles/speeding-up-agentic-workflows-with-websockets-in-the-responses-api-7a1ff127c7fc35a3.md): OpenAI · 2026-04-22 · Medium · 6 min read · AI agents, API design, Performance engineering, Inference & serving, Real-time systems
  OpenAI cut end-to-end latency of agentic loops on the Responses API by about 40% by adding a WebSocket mode that keeps a persistent connection with a connection-scoped in-memory cache of prior response state.
- [Flow generation through natural language: An agentic modeling approach](https://swe.quest/articles/flow-generation-through-natural-language-an-agentic-modeling-approach-84b1ba2f65ecd1a0.md): Shopify Engineering · 2026-04-22 · Medium · 12 min read · Model training, AI agents, Evaluation, LLMs, ML platforms
  Shopify fine-tuned Qwen3-32B into a tool-calling agent that turns natural-language requests into Shopify Flow automations for Sidekick, reporting 2.2x lower latency and 68% lower cost than the closed frontier model it replaced.
- [Building Ghostwriter Chat](https://swe.quest/articles/building-ghostwriter-chat-1b8d2c338765451d.md): Replit · 2023-03-24 · Easy · 4 min read · AI for coding, LLMs, Developer tools
  Ghostwriter Chat is an LLM-powered pair programmer built into Replit's IDE and shipped in about 6-8 weeks after a January Hackweek.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
