🌊
Module 06 4 concepts
Streaming
Token streaming, event streaming, and real-time output.
01 02 03 04
Async Streaming
LangGraph’s astream() and ainvoke() methods provide non-blocking async execution, essential for concurrent web applications built with FastAPI or asyncio.
Stream Modes
LangGraph provides four streaming modes – updates, values, messages, and events – each offering a different granularity of visibility into graph execution.
Streaming in Production
Production streaming requires Server-Sent Events or WebSocket transport, stateful thread management, interrupt handling, and resilience against timeouts, disconnections, and backpressure.
Token Streaming
The "messages" stream mode delivers LLM output token-by-token as (message_chunk, metadata) tuples, enabling responsive real-time chat interfaces.