BD Brain Drip
🌊
Module 06 4 concepts

Streaming

Token streaming, event streaming, and real-time output.

01

Async Streaming

LangGraph’s astream() and ainvoke() methods provide non-blocking async execution, essential for concurrent web applications built with FastAPI or asyncio.

02

Stream Modes

LangGraph provides four streaming modes – updates, values, messages, and events – each offering a different granularity of visibility into graph execution.

03

Streaming in Production

Production streaming requires Server-Sent Events or WebSocket transport, stateful thread management, interrupt handling, and resilience against timeouts, disconnections, and backpressure.

04

Token Streaming

The "messages" stream mode delivers LLM output token-by-token as (message_chunk, metadata) tuples, enabling responsive real-time chat interfaces.