---
schema_version: "1"
id: 2a4550d20ee48185a07831580e9be397203922458d6176b7a8959a633594fd6d
title: Configuring Chat Operations
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mulesoft-ai-chain-connector/1.0/configuring-chat-operations.md
canonical_url: https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/configuring-chat-operations
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 18829b0c6e8ef843f0261738b839f3507923ccbbdbcdffa54f18526396035db5
description: MuleSoft Documentation Site
release: "1.0"
latest: false
---
---
product: MuleSoft AI Chain Connector
version: 1.0
---

# Configuring Chat Operations

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Support for MuleSoft AI Chain Connector 1.0 ends on October 30, 2026. Use one of the other available
[MuleSoft AI connectors](https://docs.mulesoft.com/general/learning-map-mulesoft-ai) based on your requirements.

## Configure the Chat Answer Prompt Operation

The **Chat answer prompt** operation is a simple prompt request operation to the configured LLM. It
uses a plain text prompt as input and responds with a plain text answer.

To configure the **Chat answer prompt** operation:

1.  Select the operation on the Anypoint Code Builder or Studio canvas.

2.  In the **General** properties tab for the operation, enter plain text for the **Prompt**.

This is the XML configuration for this operation:

```xml
<ms-chainai:chat-answer-prompt
  doc:name="Chat answer prompt"
  doc:id="8ba9d534-f801-4ac7-8a31-11462fc5204b"
  config-ref="MuleChain_AI_Llm_configuration"
  prompt="#[payload.prompt]"
/>
```

### Output Configuration

This operation responds with a JSON payload containing the main LLM response.

This is an example response:

```json
{
  "response": "The capital of Switzerland is Bern. It's known for its well-preserved medieval old town, which is a UNESCO World Heritage site. Bern became the capital of Switzerland in 1848. The Swiss parliament, the Federal Assembly, is located in Bern."
}
```

The operation also returns attributes that aren’t within the main JSON payload, which include
information about token usage, for example:

```json
{
  "tokenUsage": {
    "outputCount": 9,
    "totalCount": 18,
    "inputCount": 9
  },
  "additionalAttributes": {}
}
```

## Configure the Chat Answer Prompt With Memory Operation

The **Chat answer prompt with memory** operation is useful for retaining conversation history for a
multi-user chat operation.

To configure the **Chat answer prompt with memory** operation:

1.  Select the operation on the Anypoint Code Builder or Studio canvas.

2.  In the **General** properties tab for the operation, enter these values:

    - **Data**

      Contains the prompt for the operation.

    - **Memory Name**

      Name of the conversation. For multi-user support, enter the unique user ID.

    - **DB File Path**

      Path to the in-memory database for storing the conversation history.

      You can also use a DataWeave expression for this field, for example:

      `#["/Users/john.wick/Desktop/mac-demo/db/" ++ payload.memoryName].`

    - **Max Messages**

      Maximum number of messages to remember for the conversation defined in **Memory Name**.

This is the XML configuration for this operation:

```xml
<ms-aichain:chat-answer-prompt-with-memory
  doc:name="Chat answer prompt with memory"
  doc:id="7e62e70e-eff7-4080-bb20-3d162bb84c39"
  config-ref="MuleSoft_AI_Chain_Config"
  memoryName="#[payload.memoryName]"
  dbFilePath='#["/Users/john.wick/Desktop/mac-demo/db/" ++ payload.memoryName]'
  maxMessages="#[payload.maxMessages]">
  <ms-aichain:data><![CDATA[#[payload.prompt]]]></ms-aichain:data>
</ms-aichain:chat-answer-prompt-with-memory>
```

### Output Configuration

This operation responds with a JSON payload containing the main LLM response, with additional
metadata stored in attributes.

This is an example response:

```json
{
  "response": "I'm sorry, I do not have access to personal information such as your name."
}
```

The operation also returns attributes that aren’t within the main JSON payload, which include
information about token usage, for example:

```json
{
  "tokenUsage": {
    "outputCount": 13,
    "totalCount": 44,
    "inputCount": 31
  },
  "additionalAttributes": {
    "memoryName": "memory",
    "maxMessages": "2",
    "dbFilePath": "/.../memory.db"
  }
}
```

## See Also

- [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb)

- [MuleSoft AI Chain Connector Overview](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/)

- [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-connector-reference)

- [Salesforce Help](https://help.salesforce.com)
