KS
Killer-Skills

streaming — how to use streaming for AI agents how to use streaming for AI agents, what is streaming in AI development, streaming alternative for AI backends, streaming vs websockets for AI data, streaming install guide for AI agents, streaming setup for assistant-ui

v0.0.1
GitHub

About this Skill

Perfect for AI Agents needing real-time data processing from AI backends using the assistant-stream package. Streaming is a technology that handles real-time data streams from AI backends, utilizing the assistant-stream package and native assistant-ui formats.

Features

Handles streaming from AI backends using the assistant-stream package
Supports AI SDK data stream format as referenced in data-stream.md
Utilizes native assistant-ui format as outlined in assistant-transport.md
Employs encoders and decoders as detailed in encoders.md
Consults the latest API from assistant-ui.com/llms.txt for optimal performance

# Core Topics

yashness yashness
[0]
[0]
Updated: 3/7/2026

Quality Score

Top 5%
56
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
Cursor IDE Windsurf IDE VS Code IDE
> npx killer-skills add yashness/yash-full-stack-personal/references/references/data-stream.md

Agent Capability Analysis

The streaming MCP Server by yashness is an open-source Categories.community integration for Claude and other AI agents, enabling seamless task automation and capability expansion. Optimized for how to use streaming for AI agents, what is streaming in AI development, streaming alternative for AI backends.

Ideal Agent Persona

Perfect for AI Agents needing real-time data processing from AI backends using the assistant-stream package.

Core Value

Empowers agents to handle streaming data from AI backends using the assistant-stream package, enabling seamless integration with AI SDK data streams and native assistant-ui formats like assistant-transport, with support for various encoders and decoders.

Capabilities Granted for streaming MCP Server

Streaming AI-generated content in real-time
Processing live data streams from AI backends
Integrating AI SDK data streams with native assistant-ui formats

! Prerequisites & Limits

  • Requires the assistant-stream package
  • Dependent on AI backend data stream availability
  • Must consult the latest API documentation at assistant-ui.com/llms.txt
Project
SKILL.md
3.0 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8

# Tags

[No tags]
SKILL.md
Readonly

assistant-ui Streaming

Always consult assistant-ui.com/llms.txt for latest API.

The assistant-stream package handles streaming from AI backends.

References

When to Use

Using Vercel AI SDK?
├─ Yes → toUIMessageStreamResponse() (no assistant-stream needed)
└─ No → assistant-stream for custom backends

Installation

bash
1npm install assistant-stream

Custom Streaming Response

ts
1import { createAssistantStreamResponse } from "assistant-stream"; 2 3export async function POST(req: Request) { 4 return createAssistantStreamResponse(async (stream) => { 5 stream.appendText("Hello "); 6 stream.appendText("world!"); 7 8 // Tool call example 9 const tool = stream.addToolCallPart({ toolCallId: "1", toolName: "get_weather" }); 10 tool.argsText.append('{"city":"NYC"}'); 11 tool.argsText.close(); 12 tool.setResponse({ result: { temperature: 22 } }); 13 14 stream.close(); 15 }); 16}

With useLocalRuntime

useLocalRuntime expects ChatModelRunResult chunks. Yield content parts for streaming:

tsx
1import { useLocalRuntime } from "@assistant-ui/react"; 2 3const runtime = useLocalRuntime({ 4 model: { 5 async *run({ messages, abortSignal }) { 6 const response = await fetch("/api/chat", { 7 method: "POST", 8 body: JSON.stringify({ messages }), 9 signal: abortSignal, 10 }); 11 12 const reader = response.body?.getReader(); 13 const decoder = new TextDecoder(); 14 let buffer = ""; 15 16 while (reader) { 17 const { done, value } = await reader.read(); 18 if (done) break; 19 20 buffer += decoder.decode(value, { stream: true }); 21 const parts = buffer.split("\n"); 22 buffer = parts.pop() ?? ""; 23 24 for (const chunk of parts.filter(Boolean)) { 25 yield { content: [{ type: "text", text: chunk }] }; 26 } 27 } 28 }, 29 }, 30});

Debugging Streams

ts
1import { AssistantStream, DataStreamDecoder } from "assistant-stream"; 2 3const stream = AssistantStream.fromResponse(response, new DataStreamDecoder()); 4for await (const event of stream) { 5 console.log("Event:", JSON.stringify(event, null, 2)); 6}

Stream Event Types

  • part-start with part.type = "text" | "reasoning" | "tool-call" | "source" | "file"
  • text-delta with streamed text
  • result with tool results
  • step-start, step-finish, message-finish
  • error strings

Common Gotchas

Stream not updating UI

  • Check Content-Type is text/event-stream
  • Check for CORS errors

Tool calls not rendering

  • addToolCallPart needs both toolCallId and toolName
  • Register tool UI with makeAssistantToolUI

Partial text not showing

  • Use text-delta events for streaming

Related Skills

Looking for an alternative to streaming or building a Categories.community AI Agent? Explore these related open-source MCP Servers.

View All

widget-generator

Logo of f
f

widget-generator is an open-source AI agent skill for creating widget plugins that are injected into prompt feeds on prompts.chat. It supports two rendering modes: standard prompt widgets using default PromptCard styling and custom render widgets built as full React components.

149.6k
0
Design

chat-sdk

Logo of lobehub
lobehub

chat-sdk is a unified TypeScript SDK for building chat bots across multiple platforms, providing a single interface for deploying bot logic.

73.0k
0
Communication

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication