Stream processing flow ​
This page describes the current end-to-end flow of streaming model output through the implemented Agentsy packages.
Step 1: ingest provider data ​
Your application receives partial chunks, SSE frames, or provider-specific event payloads.
- Use
@agentsy/core/ssewhen you need low-level SSE parsing. - Use
@agentsy/providers/normalizersto convert provider-specific chunks into the common Agentsy event model.
Step 2: normalize to a common event vocabulary ​
@agentsy/providers/normalizers is the compatibility layer between providers and the rest of the ecosystem.
That lets downstream code stop caring whether a delta originally came from OpenAI, Anthropic, Gemini, or another provider-specific format.
Step 3: process incremental events ​
@agentsy/core/processor is the central orchestrator.
Its current surface includes:
LLMStreamProcessorcreateProcessorEventAdapter- transform helpers such as
createSmoothStream,createThinkingFilter, andcreateToolCallFilter
If you want an opinionated provider-coupled SSE pipeline, add createPipeline from @agentsy/providers/pipeline.
Step 4: extract specialized content ​
Depending on your use case, add targeted helpers:
@agentsy/core/thinkingfor reasoning tags@agentsy/core/tool-callsfor tool-call extraction and payload building@agentsy/core/structuredfor schema-oriented JSON parsing and repair@agentsy/core/xml-filterfor tag filtering and privacy-oriented scrubbing@agentsy/core/contextfor context shaping and dedupe@agentsy/core/formattingfor safe display-oriented formatting@agentsy/core/recoveryfor snapshot/continuation behavior
Step 5: project into UI or integration surfaces ​
Once the stream is processed, you can send it into one or more projections:
@agentsy/renderersfor plain-text rendering@agentsy/uifor conversation-state updates@agentsy/runtime/ag-uifor AG-UI protocol scenarios@agentsy/vscodefor editor-native experiences
Step 6: wrap with an agent loop if needed ​
@agentsy/orchestrator/agent sits above the processing pipeline when you need multi-step tool use, stop conditions, or loop management.
Why this shape matters ​
This layered structure lets you change the outer integration surface without rewriting the parsing core. That is exactly the kind of boring architectural win that saves a team from ritualized suffering later.