> ## Documentation Index
> Fetch the complete documentation index at: https://docs.contextual.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# UI Stream Types

> Control what data streams to the UI in Agent Composer

## Description

UI stream types configure which data a node streams to the user interface during execution. This controls what users see in real-time as the agent processes their query.

## Syntax

Configure UI streaming via `ui_stream_types` on a node:

```yaml theme={null}
generate_response:
  type: ResponseGenerationStep
  ui_stream_types:
    generation: true
    retrievals: true
  input_mapping:
    retrievals: search#retrievals
    query: __inputs__#query
```

## Supported Stream Types

| Stream Type           | Description                                   |
| --------------------- | --------------------------------------------- |
| `RETRIEVALS`          | Search results and citations                  |
| `GENERATION`          | LLM response text (streams as it's generated) |
| `QUERY_REFORMULATION` | Query transformations and expansions          |
| `ATTRIBUTION`         | Citation attribution data                     |
| `GROUNDEDNESS`        | Groundedness scores for the response          |

## Example: Full Response Pipeline

```yaml theme={null}
nodes:
  search:
    type: SearchUnstructuredDataStep
    ui_stream_types:
      retrievals: true
      query_reformulation: true
    input_mapping:
      query: __inputs__#query

  generate:
    type: ResponseGenerationStep
    ui_stream_types:
      generation: true
      attribution: true
      groundedness: true
    input_mapping:
      retrievals: search#retrievals
      query: __inputs__#query
```

## Multiple Nodes with Same Stream Type

Multiple nodes can have the same UI streaming type. Events stream sequentially in execution order:

```yaml theme={null}
nodes:
  research:
    type: AgenticResearchStep
    ui_stream_types:
      retrievals: true
    # ... config

  generate:
    type: GenerateFromResearchStep
    ui_stream_types:
      generation: true
    # ... config
```

## Multi-Output Workflows

For workflows with multiple outputs, use `ui_output` at the root level to designate which output displays in the UI:

```yaml theme={null}
outputs:
  response: str
  metadata: Dict[str, Any]
  debug_info: str

ui_output: response
```

## Default Behavior

Each step type has default UI stream types. Check the [Step Reference Catalog](/how-to-guides/ac-yaml-reference) for defaults. Common defaults:

| Step Type                    | Default Streams                                           |
| ---------------------------- | --------------------------------------------------------- |
| `SearchUnstructuredDataStep` | `QUERY_REFORMULATION`                                     |
| `ResponseGenerationStep`     | `RETRIEVALS`, `GENERATION`, `ATTRIBUTION`, `GROUNDEDNESS` |
| `AgenticResearchStep`        | `RETRIEVALS`                                              |
| `GenerateFromResearchStep`   | `GENERATION`                                              |

## Related

* [YAML Format](/reference/ac-yaml-format)
* [Step Reference Catalog](/how-to-guides/ac-yaml-reference)
