AI EngineeringInterview preparation
Intermediate·Concept·2 min read

Streaming graph events

Practice this question

Overview

  • Graph streaming exposes progress such as state updates, node events, and model token events.
  • It lets a UI distinguish “retrieving,” “waiting for approval,” and “complete.” Stream modes and event APIs vary by version.

Why this matters

A graph may perform several steps before producing final text.

An everyday example

A delivery tracker shows “picked up,” “in transit,” and “delivered.”

A technical example

Translate an internal retrievePolicy completion into a public progress: "Found policy information" event.

How it works

  1. Subscribe server-side
  2. Allowlist public event fields
  3. Remove sensitive state
  4. Emit stable application events
  5. Finish with final status.

Architecture and flow

Graph events → event projector/redactor → SSE → UI.

The insurance assistant example

The customer sees “Waiting for your confirmation,” while staff-only notes stay private.

When to use it

Interactive multi-step tasks and visible progress.

When to avoid it

Never forward raw state snapshots or all tool results to the browser.

Interview answer

“I stream application-safe progress events rather than raw graph state, with completion, pause, and error events explicitly modeled.”

Benefits, trade-offs, and production considerations

  • An internal/private state field is not automatically hidden in all streaming modes.
  • Apply a server-side public event projection regardless of graph schemas.
  • Test reconnect and event ordering.
  • LangGraph streaming.
Adapted from 13_AI.MD · “Streaming graph events”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.