Skip to content

UI Response System

The UI Response System generates the final user-facing response in every Swisper conversation. It takes the results from domain agent execution (or direct context for simple queries), applies prompt variants and personalization, and streams the response to the frontend.

The module uses a fragment-based prompt architecture where Swisper's personality, tone, and response rules are stored as editable markdown files. Six specialized nodes handle different response variants — simple chat, complex agent synthesis, HITL clarification, and disambiguation flows — all sharing common context extraction and streaming infrastructure.

Key Components

Component Purpose
Simple Text Node Generates direct conversational responses for queries without agent results
Complex Text Node Synthesizes results from multiple domain agents, with inline card replacement during streaming
HITL Text Node Formats pre-determined clarification questions (bypasses LLM)
Disambiguation Nodes Handle entity disambiguation — both non-blocking ("by the way") and blocking variants
Shared Context Extractor Builds common context (facts, history, preferences) used by all response nodes
Prompt Assembly Loads and assembles markdown prompt fragments with placeholder injection
Response Streaming Streams response chunks to the frontend via Server-Sent Events

Documentation Sections

  • Overview — What this module does and who it serves
  • Architecture — System design, components, and trade-offs