Streaming Architecture
ElizaOS streaming uses extractors to filter and process chunks as they arrive:Built-in Extractors
ElizaOS provides several extractors for different scenarios:PassthroughExtractor
Streams all content as-is:XmlTagExtractor
Extracts content from a specific XML tag:ResponseStreamExtractor
Action-aware extraction used byDefaultMessageService:
Reference: packages/typescript/src/utils/streaming.ts
ActionStreamFilter
Auto-detects content type for action handlers:Creating a Streaming Context
Streaming in Actions
Actions can stream responses to users:WebSocket Streaming Example
Complete example with WebSocket:Server-Sent Events (SSE)
Stream using SSE for HTTP-based streaming:Validation-Aware Streaming
For advanced use cases, useValidationStreamExtractor with retry support:
Error Handling
Streaming Retry State
Handle retries with accumulated text:Best Practices
Performance Considerations
Chunk Size
The streaming system keeps a safe margin to avoid splitting tags:Buffer Management
Client-Side Implementation
React Hook Example
Next Steps
Custom Actions
Build actions with streaming support
Deployment
Deploy streaming applications