Skip to content

Context Input

The Context Input component (ContextInput) provides a configurable source selector for agents that perform context-specific lookups. The flow designer defines a list of available sources; the user picks one in the Karli Studio chat; the chosen value is delivered into the flow as Data.

Purpose

In many workflows, the agent needs context beyond the user's chat message — for example, which document collection to search, which project to reference, or which knowledge base to query. The Context Input component lets the flow designer enumerate those choices, and lets the end user pick one before sending their message.

How It Works

  1. The flow designer drops a Context Input component on the canvas and fills its Sources table with label / value rows.
  2. In the Karli Studio chat, the user sees a selector populated with those labels and chooses one.
  3. Karli Studio sends the chat message together with the chosen source. The Context Input component matches the selection and emits a Data object with value and label to downstream components.

Output

The component's single output, Selected Value, is a Data with the shape:

{ "value": "<matched value>", "label": "<matched label>" }

If Required is enabled and no source matches the selection, the component raises a validation error listing the available sources. If Required is disabled, it instead emits an empty Data ({"value": "", "label": ""}).