Free cookie consent management tool by TermsFeed

Agent Chat Component

On This Page

What the Agent Chat component does

Displays a chat that lets users interact with an AI agent to pull information or complete tasks on their behalf.

The Agent Chat component provides a turnkey conversational experience for deploying chat agents in Appian interfaces. End users can ask questions, receive streamed responses, and view the chat agent's tool calls—all within a single component.

Where to use the agent chat component

Use a!agentChatField() in the following components:

Parameters

a!agentChatField( agent, inputs, title, height, placeholder, welcomeMessage, showSessionPicker, showWhen, debugMode, outputsSaveInto )

Name Keyword Types Description

Agent

agent

AgentReference

The AI agent that powers this component's chat interactions and defines how it understands and responds to user requests.

Inputs

inputs

Map

Map of inputs passed to the agent. This corresponds to the inputs defined in the agent.

Title

title

Text

The title that displays in the bar above the chat. Default: "Agent Chat".

Height

height

Text

Determines the component height. Valid values: "EXTRA_SHORT", "SHORT", "SHORT_PLUS", "MEDIUM", "MEDIUM_PLUS", "TALL", "TALL_PLUS", "EXTRA_TALL", "FILL" (default).

Placeholder

placeholder

Text

Text to display in the field when it is empty.

Welcome Message

welcomeMessage

Text

The text displayed in the chat area before the user sends their first message. Once the user sends a message, this text no longer displays.

Show Session Picker

showSessionPicker

Boolean

Determines if the session picker dropdown displays, allowing users to switch between conversations. Default: true.

Show When

showWhen

Boolean

Determines whether the component is displayed on the interface. When set to false, the component is hidden and is not evaluated. Default: true.

Debug Mode

debugMode

Boolean

Determines if tool inputs and outputs display for troubleshooting. Default: false.

Outputs Save Into

outputsSaveInto

List of Save

Saves the outputs received at the end of the AI agent run. Use save!value to reference the output variables.

Configure the agent chat component

The following sections cover important details about the agent chat component.

Agent type requirements

The agent chat component requires a chat agent. Process agents are not compatible with a!agentChatField() and cause a runtime validation error. Agent type is selected at creation and cannot be changed after the chat agent is created.

Process agents can be selected as tools for chat agents, allowing chat agents to orchestrate process-based workflows as part of a conversation.

If you need to execute a process agent within a process model instead, use the Execute AI Agent smart service.

Using the agent parameter

The agent parameter accepts a reference to an AI agent object. If a process agent is referenced, the component displays a validation error at runtime.

Using the title parameter

The title parameter sets the text displayed in the bar above the chat. The default value is "Agent Chat". Customize this to give end users context about what the chat agent does.

Using the inputs parameter

The inputs parameter passes context-specific data to the chat agent at runtime. The inputs map corresponds to the inputs defined in Agent Studio. Use inputs to provide the chat agent with user-specific context such as form data, user role, case details, or record information.

For example, if the chat agent expects a caseId input, pass it using:

1
2
3
4
5
6
a!agentChatField(
  agent: agent!MY_CHAT_AGENT,
  inputs: {
    caseId: ri!caseId
  }
)

Using the outputsSaveInto parameter

The outputsSaveInto parameter saves the outputs received at the end of the AI agent run. Use save!value to reference the output variables defined in the agent. Combine this with refresh variables to fill out forms or dynamically render content on interfaces.

For example, if the chat agent produces an output called "decision," capture it with:

1
2
3
4
a!agentChatField(
  agent: agent!MY_CHAT_AGENT,
  outputsSaveInto: a!save(local!agentDecision, save!value.decision)
)

Using the height parameter

The height parameter controls the vertical space the chat component occupies. The default value "FILL" makes the component expand to fill the available vertical space of its parent container, making it suitable for full-page chat experiences.

Using the welcomeMessage parameter

The welcomeMessage parameter sets introductory text in the chat area before the user sends their first message. Once the user sends a message, the welcome message no longer displays. Use this to guide end users on what the chat agent can help with.

Using the showSessionPicker parameter

The showSessionPicker parameter controls whether the session picker dropdown displays, allowing users to switch between conversations. The default value is true. Set to false if you want to limit users to a single conversation session.

Using the debugMode parameter

Enable debugMode during development to see tool inputs and outputs for troubleshooting. Debug mode helps developers improve prompt accuracy and troubleshoot unexpected behavior.

Disable debug mode before deploying to production. End users do not benefit from seeing internal tool details, and the additional output can be confusing.

Streaming responses

Agent chat component responses stream in real time. Streaming applies to the chat component only—it does not apply to the Execute AI Agent smart service output.

Terminate button

End users can stop a running chat agent at any time using the terminate button. The terminate button addresses runaway scenarios where the chat agent takes too long or produces unhelpful responses. When a user clicks terminate, the chat agent execution stops immediately. To resume the agent after termination, users must type a new question in the session.

Conversation persistence

The agent chat component supports conversation persistence. End users can return to previous conversations and switch between sessions. Session names are based on the first user message. Each user has access only to their own conversation history. For more details, see Conversation Persistence for Chat Agents.

Appian Mobile and Appian for Windows considerations

This component is not supported in the Appian Mobile or Appian for Windows apps. To use agent chat, view the interface in a browser.

Agent chat component considerations

Keep the following considerations in mind when using the agent chat component:

  • Agent type immutability: Agent type (chat or process) is set at creation and cannot be changed. If you select the wrong type, you must create a new chat agent.
  • No conversation sharing: Conversation persistence is scoped to the original user. Conversations cannot be shared between users or exported.
  • No search within chat: Use the browser's built-in search functionality to find content within the chat.

Note:  The agent chat component requires the Advanced AI tier, the same tier required for process agents.

Agent chat component examples

The following examples demonstrate the agent chat component.

To experiment with examples, copy, and paste the expression into an interface object.

The examples below reference AI agents from another environment and produce errors if you use them in yours. Use the examples as a reference only.

Basic agent chat configuration

1
2
3
4
5
a!agentChatField(
  title: "Ask a question",
  agent: agent!MY_CHAT_AGENT,
  placeholder: "Type your question here..."
)

Agent chat component with inputs and outputsSaveInto

1
2
3
4
5
6
7
8
9
a!agentChatField(
  title: "Case Assistant",
  agent: agent!CASE_CHAT_AGENT,
  inputs: {
    caseId: ri!caseId
  },
  outputsSaveInto: a!save(local!agentDecision, save!value.decision),
  height: "FILL"
)

Feature compatibility

The table below lists this component's compatibility with various features in Appian.
Feature Compatibility Note
Portals Incompatible
Offline Interfaces Incompatible
Sync-Time Custom Record Fields Incompatible
Real-Time Custom Record Fields Incompatible

Custom record fields that evaluate in real time must be configured using one or more Custom Field functions.

Process Reports Incompatible

Cannot be used to configure a process report.

Process Events Incompatible

Cannot be used to configure a process event node, such as a start event or timer event.

Process Autoscaling Incompatible

Cannot be used in autoscaled processes.

Event Consumer Filter Conditions Compatible

Can be used in filter conditions.

Event Consumer Event Handlers Compatible

Can be used in event handler expressions.

Feedback