UI/UX Design Considerations for Production GenAI Chatbots

elastic · Tech · 2024 · source Agentic: no · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Production GenAI chatbot UX

Elastic needed a customer support chatbot UI that made long LLM/RAG latency, streaming stalls, and multi-source context control tolerable for users.

Constraints:

Architecture

Elastic built a custom chat interface with Elastic UI components, branded animated loading states, streaming support, an AbortController-based killswitch after 10 seconds of stream inactivity, and a prepended context menu that lets users choose data sources such as case history and knowledge base for RAG responses.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  custom_chat_interface["Custom chat interface"] --> context_menu["Context menu"]
  custom_chat_interface --> loading_animation["Loading animation"]
  custom_chat_interface --> streaming_request_handler["Streaming request handler"]
  context_menu --> rag_search_service["RAG search service"]
  rag_search_service --> llm_response_stream["LLM response stream"]
  llm_response_stream --> streaming_request_handler
  streaming_request_handler --> killswitch_timeout_controller["Killswitch timeout controller"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Custom chat interface User-facing Elastic UI chat surface for support conversations. Context menu, Loading animation, Streaming request handler
Context menu Lets users control data sources that inform LLM responses. Custom chat interface, RAG search service
Loading animation Maintains engagement during slow LLM/RAG responses. Custom chat interface
Streaming request handler Handles server-streamed LLM response data. Custom chat interface, Killswitch timeout controller, LLM response stream
Killswitch timeout controller Aborts streams after 10 seconds without data. Streaming request handler
RAG search service Retrieves context from selected sources. Context menu, LLM response stream
LLM response stream Generates and streams support answers. RAG search service, Streaming request handler

Data flow

A user submits a support question with selected context sources. The client sends the request to the server, RAG search runs against Elasticsearch, the server calls the LLM, streamed bytes return to the client, the loading animation keeps the user engaged, and a killswitch aborts streams that go silent for more than 10 seconds.

3 supporting quotes
“The team documented observed latency across their system:”summary, stated
“the team developed a custom loading animation.”summary, stated
“Their solution was to implement what they call a "killswitch" pattern.”summary, stated

Why this architecture

Elastic treated UX as part of production LLMOps because latency, stalled streams, and opaque context sources can destroy trust even when retrieval and generation are technically working.

“The case study is particularly valuable because it addresses often-overlooked aspects of LLMOps: the user interface and experience considerations”summary, stated
“This latency breakdown is instructive for anyone planning LLM deployments.”summary, stated

Models used: LLM · ELSER · Elastic Support Assistant

Scale

Alternatives considered (roads not taken)

Non-streaming full-response HTTP

Rejected because: The initial endpoint felt like it took forever before returning an answer.

“the initial LLM endpoint wasn't even streaming responses—it would generate and return the entire answer in a single HTTP response”summary, stated

Generic spinner

Rejected because: The team built a branded loading animation to keep users engaged.

“Rather than using a generic spinner, they created a branded animation using Elastic's existing EuiIcon component”summary, stated

Wait indefinitely on silent streams

Rejected because: A 10-second silence predicted failure or more than one minute of delay.

“if no data was received for 10 seconds during an active stream, it was highly likely that the stream would either eventually fail or take over one minute to resume.”summary, stated

Patterns

fallback-degradation (stream failure handling)

The killswitch aborts streams that go silent for 10 seconds and returns an error instead of hanging.

“aborts the fetch request if the stream goes silent for more than 10 seconds.”summary, stated

human-in-the-loop-gate (context selection)

The UI lets users choose which data sources feed the RAG response.

“designed a prepended context menu system allowing users to control which data sources (case history, knowledge base) inform LLM responses.”summary, stated

latency-optimization (chat UX)

Streaming and loading states address long response latency.

“The decision to implement streaming was clearly a critical production optimization. However, even with streaming, the 3-6 second wait for the first streamed byte creates user experience friction that had to be addressed through careful UI design.”summary, stated

Tradeoffs

Implement streaming plus timeout control.

Chose Streaming handler with AbortController killswitch over Plain full-response requests or indefinite streaming.

Rationale: Users need earlier feedback and bounded failure behavior.

“The implementation uses JavaScript's AbortController signals combined with setTimeout to create a mechanism that aborts the fetch request if the stream goes silent for more than 10 seconds.”summary, stated

Let users control RAG context sources.

Chose Prepended context menu over Always using all available data sources.

Rationale: User-controlled context improves transparency and relevance for multi-source support questions.

“allowing users to control which data sources (case history, knowledge base) inform LLM responses.”summary, stated

Gotchas (what bit them)

LLM streaming can hang after a successful 200 OK.

Root cause: The connection may succeed while generation stalls or fails silently.

Resolution: Abort the stream after 10 seconds of inactivity.

“they would often receive a 200 OK response quickly (indicating the LLM was ready to stream), but then experience long delays or complete connection hangs”summary, stated

Users lose patience before LLMs return.

Root cause: End-to-end response latency can exceed 5-11 seconds.

Resolution: Use streaming and custom animated loading states to communicate progress.

“The total time of 5-11+ seconds before users see any response represents a significant UX challenge.”summary, stated

Evaluation

Elastic evaluated the UI through latency measurements and observed streaming failure behavior during production chatbot development.

Metrics: 100-500ms initial client-server request. · 1-2.5s RAG search. · 1-2.5s LLM call. · 3-6s first streamed byte. · 5.1-11.5s total latency. · 10s stream-inactivity timeout.

“• Initial request (client to server): 100-500ms”summary, stated
“• Total end-to-end latency: 5.1-11.5 seconds”summary, stated

Outcomes

The case reports detailed latency ranges and a 10-second stream-timeout threshold.

“implemented animated loading states to maintain user engagement during response generation”summary, stated
“created a "killswitch" mechanism to handle stalled streaming connections after 10 seconds of inactivity”summary, stated