# mulesoft MuleSoft AI Chain Connector - Full Documentation --- product: MuleSoft AI Chain Connector version: 1.0 --- # Configuring Agent 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 Agent Define Prompt Template Operation Use the **Agent define prompt template** operation to use specific prompt templates with your LLMs. This allows you to create natural language prompts that generate responses, extract information, invoke other prompts, or perform any text-based task. To configure the **Agent define prompt template** 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: - **Dataset** Specify the dataset for the LLM to evaluate using the provided template and instructions. - **Template** Enter the prompt template for the operation. - **Instructions** Provide the instructions for the LLM, outlining the goals of the task. This is the XML for this operation: This image shows an example of the configuration for the Agent define prompt template action in Anypoint Code Builder: ![Anypoint Code Builder canvas with Agent define prompt template highlighted, configuration attributes filled in, and the XML code for the configured action](/mulesoft/current/en-us/mulesoft-ai-chain-connector/1.0/_images/agent-define-prompt-config-acb.png) ### Output Configuration This operation responds with a JSON payload containing the main LLM response. Additionally, attributes such as token usage are included as part of the metadata (attributes) but not within the main payload. This is an example response: ```json { "response": "{\n \"type\": \"positive\",\n \"response\": \"Thank you for your positive feedback on the training last week. We are glad to hear that you had a great experience. Have a nice day!\"\n}" } ``` 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": {} } ``` - `tokenUsage` Token usage metadata returned as attributes - `outputCount` Number of tokens used to generate the output - `totalCount` Total number of tokens used for input and output - `inputCount` Number of tokens used to process the input ## See Also - [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-connector-reference) - [MuleSoft AI Chain - Additional Configuration Information](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-additional-config) - [Salesforce Help](https://help.salesforce.com) --- product: MuleSoft AI Chain Connector version: 2.0 is-latest-version: true --- # Configuring Agent Operations > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## Configure the Agent Define Prompt Template Operation Use the **Agent define prompt template** operation to use specific prompt templates with your LLMs. This allows you to create natural language prompts that generate responses, extract information, invoke other prompts, or perform any text-based task. To configure the **Agent define prompt template** 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: - **Dataset** Specify the dataset for the LLM to evaluate using the provided template and instructions. - **Template** Enter the prompt template for the operation. - **Instructions** Provide the instructions for the LLM, outlining the goals of the task. This is the XML for this operation: This image shows an example of the configuration for the Agent define prompt template action in Anypoint Code Builder: ![Anypoint Code Builder canvas with Agent define prompt template highlighted, configuration attributes filled in, and the XML code for the configured action](/mulesoft/current/en-us/mulesoft-ai-chain-connector/latest/_images/agent-define-prompt-config-acb.png) ### Output Configuration This operation responds with a JSON payload containing the main LLM response. Additionally, attributes such as token usage are included as part of the metadata (attributes) but not within the main payload. This is an example response: ```json { "response": "{\n \"type\": \"positive\",\n \"response\": \"Thank you for your positive feedback on the training last week. We are glad to hear that you had a great experience. Have a nice day!\"\n}" } ``` 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": {} } ``` - `tokenUsage` Token usage metadata returned as attributes - `outputCount` Number of tokens used to generate the output - `totalCount` Total number of tokens used for input and output - `inputCount` Number of tokens used to process the input ## See Also - [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference) - [MuleSoft AI Chain - Additional Configuration Information](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-additional-config) - [Salesforce Help](https://help.salesforce.com) --- 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 ``` ### 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 ``` ### 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) --- product: MuleSoft AI Chain Connector version: 2.0 is-latest-version: true --- # Configuring Chat Operations > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## 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 ``` ### 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 ``` ### 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/latest/) - [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference) - [Salesforce Help](https://help.salesforce.com) --- product: MuleSoft AI Chain Connector version: 1.0 --- # Configuring Embeddings 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. Embeddings operations include: - [Embedding new store](#new-store-operation) - [Embedding add document to store](#add-document-to-store) - [Embedding add folder to store](#add-folder-to-store) - [Embedding query from store](#embedding-query-from-store) - [Embedding get info from store](#get-info-from-store) ## Configure the Embedding New Store Operation The **Embedding new store** operation creates a new in-memory embedding and exports it to a physical file. The in-memory embedding in MuleSoft AI Chain persists its data through file exports upon any changes. To configure the **Embedding new store** operation: 1. Select the operation on the Anypoint Code Builder or Studio canvas. 2. In the **General** properties section, configure the full file path for the embedding store to save in **Store Name**. If the file already exists, it is overwritten. Ensure the file path is accessible. You can also use a DataWeave expression for this field, for example: ```dataweave mule.home ++ "/apps/" ++ app.name ++ payload.storeName ``` This is the XML configuration for this operation: ```xml ``` ### Output Configuration This operation responds with a JSON payload that contains the status of the store. This is an example response of the JSON payload: ```json { "status": "created" } ``` The operation also returns attributes that aren’t within the main JSON payload, which include information about token usage, for example: ```json { "storeName": "knowledge-store" } ``` ## Configure the Embedding Add Document to Store Operation The **Embedding add document to store** operation adds a document into an embedding store and exports it to a file. The document is ingested into the embedding using in-memory embedding. The in-memory embedding in MuleSoft AI Chain persists its data through file exports upon any changes. To configure the **Embedding add document to store** 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: - **Store Name** Contains the full file path for the embedding store to be saved. If the file already exists, it is overwritten. Ensure the file path is accessible. - **Context Path** Contains the full file path for the document to be ingested into the embedding store. - **Max Segment Size** Specifies the maximum size, in tokens or characters, of each segment that the document will be split into before being ingested into the embedding store. - **Max Overlap Size** Defines the number of tokens or characters that will overlap between consecutive segments when splitting the document. 3. In the **Context** section for the operation, select **File Type**: - **any** Automatically detects the file format and processes it accordingly. This option allows flexibility when the file type is unknown or varied. - **text** Text files, such as JSON, XML, TXT, and CSV. - **url** A single URL pointing to web content to ingest. This is the XML configuration for this operation: ```xml ``` ### Output Configuration This operation responds with a JSON payload containing the status of the store. This is an example response of the JSON payload: ```json { "status": "updated" } ``` In addition to the main payload, file-related metadata attributes, such as the file path, store name, and file type, are returned separately, for example: ```json { "filePath": "/Users/john.wick/Downloads/mulechain.txt", "storeName": "/Users/john.wick/Downloads/knowledge-store", "fileType": "text" } ``` ## Configure the Embedding Add Folder to Store Operation The **Embedding add folder to store** operation adds a complete folder with subfolder files into an embedding store and exports it to a file. The documents are ingested into the embedding using in-memory embedding. The in-memory embedding in MuleSoft AI Chain persists its data through file exports upon any changes. To configure the **Embedding add folder to store** 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: - **Store Name** Contains the full file path for the embedding store to be saved. If the file already exists, it is overwritten. Ensure the file path is accessible. - **Context Path** Contains the full folder path to use for ingesting into the embedding store. - **Max Segment Size** Specifies the maximum size, in tokens or characters, of each segment that the document is split into before the embedding store ingests it. - **Max Overlap Size** Defines the number of tokens or characters that will overlap between consecutive segments when splitting the document. 3. In the **Context** section for the operation, select the **File Type**: - **any** Automatically detects the file format and processes it accordingly. This option allows flexibility when the file type is unknown or varied. - **text** Text files, such as JSON, XML, TXT, and CSV. - **url** A single URL pointing to web content to ingest. This is the XML configuration for this operation: ```xml ``` ### Output Configuration This operation returns a json payload containing the status of the store. In addition, folder-related metadata attributes, such as the folder path, file count, and store name, are provided separately from the main payload. This is an example response of the JSON payload: ```json { "status": "updated" } ``` Along with the JSON payload, the operation returns attributes, which include information about the ingested folder, for example: ```json { "folderPath": "/Users/john.wick/Downloads/files", (1) "filesCount": 3, (2) "storeName": "/Users/john.wick/Downloads/knowledge-store" (3) } ```
1folderPath Absolute path to the folder where the files are located
2filesCount Total number of files in the specified folder
3storeName Name or path of the knowledge store where the processed document is stored
## Configure the Embedding Query From Store Operation The **Embedding query from store** operation retrieves information based on a plain text prompt using semantic search from an in-memory embedding store. This operation does not involve the use of a large language model (LLM). Instead, it directly searches the embedding store for relevant text segments based on the prompt. The embedding store is loaded into memory prior to retrieval. To configure the **Embedding query from store** 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: - **Store Name** Contains the full file path for the embedding store to be saved. If the file already exists, it is overwritten. Ensure the file path is accessible. - **Question** The plain text prompt to send to the in-memory vector store, which is converted into embedding and used for semantic search to find similar text segments. - **Max Results** Specifies the maximum number of results to be returned with the query. - **Min Score** Defines the minimum score to be used to identify and return results. - **Get Latest** If true, the store file is loaded each time before running this operation, which might slow down performance. It is best to use this flag only when building the knowledge store. After your app is deployed, set it to false for better performance. This is the XML configuration for this operation: ```xml ``` ### Output Configuration This operation returns a JSON payload that contains the main response and a list of relevant sources retrieved from the knowledge store. Each source includes details such as the file path, text segment, and similarity score. This is an example response of the JSON payload: ```json { "response": "Networking Guide for more information on how to access an application in a specific CloudHub worker.", "sources": [ { "absoluteDirectoryPath": "/Users/john.wick/Documents/Downloads/patch 8", "textSegment": "Networking Guide for more information on how to access an application in a specific CloudHub worker.", "individualScore": 0.7865373025380039, "file_name": "docs-runtime-manager__cloudhub_modules_ROOT_pages_cloudhub-fabric.adoc" }, { "absoluteDirectoryPath": "/Users/john.wick/Documents/Downloads/patch 8", "textSegment": "= CloudHub High Availability Features", "individualScore": 0.7845498154294348, "file_name": "docs-runtime-manager__cloudhub_modules_ROOT_pages_cloudhub-fabric.adoc" }, { "absoluteDirectoryPath": "/Users/john.wick/Documents/Downloads/patch 8", "textSegment": "[%header,cols=\"2*a\"]|===|VM Queues in On-Premises Applications |VM Queues in Applications deployed to CloudHub", "individualScore": 0.757268680397361, "file_name": "docs-runtime-manager__cloudhub_modules_ROOT_pages_cloudhub-fabric.adoc" } ] } ``` Additionally, token usage and query-related metadata are returned separately as attributes, for example: ```json { "minScore": 0.7, (1) "question": "Who is Amir", (2) "maxResults": 3, (3) "storeName": "/Users/john.wick/Downloads/embedding.store" (4) } ```
1minScore

Minimum similarity score required for a result to be included in the response

2question

The original query or question submitted by the user

3maxResults

Maximum number of results that can be returned for the query

4storeName

The path or name of the knowledge store used to retrieve the data

## Configure the Embedding Get Info from Store Operation The **Embedding get info from store** operation retrieves information from an in-memory embedding store based on a plain text prompt. This operation uses a large language model (LLM) to enhance the response by interpreting the retrieved information and generating a more comprehensive or contextually enriched answer. The embedding store is loaded into memory prior to retrieval, and the LLM processes the results to refine the final response. To configure the **Embedding get info from store** 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** The plain text prompt to send to the in-memory vector store, which is converted into embedding and used for semantic search to find similar text segments. - **Store Name** Contains the full file path for the embedding store to be saved. If the file already exists, it is overwritten. Ensure the file path is accessible. - **Get Latest** If true, the store file is loaded each time before running this operation, which might slow down performance. It is best to use this flag only when building the knowledge store. After your app is deployed, set it to false for better performance. This is the XML configuration for this operation: ```xml ``` ## Output Configuration This operation returns a JSON payload that contains the main LLM response, along with a list of relevant sources retrieved from the knowledge store. Each source includes information such as the file path, file name, and a segment of relevant text. Additionally, token usage and query-related metadata are provided separately as attributes. This is an example response of the JSON payload: ```json { "response": "Runtime Manager is a feature within CloudHub that provides scalability, workload distribution, and added reliability to applications.", "sources": [ { "absoluteDirectoryPath": "/Users/john.wick/Documents/Downloads/patch 8", "fileName": "docs-runtime-manager__cloudhub_modules_ROOT_pages_cloudhub-fabric.adoc", "textSegment": "= CloudHub High Availability Features..." } ] } ``` Additionally, token usage and query-related metadata are returned separately as attributes, for example: ```json { "tokenUsage": { (1) "outputCount": 89, "totalCount": 702, "inputCount": 613 }, "additionalAttributes": { (2) "getLatest": "true", "question": "What is MuleChain", "storeName": "/Users/john.wick/Downloads/knowledge-store" } } ```
1tokenUsage: Provides information on the token usage for the operation:
  • outputCount

    Number of tokens generated in the response totalCount

    Total number of tokens processed for the entire operation, including input and output

  • inputCount

    Number of tokens processed from the input query or document

2additionalAttributes includes metadata related to the query and store:
  • getLatest

    Indicates whether the knowledge store is reloaded for each operation (true/false).

  • question

    The original query or question submitted by the user.

  • storeName

    The path or name of the knowledge store used in the operation.

## See Also - [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [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) --- product: MuleSoft AI Chain Connector version: 2.0 is-latest-version: true --- # Configuring Embeddings Operations > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Embeddings operations include: - [Embedding new store](#new-store-operation) - [Embedding add document to store](#add-document-to-store) - [Embedding add folder to store](#add-folder-to-store) - [Embedding query from store](#embedding-query-from-store) - [Embedding get info from store](#get-info-from-store) ## Configure the Embedding New Store Operation The **Embedding new store** operation creates a new in-memory embedding and exports it to a physical file. The in-memory embedding in MuleSoft AI Chain persists its data through file exports upon any changes. To configure the **Embedding new store** operation: 1. Select the operation on the Anypoint Code Builder or Studio canvas. 2. In the **General** properties section, configure the full file path for the embedding store to save in **Store Name**. If the file already exists, it is overwritten. Ensure the file path is accessible. You can also use a DataWeave expression for this field, for example: ```dataweave mule.home ++ "/apps/" ++ app.name ++ payload.storeName ``` This is the XML configuration for this operation: ```xml ``` ### Output Configuration This operation responds with a JSON payload that contains the status of the store. This is an example response of the JSON payload: ```json { "status": "created" } ``` The operation also returns attributes that aren’t within the main JSON payload, which include information about token usage, for example: ```json { "storeName": "knowledge-store" } ``` ## Configure the Embedding Add Document to Store Operation The **Embedding add document to store** operation adds a document into an embedding store and exports it to a file. The document is ingested into the embedding using in-memory embedding. The in-memory embedding in MuleSoft AI Chain persists its data through file exports upon any changes. To configure the **Embedding add document to store** 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: - **Store Name** Contains the full file path for the embedding store to be saved. If the file already exists, it is overwritten. Ensure the file path is accessible. - **Context Path** Contains the full file path for the document to be ingested into the embedding store. - **Max Segment Size** Specifies the maximum size, in tokens or characters, of each segment that the document will be split into before being ingested into the embedding store. - **Max Overlap Size** Defines the number of tokens or characters that will overlap between consecutive segments when splitting the document. 3. In the **Context** section for the operation, select **File Type**: - **any** Automatically detects the file format and processes it accordingly. This option allows flexibility when the file type is unknown or varied. - **text** Text files, such as JSON, XML, TXT, and CSV. - **url** A single URL pointing to web content to ingest. This is the XML configuration for this operation: ```xml ``` ### Output Configuration This operation responds with a JSON payload containing the status of the store. This is an example response of the JSON payload: ```json { "status": "updated" } ``` In addition to the main payload, file-related metadata attributes, such as the file path, store name, and file type, are returned separately, for example: ```json { "filePath": "/Users/john.wick/Downloads/mulechain.txt", "storeName": "/Users/john.wick/Downloads/knowledge-store", "fileType": "text" } ``` ## Configure the Embedding Add Folder to Store Operation The **Embedding add folder to store** operation adds a complete folder with subfolder files into an embedding store and exports it to a file. The documents are ingested into the embedding using in-memory embedding. The in-memory embedding in MuleSoft AI Chain persists its data through file exports upon any changes. To configure the **Embedding add folder to store** 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: - **Store Name** Contains the full file path for the embedding store to be saved. If the file already exists, it is overwritten. Ensure the file path is accessible. - **Context Path** Contains the full folder path to use for ingesting into the embedding store. - **Max Segment Size** Specifies the maximum size, in tokens or characters, of each segment that the document is split into before the embedding store ingests it. - **Max Overlap Size** Defines the number of tokens or characters that will overlap between consecutive segments when splitting the document. 3. In the **Context** section for the operation, select the **File Type**: - **any** Automatically detects the file format and processes it accordingly. This option allows flexibility when the file type is unknown or varied. - **text** Text files, such as JSON, XML, TXT, and CSV. - **url** A single URL pointing to web content to ingest. This is the XML configuration for this operation: ```xml ``` ### Output Configuration This operation returns a json payload containing the status of the store. In addition, folder-related metadata attributes, such as the folder path, file count, and store name, are provided separately from the main payload. This is an example response of the JSON payload: ```json { "status": "updated" } ``` Along with the JSON payload, the operation returns attributes, which include information about the ingested folder, for example: ```json { "folderPath": "/Users/john.wick/Downloads/files", (1) "filesCount": 3, (2) "storeName": "/Users/john.wick/Downloads/knowledge-store" (3) } ```
1folderPath Absolute path to the folder where the files are located
2filesCount Total number of files in the specified folder
3storeName Name or path of the knowledge store where the processed document is stored
## Configure the Embedding Query From Store Operation The **Embedding query from store** operation retrieves information based on a plain text prompt using semantic search from an in-memory embedding store. This operation does not involve the use of a large language model (LLM). Instead, it directly searches the embedding store for relevant text segments based on the prompt. The embedding store is loaded into memory prior to retrieval. To configure the **Embedding query from store** 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: - **Store Name** Contains the full file path for the embedding store to be saved. If the file already exists, it is overwritten. Ensure the file path is accessible. - **Question** The plain text prompt to send to the in-memory vector store, which is converted into embedding and used for semantic search to find similar text segments. - **Max Results** Specifies the maximum number of results to be returned with the query. - **Min Score** Defines the minimum score to be used to identify and return results. - **Get Latest** If true, the store file is loaded each time before running this operation, which might slow down performance. It is best to use this flag only when building the knowledge store. After your app is deployed, set it to false for better performance. This is the XML configuration for this operation: ```xml ``` ### Output Configuration This operation returns a JSON payload that contains the main response and a list of relevant sources retrieved from the knowledge store. Each source includes details such as the file path, text segment, and similarity score. This is an example response of the JSON payload: ```json { "response": "Networking Guide for more information on how to access an application in a specific CloudHub worker.", "sources": [ { "absoluteDirectoryPath": "/Users/john.wick/Documents/Downloads/patch 8", "textSegment": "Networking Guide for more information on how to access an application in a specific CloudHub worker.", "individualScore": 0.7865373025380039, "file_name": "docs-runtime-manager__cloudhub_modules_ROOT_pages_cloudhub-fabric.adoc" }, { "absoluteDirectoryPath": "/Users/john.wick/Documents/Downloads/patch 8", "textSegment": "= CloudHub High Availability Features", "individualScore": 0.7845498154294348, "file_name": "docs-runtime-manager__cloudhub_modules_ROOT_pages_cloudhub-fabric.adoc" }, { "absoluteDirectoryPath": "/Users/john.wick/Documents/Downloads/patch 8", "textSegment": "[%header,cols=\"2*a\"]|===|VM Queues in On-Premises Applications |VM Queues in Applications deployed to CloudHub", "individualScore": 0.757268680397361, "file_name": "docs-runtime-manager__cloudhub_modules_ROOT_pages_cloudhub-fabric.adoc" } ] } ``` Additionally, token usage and query-related metadata are returned separately as attributes, for example: ```json { "minScore": 0.7, (1) "question": "Who is Amir", (2) "maxResults": 3, (3) "storeName": "/Users/john.wick/Downloads/embedding.store" (4) } ```
1minScore

Minimum similarity score required for a result to be included in the response

2question

The original query or question submitted by the user

3maxResults

Maximum number of results that can be returned for the query

4storeName

The path or name of the knowledge store used to retrieve the data

## Configure the Embedding Get Info from Store Operation The **Embedding get info from store** operation retrieves information from an in-memory embedding store based on a plain text prompt. This operation uses a large language model (LLM) to enhance the response by interpreting the retrieved information and generating a more comprehensive or contextually enriched answer. The embedding store is loaded into memory prior to retrieval, and the LLM processes the results to refine the final response. To configure the **Embedding get info from store** 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** The plain text prompt to send to the in-memory vector store, which is converted into embedding and used for semantic search to find similar text segments. - **Store Name** Contains the full file path for the embedding store to be saved. If the file already exists, it is overwritten. Ensure the file path is accessible. - **Get Latest** If true, the store file is loaded each time before running this operation, which might slow down performance. It is best to use this flag only when building the knowledge store. After your app is deployed, set it to false for better performance. This is the XML configuration for this operation: ```xml ``` ## Output Configuration This operation returns a JSON payload that contains the main LLM response, along with a list of relevant sources retrieved from the knowledge store. Each source includes information such as the file path, file name, and a segment of relevant text. Additionally, token usage and query-related metadata are provided separately as attributes. This is an example response of the JSON payload: ```json { "response": "Runtime Manager is a feature within CloudHub that provides scalability, workload distribution, and added reliability to applications.", "sources": [ { "absoluteDirectoryPath": "/Users/john.wick/Documents/Downloads/patch 8", "fileName": "docs-runtime-manager__cloudhub_modules_ROOT_pages_cloudhub-fabric.adoc", "textSegment": "= CloudHub High Availability Features..." } ] } ``` Additionally, token usage and query-related metadata are returned separately as attributes, for example: ```json { "tokenUsage": { (1) "outputCount": 89, "totalCount": 702, "inputCount": 613 }, "additionalAttributes": { (2) "getLatest": "true", "question": "What is MuleChain", "storeName": "/Users/john.wick/Downloads/knowledge-store" } } ```
1tokenUsage: Provides information on the token usage for the operation:
  • outputCount

    Number of tokens generated in the response totalCount

    Total number of tokens processed for the entire operation, including input and output

  • inputCount

    Number of tokens processed from the input query or document

2additionalAttributes includes metadata related to the query and store:
  • getLatest

    Indicates whether the knowledge store is reloaded for each operation (true/false).

  • question

    The original query or question submitted by the user.

  • storeName

    The path or name of the knowledge store used in the operation.

## See Also - [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [MuleSoft AI Chain Connector Overview](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/) - [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference) - [Salesforce Help](https://help.salesforce.com) --- product: MuleSoft AI Chain Connector version: 1.0 --- # Configuring Image Generation 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 Image Read Operation The **Image read** operation reads and interprets an image based on a prompt. Currently, MuleSoft AI Chain Connector supports only OpenAI Image Models. To configure the **Image read** 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. - **ContextUrl** Contains the URL to the image file to read. This is the XML configuration for this operation: ```xml ``` ### Output Configuration This operation responds with a JSON payload containing the main LLM response. Additionally, attributes such as token usage are included as part of the metadata (attributes), but not within the main payload. This is an example response of the JSON payload: ```json { "response": "The image depicts a group of men in what appears to be a stadium or arena setting. They are standing in the stands, with some looking agitated or engaged in a discussion." } ``` Along with the JSON payload, the operation also returns attributes, which include information about token usage, for example: ```json { "attributes": { "tokenUsage": { "outputCount": 87, "totalCount": 187, "inputCount": 100 }, "additionalAttributes": {} } } ``` ## Configure the Image Generate Operation The **Image generate** operation generates an image based on a prompt sent to the LLM. Currently, MuleSoft AI Chain Connector supports only OpenAI Image Models. To configure the **Image generate** operation: 1. Select the operation on the Studio canvas. 2. In the **General** properties section, configure the **Data** field with the prompt for generating the image, for example, `payload.prompt`. This is the XML configuration for this operation: ```xml ``` ### Output Configuration This operation responds with a JSON payload containing the URL of the generated image, for example: ```json { "response": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-dP8odnP25FlwTi1fOMr1X7vO/user-Jyi0vNlYu4mjEBZl9Mu1lXBW/img-bEO12CWIRI7CkGUjfz5ajAlS.png" } ``` ## See Also - [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [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) --- product: MuleSoft AI Chain Connector version: 2.0 is-latest-version: true --- # Configuring Image Generation Operations > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## Configure the Image Read Operation The **Image read** operation reads and interprets an image based on a prompt. Currently, MuleSoft AI Chain Connector supports only OpenAI Image Models. To configure the **Image read** 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. - **Context URL** Contains the URL to the image file to read. This is the XML configuration for this operation: ```xml ``` ### Output Configuration This operation responds with a JSON payload containing the main LLM response. Additionally, attributes such as token usage are included as part of the metadata (attributes), but not within the main payload. This is an example response of the JSON payload: ```json { "response": "The image depicts a group of men in what appears to be a stadium or arena setting. They are standing in the stands, with some looking agitated or engaged in a discussion." } ``` Along with the JSON payload, the operation also returns attributes, which include information about token usage, for example: ```json { "attributes": { "tokenUsage": { "outputCount": 87, "totalCount": 187, "inputCount": 100 }, "additionalAttributes": {} } } ``` ## Configure the Image Generate Operation The **Image generate** operation generates an image based on a prompt sent to the LLM. Currently, MuleSoft AI Chain Connector supports only OpenAI Image Models. To configure the **Image generate** operation: 1. Select the operation on the Studio canvas. 2. In the **General** properties section, configure the **Data** field with the prompt for generating the image, for example, `payload.prompt`. This is the XML configuration for this operation: ```xml ``` ### Output Configuration This operation responds with a JSON payload containing the URL of the generated image, for example: ```json { "response": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-dP8odnP25FlwTi1fOMr1X7vO/user-Jyi0vNlYu4mjEBZl9Mu1lXBW/img-bEO12CWIRI7CkGUjfz5ajAlS.png" } ``` ## See Also - [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [MuleSoft AI Chain Connector Overview](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/) - [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference) - [Salesforce Help](https://help.salesforce.com) --- product: MuleSoft AI Chain Connector version: 1.0 --- # Configuring RAG 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. Retrieval-Augmented Generation (RAG) is a technique for enhancing AI-generated outputs by retrieving relevant content, and using it to augment AI prompts with additional context. By grounding LLMs with this additional information, they can provide more accurate and reliable responses. ## Configure the RAG Load Document Operation The **RAG load document** operation retrieves information based on a plain text prompt from an in-memory embedding store. To configure the **RAG load document** 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** The prompt to send to the LLM and the embedding store to respond to. - **Context Path** Contains the full file path for the document to ingest into the embedding store. Ensure the file path is accessible. You can also use a DataWeave expression for this field, for example: ```dataweave mule.home ++ "/apps/" ++ app.name ++ "/customer-service.pdf" ``` 3. In the **Context** section for the operation, select the **File Type**: - **text** Text files, such as JSON, XML, TXT, and CSV. - **URL** A single URL pointing to web content to ingest. This is the XML configuration for this operation: ```xml ``` ## Output Configuration This operation responds with a JSON payload that contains the main LLM response. Additionally, attributes such as token usage are included as part of the metadata (attributes), but not within the main payload. This is an example response of the JSON payload: ```json { "response": "Wakanda, a technologically advanced and environmentally conscious nation in Africa, is renowned for its unique integration of ancient traditions with cutting-edge innovations, powered by the rare metal Vibranium. With a population of 12.5 million, it emphasizes sustainable growth, quality education, and healthcare, while maintaining a zero carbon footprint through advanced eco-tech solutions. Despite its peaceful nature, Wakanda's formidable military and cultural heritage, led by King T’Challa and the Dora Milaje, ensure its resilience and unity as a symbol of progress and tradition." } ``` 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": {} } ``` - `tokenUsage` Token usage metadata returned as attributes - `outputCount` Number of tokens used to generate the output - `totalCount` Total number of tokens used for input and output - `inputCount` Number of tokens used to process the input ## See Also - [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [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) --- product: MuleSoft AI Chain Connector version: 2.0 is-latest-version: true --- # Configuring RAG Operations > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Retrieval-Augmented Generation (RAG) is a technique for enhancing AI-generated outputs by retrieving relevant content, and using it to augment AI prompts with additional context. By grounding LLMs with this additional information, they can provide more accurate and reliable responses. ## Configure the RAG Load Document Operation The **RAG load document** operation retrieves information based on a plain text prompt from an in-memory embedding store. To configure the **RAG load document** 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** The prompt to send to the LLM and the embedding store to respond to. - **Context Path** Contains the full file path for the document to ingest into the embedding store. Ensure the file path is accessible. You can also use a DataWeave expression for this field, for example: ```dataweave mule.home ++ "/apps/" ++ app.name ++ "/customer-service.pdf" ``` 3. In the **Context** section for the operation, select the **File Type**: - **text** Text files, such as JSON, XML, TXT, and CSV. - **URL** A single URL pointing to web content to ingest. This is the XML configuration for this operation: ```xml ``` ## Output Configuration This operation responds with a JSON payload that contains the main LLM response. Additionally, attributes such as token usage are included as part of the metadata (attributes), but not within the main payload. This is an example response of the JSON payload: ```json { "response": "Wakanda, a technologically advanced and environmentally conscious nation in Africa, is renowned for its unique integration of ancient traditions with cutting-edge innovations, powered by the rare metal Vibranium. With a population of 12.5 million, it emphasizes sustainable growth, quality education, and healthcare, while maintaining a zero carbon footprint through advanced eco-tech solutions. Despite its peaceful nature, Wakanda's formidable military and cultural heritage, led by King T’Challa and the Dora Milaje, ensure its resilience and unity as a symbol of progress and tradition." } ``` 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": {} } ``` - `tokenUsage` Token usage metadata returned as attributes - `outputCount` Number of tokens used to generate the output - `totalCount` Total number of tokens used for input and output - `inputCount` Number of tokens used to process the input ## See Also - [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [MuleSoft AI Chain Connector Overview](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/) - [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference) - [Salesforce Help](https://help.salesforce.com) --- product: MuleSoft AI Chain Connector version: 1.0 --- # Configuring Sentiment 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 Sentiment Analyzer Operation Use the **Sentiment analyzer** operation to send a simple prompt request to the configured LLM. This operation uses a plain text prompt as input and responds with a sentiment for the input text. The sentiment value can be NEUTRAL, POSITIVE, or NEGATIVE. To configure the **Sentiment analyzer** operation: 1. Select the operation on the Studio canvas. 2. In the **General** properties section, enter plain text to analyze for its sentiment in the **Prompt** field. This is the XML configuration for this operation: ```xml ``` ### Output Configuration This operation responds with a JSON payload that contains the sentiment of the input text. Additionally, attributes such as token usage and sentiment details are included as part of the metadata (attributes) but not within the main payload. This is an example response of the JSON payload: ```json { "response": "POSITIVE" } ``` Along with the JSON payload, the operation returns attributes, which include information about token usage, for example: ```json { "tokenUsage": { "outputCount": 2, "totalCount": 39, "inputCount": 37 }, "additionalAttributes": { "isPositive": "false" } } ``` ## See Also - [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [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) --- product: MuleSoft AI Chain Connector version: 2.0 is-latest-version: true --- # Configuring Sentiment Operations > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## Configure the Sentiment Analyzer Operation Use the **Sentiment analyzer** operation to send a simple prompt request to the configured LLM. This operation uses a plain text prompt as input and responds with a sentiment for the input text. The sentiment value can be NEUTRAL, POSITIVE, or NEGATIVE. To configure the **Sentiment analyzer** operation: 1. Select the operation on the Studio canvas. 2. In the **General** properties section, enter plain text to analyze for its sentiment in the **Prompt** field. This is the XML configuration for this operation: ```xml ``` ### Output Configuration This operation responds with a JSON payload that contains the sentiment of the input text. Additionally, attributes such as token usage and sentiment details are included as part of the metadata (attributes) but not within the main payload. This is an example response of the JSON payload: ```json { "response": "POSITIVE" } ``` Along with the JSON payload, the operation returns attributes, which include information about token usage, for example: ```json { "tokenUsage": { "outputCount": 2, "totalCount": 39, "inputCount": 37 }, "additionalAttributes": { "isPositive": "false" } } ``` ## See Also - [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [MuleSoft AI Chain Connector Overview](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/) - [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference) - [Salesforce Help](https://help.salesforce.com) --- product: MuleSoft AI Chain Connector version: 1.0 --- # Configuring Tools 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. ## Before You Begin To use Tools operations, you must create a `tools.config.json` file that includes all the necessary API information for the operation to execute APIs successfully, for example: ```json [ { "action": "Execute POST requests for API endpoints.", "url": "http://check-inventory-material.cloudhub.io/mmbe", "name": "Check Inventory", "method": "POST", "headers": "Basic XXX", "example-payload": "{\n \"materialNo\": \"paramValue\"}", "query": [ "Check inventory in SAP", "Check Stock Overview", "Show product availability for MULETEST0", "Check the inventory for MULETEST0", "Check Stock for 400-110" ], "description": "Check inventory details for material in SAP by providing the materialNo as input for paramValue. Please use the materialNo and not materialNumber. This action applies whenever users' intent is 'Stock overview', 'product availability', 'Inventory', 'available stock'. Use the headers to perform the request." }, { "action": "Execute GET requests for API endpoints.", "url": "https://anypoint.mulesoft.com/mocking/api/v1/sources/exchange/assets/612eb739-4266-4f4c-bf2f-29953c153d80/accounts-api/1.0.1/m/accounts", "name": "Show Accounts", "method": "GET", "headers": "", "example-payload": "{}", "query": ["Get all accounts", "Show all accounts from CRM"], "description": "Get all accounts from a CRM. This action applies whenever users' intent is 'CRM accounts', 'customers', 'customer accounts', 'accounts'." }, { "action": "Execute GET requests for API endpoints.", "url": "https://anypoint.mulesoft.com/mocking/api/v1/sources/exchange/assets/7b99cead-a984-497b-9e6c-c16a3b4dcb76/employee-api/1.0.1/m/employees", "name": "Show Employees", "method": "GET", "headers": "", "example-payload": "{}", "query": [ "Get all employee information", "Show employees for the country Switzerland", "How many employees do we have", "Show a list of all employees" ], "description": "Get all information about employees. This action applies whenever users' intent is 'employees', 'workforce'." } ] ``` Each object in the tools array represents a tool that the autonomous agent can use, so it is important to describe each field as accurately as possible. - `action` This field supports the following options: - `Execute GET` requests for API endpoints. - `Execute POST` requests for API endpoints. - `url` The complete URL to the endpoint, including the resource path. - `name` The name of the action in natural language. - `method` The HTTP method for the endpoint. Only POST and GET are supported. - `headers` The HTTP headers required for authorization to the endpoint. Only Basic Auth is supported. - `example-payload` The example payload in JSON format. - `query` Example queries a user might use to invoke this action. - `description` A detailed description of how to use the tool. The description should be comprehensive enough for the LLM to understand its purpose and usage. Ensure that the file path to the `tools.config.json` is accessible to the application at runtime. ## Configure the Tools Use AI Service Operation The **Tools use AI service** operation is useful if you want to create autonomous agents that can use external tools whenever a prompt can’t be answered directly by the AI model. To configure the **Tools use AI service** 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** The prompt to send to the LLM. - **Tool Config** The full file path to the `tools.config.json` file. Ensure the file path is accessible. You can also use a DataWeave expression for this field, for example: ```dataweave mule.home ++ "/apps/" ++ app.name ++ "/tools.config.json" ``` This is the XML configuration for this operation: ```xml ``` ### Output Configuration This operation responds with a JSON payload that contains the main LLM response. Additionally, attributes such as token usage and tool usage (boolean value) are included as part of the attributes, but not within the main payload. This is an example response of the JSON payload if the prompt is "What is the capital of Switzerland?": ```json { "response": "The capital of Switzerland is Bern." } ``` If the prompt requires accessing external data through a tool, for example, "Show me the latest account created in Salesforce", the AI model uses the configured tool to fetch the information, resulting in: ```json { "response": "The latest account created in Salesforce is:\n\n- **Name:** MuleTalks\n- **Id:** 0010600002JKf42AAD\n- **Created Date:** 2024-07-10T20:21:36.000Z\n\nIf you have any further questions or need additional assistance, feel free to ask!" } ``` Along with the JSON payload, the operation returns attributes, which include information about token and tool usage, for example: ```json { "tokenUsage": { (1) "outputCount": 9, "totalCount": 18, "inputCount": 9 }, "additionalAttributes": { (2) "toolsUsed": "true" } } ```
1tokenUsage: Provides information on the token usage for the operation:
  • outputCount

    Number of tokens generated in the response

  • totalCount

    Total number of tokens processed for the entire operation, including input and output

  • inputCount

    Number of tokens processed from the input query or document

2additionalAttributes includes the boolean value for toolsUsed:
  • true

    External tools, such as APIs or integrations, were used to gather or generate the response.

  • false

    No external tools were used, and the response was based on internal knowledge only.

## See Also - [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [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) --- product: MuleSoft AI Chain Connector version: 2.0 is-latest-version: true --- # Configuring Tools Operations > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## Before You Begin To use Tools operations, you must create a `tools.config.json` file that includes all the necessary API information for the operation to execute APIs successfully, for example: ```json [ { "action": "Execute POST requests for API endpoints.", "url": "http://check-inventory-material.cloudhub.io/mmbe", "name": "Check Inventory", "method": "POST", "headers": "Basic XXX", "example-payload": "{\n \"materialNo\": \"paramValue\"}", "query": [ "Check inventory in SAP", "Check Stock Overview", "Show product availability for MULETEST0", "Check the inventory for MULETEST0", "Check Stock for 400-110" ], "description": "Check inventory details for material in SAP by providing the materialNo as input for paramValue. Please use the materialNo and not materialNumber. This action applies whenever users' intent is 'Stock overview', 'product availability', 'Inventory', 'available stock'. Use the headers to perform the request." }, { "action": "Execute GET requests for API endpoints.", "url": "https://anypoint.mulesoft.com/mocking/api/v1/sources/exchange/assets/612eb739-4266-4f4c-bf2f-29953c153d80/accounts-api/1.0.1/m/accounts", "name": "Show Accounts", "method": "GET", "headers": "", "example-payload": "{}", "query": ["Get all accounts", "Show all accounts from CRM"], "description": "Get all accounts from a CRM. This action applies whenever users' intent is 'CRM accounts', 'customers', 'customer accounts', 'accounts'." }, { "action": "Execute GET requests for API endpoints.", "url": "https://anypoint.mulesoft.com/mocking/api/v1/sources/exchange/assets/7b99cead-a984-497b-9e6c-c16a3b4dcb76/employee-api/1.0.1/m/employees", "name": "Show Employees", "method": "GET", "headers": "", "example-payload": "{}", "query": [ "Get all employee information", "Show employees for the country Switzerland", "How many employees do we have", "Show a list of all employees" ], "description": "Get all information about employees. This action applies whenever users' intent is 'employees', 'workforce'." } ] ``` Each object in the tools array represents a tool that the autonomous agent can use, so it is important to describe each field as accurately as possible. - `action` This field supports the following options: - `Execute GET` requests for API endpoints. - `Execute POST` requests for API endpoints. - `url` The complete URL to the endpoint, including the resource path. - `name` The name of the action in natural language. - `method` The HTTP method for the endpoint. Only POST and GET are supported. - `headers` The HTTP headers required for authorization to the endpoint. Only Basic Auth is supported. - `example-payload` The example payload in JSON format. - `query` Example queries a user might use to invoke this action. - `description` A detailed description of how to use the tool. The description should be comprehensive enough for the LLM to understand its purpose and usage. Ensure that the file path to the `tools.config.json` is accessible to the application at runtime. ## Configure the Tools Use AI Service Operation The **Tools use AI service** operation is useful if you want to create autonomous agents that can use external tools whenever a prompt can’t be answered directly by the AI model. This operation supports tool use with Ollama chat models. To configure the **Tools use AI service** 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** The prompt to send to the LLM. - **Tool Config** The full file path to the `tools.config.json` file. Ensure the file path is accessible. You can also use a DataWeave expression for this field, for example: ```dataweave mule.home ++ "/apps/" ++ app.name ++ "/tools.config.json" ``` This is the XML configuration for this operation: ```xml ``` ### Output Configuration This operation responds with a JSON payload that contains the main LLM response. Additionally, attributes such as token usage and tool usage (boolean value) are included as part of the attributes, but not within the main payload. This is an example response of the JSON payload if the prompt is "What is the capital of Switzerland?": ```json { "response": "The capital of Switzerland is Bern." } ``` If the prompt requires accessing external data through a tool, for example, "Show me the latest account created in Salesforce", the AI model uses the configured tool to fetch the information, resulting in: ```json { "response": "The latest account created in Salesforce is:\n\n- **Name:** MuleTalks\n- **Id:** 0010600002JKf42AAD\n- **Created Date:** 2024-07-10T20:21:36.000Z\n\nIf you have any further questions or need additional assistance, feel free to ask!" } ``` Along with the JSON payload, the operation returns attributes, which include information about token and tool usage, for example: ```json { "tokenUsage": { (1) "outputCount": 9, "totalCount": 18, "inputCount": 9 }, "additionalAttributes": { (2) "toolsUsed": "true" } } ```
1tokenUsage: Provides information on the token usage for the operation:
  • outputCount

    Number of tokens generated in the response

  • totalCount

    Total number of tokens processed for the entire operation, including input and output

  • inputCount

    Number of tokens processed from the input query or document

2additionalAttributes includes the boolean value for toolsUsed:
  • true

    External tools, such as APIs or integrations, were used to gather or generate the response.

  • false

    No external tools were used, and the response was based on internal knowledge only.

## See Also - [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [MuleSoft AI Chain Connector Overview](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/) - [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference) - [Salesforce Help](https://help.salesforce.com) --- product: MuleSoft AI Chain Connector version: 1.0 --- # MuleSoft AI Chain - Additional Configuration Information > 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. MuleSoft AI Chain Connector supports 15 operations, categorized into: - [Agent](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/configuring-agent-operations) - [Chat](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/configuring-chat-operations) - [Embeddings](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/configuring-embeddings-operations) - [Image generation](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/configuring-image-generation-operations) - [RAG](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/configuring-rag-operations) - [Sentiment](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/configuring-sentiment-operations) - [Tools](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/configuring-tools-operations) --- product: MuleSoft AI Chain Connector version: 2.0 is-latest-version: true --- # MuleSoft AI Chain - Additional Configuration Information > For the full documentation index, see: https://docs.mulesoft.com/llms.txt MuleSoft AI Chain Connector supports 16 operations, categorized into: - [Agent](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/configuring-agent-operations) - [Chat](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/configuring-chat-operations) - [Embeddings](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/configuring-embeddings-operations) - [Image generation](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/configuring-image-generation-operations) - [RAG](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/configuring-rag-operations) - [Sentiment](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/configuring-sentiment-operations) - [Tools](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/configuring-tools-operations) --- product: MuleSoft AI Chain Connector version: 1.0 --- # MuleSoft AI Chain Connector 1.0 > 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. Anypoint Connector for MuleSoft AI Chain (MuleSoft AI Chain Connector) helps developers design, build, and manage AI agents within Anypoint Platform. It provides the tools and support to integrate Large Language Models (LLMs), vector stores, and other advanced AI services into MuleSoft applications. MuleSoft AI Chain Connector supports 15 operations, categorized into: - Agent - Chat - Embeddings - Image generation - RAG - Sentiment - Tools For information about compatibility and fixed issues, see the MuleSoft AI Chain Connector release notes. ## Before You Begin To use this connector, you must be familiar with: - Anypoint Connectors - Mule runtime engine (Mule) - Elements and global elements in a Mule flow - How to create a Mule app using Anypoint Code Builder or Anypoint Studio Before creating an app, you must have: - Java 17 - Apache Maven - Credentials to access the MuleSoft AI Chain Connector target resource - Anypoint Platform - The latest versions of Anypoint Code Builder or Anypoint Studio ## Common Use Cases for the Connector ### Agent Operations Some common use cases for Agent operations include: - Customer Service Agents Enhance customer service by providing case summaries, case classifications, large dataset summaries, and more. - Sales Operation Agents Assist sales teams in writing sales emails, summarizing cases for specific accounts, assessing the probability of closing deals, and more. - Marketing Agents Support marketing teams in generating product descriptions, creating newsletters, planning social media campaigns, and more. ### Chat Operations Some common use cases for Chat operations include: - Basic chatbots that answer simple user prompts. - Customer service queries that provide direct answers to frequently asked questions. - Customer support chats that retain the context of the ongoing support conversations. - Multi-user chat applications that maintain the conversation history for different users. - Personal assistants that keep track of user interactions to provide more relevant responses. ### Embeddings Operations Some common use cases for Embeddings operations include: - Creating a new in-memory vector store for storing document embeddings. - Exporting an in-memory embedding to a physical file for persistence across sessions. - Querying a knowledge store with a plain text prompt and receiving a refined response powered by an LLM. - Retrieving and interpreting data from documents in an embedding store, with enhanced context from the LLM. - Adding documents, such as PDFs and text files, into an embedding store for future retrieval. - Adding a folder for documents, such as PDFs and text files, into an embedding store for future retrieval. - Ingesting documents from a specific directory into an in-memory embedding store for contextual analysis. - Querying a vector store for specific information using semantic search. - Retrieving multiple relevant documents or text segments from an embedding store based on a given prompt. ### Image Generation Operations Some common use cases for Image operations include: - Analyzing images in business reports, presentations, or customer service scenarios. - Generating content describing images for blog posts, articles, or social media. - Extracting visual insights from images in research or design projects. - Creating visuals for marketing and advertising campaigns based on specific descriptions. - Generating images for blog posts, articles, or social media based on given prompts. - Prototyping and design, such as quickly generating concept images from textual descriptions. ### RAG Operations Use Retrieval-Augmented Generation (RAG) operations to retrieve information from a document based on a plain text prompt. Some common use cases for Retrieval-Augmented Generation (RAG) operations include: - Knowledge Management Extract specific information from documents stored in a knowledge base. - Customer Support Retrieve relevant data from customer service documents to assist with inquiries. - Research Access information from research papers or documents based on specific queries. ### Sentiment Operations Use sentiment operations to analyze the sentiment of text, such as for: - Customer Feedback Analysis Determine whether customer feedback is positive, negative, or neutral. - Social Media Monitoring Analyze the sentiment of social media posts or comments to gauge public opinion. - Market Research Assess the sentiment of survey responses or market research data. ### Tools Operations Some common use cases for Tools operations include: - Automating Routine Tasks Create autonomous agents that handle routine tasks by calling appropriate APIs. - Customer Support Automate responses to common queries by integrating tools that provide necessary information. - Inventory Management Check inventory levels or order status based on user prompts. - Employee Management Retrieve employee information or manage employee-related tasks through API calls. - Sales and Marketing Access CRM data or manage leads and accounts efficiently using predefined tools. ## Next Step After you complete the prerequisites, you are ready to create an app and configure the connector using [Anypoint Studio](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-connector-studio) or [Anypoint Code Builder](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-connector-config-acb). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-connector-reference) - [MuleSoft AI Chain - Additional Configuration Information](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-additional-config) - [Salesforce Help](https://help.salesforce.com) --- product: MuleSoft AI Chain Connector version: 1.0 --- # MuleSoft AI Chain Connector 1.0 Reference > 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. The main class of an extension, is the entry point from which configurations, connection providers, operations and sources are declared. ## Configuration Default Configuration for MuleSoft AI Chain Connector. ### Parameters
NameTypeDescriptionDefault ValueRequired

Name

String

Name for this configuration. Connectors reference the configuration with this name.

x

LLM type

String

Large Language Model type:

  • Anthropic

  • Azure OpenAI

  • GroqAI

  • Hugging Face

  • Mistral AI

  • Ollama

  • OpenAI

x

Config Type

String

Configuration type:

  • Environment Variables

  • Configuration JSON

x

File Path

String

File path.

x

Model Name

String

Supported model for the chosen LLM.

x

Temperature

Number

Controls the randomness of the output.

0.7

LLM timeout

Number

Timeout for the LLM request.

60 seconds

LLM timeout unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit to use for the LLM timeout.

SECONDS

Max Tokens

Number

Defines the number of LLM tokens to use when generating a response.

500

Name

String

ID used to reference this configuration.

x

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

## Supported Operations - [AGENT Define Prompt Template](#AgentDefinePromptTemplate) - [CHAT Answer Prompt](#ChatAnswerPrompt) - [CHAT Answer Prompt With Memory](#ChatAnswerPromptWithMemory) - [EMBEDDING Get Info From Store](#EmbeddingGetInfoFromStore) - [EMBEDDING Get Info From Store Legacy](#EmbeddingGetInfoFromStoreLegacy) - [IMAGE Generate](#ImageGenerate) - [IMAGE Read](#ImageRead) - [IMAGE Read Scanned Documents](#ImageReadScannedDocuments) - [RAG Load Document](#RagLoadDocument) - [SENTIMENT Analyze](#SentimentAnalyze) - [TOOLS Use Ai Service](#ToolsUseAiService) - [TOOLS Use Ai Service Legacy](#ToolsUseAiServiceLegacy) ## Operations ### AGENT Define Prompt Template `` Helps in defining an AI Agent configured with a prompt template #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Dataset

String

Refers to the user query to act upon.

#[payload]

Template

String

Refers to sample template used by LLM to respond adequately to the user queries.

x

Instructions

String

This provides instructions to the LLM about how to understand and respond to the user queries.

x

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

### For Configurations - [Configuration](#Config) ### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE ### CHAT Answer Prompt `` Implements a simple Chat agent to enable chat with the LLM. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Prompt

String

User-defined prompt query.

#[payload]

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

### Output

Type

Any

Attributes Type

### For Configurations - [Configuration](#Config) ### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE ### CHAT Answer Prompt With Memory `` Implements a chat memory for a defined LLM as an AI Agent. The memoryName allows the multichannel profile design. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

Refers to the user prompt.

#[payload]

Memory Name

String

Name of the memory to fetch for further processing by the LLMs.

x

Db File Path

String

Location of the file containing the memory.

x

Max Messages

Number

Maximum number of messages to analyze for that memory.

x

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ### EMBEDDING Get Info From Store `` Reads information via prompt from embedding store (in-Memory), which is imported from the storeName (full path) #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

The user prompt or query.

#[payload]

Store Name

String

Name of the store to query.

x

Get Latest

Boolean

Determines whether to freshly fetch the store from the location.

false

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ### EMBEDDING Get Info From Store Legacy `` Reads information via a prompt from the embedding store (in-Memory), which is imported from the storeName (full path). #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

The user prompt or query.

#[payload]

Store Name

String

Name of the store to query.

x

Get Latest

Boolean

Determines whether to freshly fetch the store from the location.

false

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

Object

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ### IMAGE Generate `` Generates an image based on the prompt in data. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

The user prompt.

#[payload]

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:IMAGE\_ANALYSIS\_FAILURE - MS-AICHAIN:IMAGE\_GENERATION\_FAILURE - MS-AICHAIN:IMAGE\_PROCESSING\_FAILURE ### IMAGE Read `` Reads an image from a URL and provides the responses for the user prompts. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

The user prompt.

#[payload]

Context URL

String

Image URL to analyze.

x

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:IMAGE\_ANALYSIS\_FAILURE - MS-AICHAIN:IMAGE\_GENERATION\_FAILURE - MS-AICHAIN:IMAGE\_PROCESSING\_FAILURE ### IMAGE Read Scanned Documents `` Reads scanned documents and converts to response as prompted by the user. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

The user prompt.

#[payload]

File Path

String

Path to the file to analyze.

x

Output Mime Type

String

MIME type of the payload that this operation outputs.

Output Encoding

String

Encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:IMAGE\_ANALYSIS\_FAILURE - MS-AICHAIN:IMAGE\_GENERATION\_FAILURE - MS-AICHAIN:IMAGE\_PROCESSING\_FAILURE ### RAG Load Document `` Enables the user to query the doc provided in natural language. The doc is embedded into an in-memory vector store. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

Defines the query input provided by the user.

#[payload]

Context Path

String

Defines the file path that is embedded.

x

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

File Type

String

text

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ### SENTIMENT Analyze `` Analyzes the sentiment of the user data. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

Refers to the user input to analyze.

#[payload]

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE ### TOOLS Use Ai Service `` (AI Services) Usage of tools by a defined AI Agent. Provides a list of tools (APIs) with all the required information (endpoint, headers, body, method, and so on) to the AI Agent to use. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

The user prompt or query.

#[payload]

Tool Config

String

Contains the configuration required by the LLM to enable calling tools.

x

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ### TOOLS Use Ai Service Legacy `` (Legacy) Usage of tools by a defined AI Agent. Provide a list of tools (APIs) with all the required information (endpoint, headers, body, method, and so on) to the AI Agent to use. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

The user prompt or query.

#[payload]

Tool Config

String

Contains the configuration required by the LLM to enable calling tools.

x

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

Object

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ### EMBEDDING Add Document To Store `` Add document of type text, any and URL to the embedding store (in-memory), which is exported to the defined storeName (full path). #### Parameters
NameTypeDescriptionDefault ValueRequired

Store Name

String

Name of the embedding store.

x

Context Path

String

Refers to the location of the file to process.

x

Max Segment Size In Chars

Number

Max allowed size of continuous sequence of characters while embedding.

x

Max Overlap Size In Chars

Number

Max size of overlapping characters allowed while embedding.

x

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

File Type

String

text

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

Object

#### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ### EMBEDDING Add Folder To Store `` Add document of type text, any and URL to the embedding store (in-memory), which is exported to the defined storeName (full path). #### Parameters
NameTypeDescriptionDefault ValueRequired

Store Name

String

Name of the embedding store.

x

Context Path

String

Refers to the location of the folder to process.

x

Max Segment Size In Chars

Number

Max allowed size of continuous sequence of characters while embedding.

x

Max Overlap Size In Chars

Number

Max size of overlapping characters allowed while embedding.

x

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

File Type

String

text

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

Object

#### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ### EMBEDDING New Store `` Create a new embedding store (in-memory), which is exported to the defined storeName (full path). #### Parameters
NameTypeDescriptionDefault ValueRequired

Store Name

String

Name of the embedding store.

x

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

Object

#### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ### EMBEDDING Query From Store `` Query information from the embedding store (in-Memory), which is imported from the storeName (full path) #### Parameters
NameTypeDescriptionDefault ValueRequired

Store Name

String

Name of the embedding store.

x

Question

String

The user prompt or query.

#[payload]

Max Results

Number

Max results to retrieve from the store.

x

Min Score

Number

Filters the response with this minScore.

x

Get Latest

Boolean

Determines whether to freshly fetch the store from the location.

false

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

Object

#### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ## Types ### Expiration Policy Configures an expiration policy strategy.
FieldTypeDescriptionDefault ValueRequired

Max Idle Time

Number

Configures the maximum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Max Idle Time field.

### LLM Response Attributes
FieldTypeDescriptionDefault ValueRequired

Additional Attributes

Object

Token Usage

### Token Usage Token usage metadata returned as attributes.
FieldTypeDescriptionDefault ValueRequired

Input Count

Number

Number of tokens used to process the input.

Output Count

Number

Number of tokens used to generate the output.

Total Count

Number

Total number of tokens used for input and output.

### Repeatable In-Memory Stream Configures the in-memory streaming strategy by which the request fails if the data exceeds the MAX buffer size. Always run performance tests to find the optimal buffer size for your specific use case.
FieldTypeDescriptionDefault ValueRequired

Initial Buffer Size

Number

Initial amount of memory to allocate to the data stream. If the streamed data exceeds this value, the buffer expands by Buffer Size Increment, with an upper limit of Max Buffer Size.

Buffer Size Increment

Number

Amount by which the buffer size expands if it exceeds its initial size. Setting a value of 0 or lower specifies that the buffer can’t expand.

Max Buffer Size

Number

The maximum amount of memory to use. If more than that is used then a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised. A value lower than or equal to zero means no limit.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Unit for the Initial Buffer Size, Buffer Size Increment, and Max Buffer Size fields.

### Repeatable File Store Stream Configures the repeatable file-store streaming strategy by which Mule keeps a portion of the stream content in memory. If the stream content is larger than the configured buffer size, Mule backs up the buffer’s content to disk and then clears the memory.
FieldTypeDescriptionDefault ValueRequired

In Memory Size

Number

Maximum amount of memory that the stream can use for data. If the amount of memory exceeds this value, Mule buffers the content to disk. To optimize performance:

  • Configure a larger buffer size to avoid the number of times Mule needs to write the buffer on disk. This increases performance, but it also limits the number of concurrent requests your application can process, because it requires additional memory.

  • Configure a smaller buffer size to decrease memory load at the expense of response time.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Unit for the In Memory Size field.

### Scanned Doc Response Attributes
FieldTypeDescriptionDefault ValueRequired

Additional Attributes

Object

Scanned Doc Attributes

### Doc Response Attribute
FieldTypeDescriptionDefault ValueRequired

Page

Number

Token Usage

## See Also - [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [MuleSoft AI Chain Connector Overview](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/) - [Salesforce Help](https://help.salesforce.com) --- product: MuleSoft AI Chain Connector version: 1.0 --- # MuleSoft AI Chain Connector 1.0 XML and Maven Support > 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. Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Code Builder or Studio: - If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Code Builder or Studio XML editor, or from a text editor, you can access the connector from your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file. - If you add the connector in Anypoint Code Builder or Studio, the XML is automatically populated the code with the connector’s namespace and schema location and it also adds a dependency to the `pom.xml` file. ## Add a Namespace for the Connector Paste the following code inside the `mule` tag of the header of your configuration XML: ```xml http://www.mulesoft.org/schema/mule/ms-aichain http://www.mulesoft.org/schema/mule/ms-aichain/current/mule-ms-aichain.xsd ``` This example shows how the namespace statements are placed in the `` XML block: ```xml ``` ## Add a POM File Dependency The Apache Maven `pom.xml` file generated by Anypoint Code Builder and Studio contains dependencies for a Mule app. If you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to this connector: ```xml com.mulesoft.connectors mule4-aichain-connector x.x.x mule-plugin ``` Replace `x.x.x` with the version that corresponds to the connector you are using. To get the most up-to-date `pom.xml` file information: 1. Go to [Anypoint Exchange](https://www.mulesoft.com/exchange/). 2. In Exchange, click **Login** and supply your Anypoint Platform username and password. 3. In Exchange, search for `muleSoft ai chain`. 4. Select the connector. 5. Click **Dependency Snippets** near the upper right of the screen. ## See Also - [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) - [MuleSoft AI Chain Connector - Additional Configuration](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-additional-config) --- product: MuleSoft AI Chain Connector version: 2.0 is-latest-version: true --- # MuleSoft AI Chain Connector 2.0 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for MuleSoft AI Chain (MuleSoft AI Chain Connector) helps developers design, build, and manage AI agents within Anypoint Platform. It provides the tools and support to integrate Large Language Models (LLMs), vector stores, and other advanced AI services into MuleSoft applications. MuleSoft AI Chain Connector supports 16 operations, categorized into: - Agent - Chat - Embeddings - Image generation - RAG - Sentiment - Tools For information about compatibility and fixed issues, see the MuleSoft AI Chain Connector release notes. ## Before You Begin To use this connector, you must be familiar with: - Anypoint Connectors - Mule runtime engine (Mule) - Elements and global elements in a Mule flow - How to create a Mule app using Anypoint Code Builder or Anypoint Studio Before creating an app, you must have: - Java 17 - Mule runtime 4.9.0 or later - Apache Maven - Credentials to access the MuleSoft AI Chain Connector target resource - Anypoint Platform - The latest versions of Anypoint Code Builder or Anypoint Studio ## Common Use Cases for the Connector ### Agent Operations Some common use cases for Agent operations include: - Customer Service Agents Enhance customer service by providing case summaries, case classifications, large dataset summaries, and more. - Sales Operation Agents Assist sales teams in writing sales emails, summarizing cases for specific accounts, assessing the probability of closing deals, and more. - Marketing Agents Support marketing teams in generating product descriptions, creating newsletters, planning social media campaigns, and more. ### Chat Operations Some common use cases for Chat operations include: - Basic chatbots that answer simple user prompts. - Customer service queries that provide direct answers to frequently asked questions. - Customer support chats that retain the context of the ongoing support conversations. - Multi-user chat applications that maintain the conversation history for different users. - Personal assistants that keep track of user interactions to provide more relevant responses. ### Embeddings Operations Some common use cases for Embeddings operations include: - Creating a new in-memory vector store for storing document embeddings. - Exporting an in-memory embedding to a physical file for persistence across sessions. - Querying a knowledge store with a plain text prompt and receiving a refined response powered by an LLM. - Retrieving and interpreting data from documents in an embedding store, with enhanced context from the LLM. - Adding documents, such as PDFs and text files, into an embedding store for future retrieval. - Adding a folder for documents, such as PDFs and text files, into an embedding store for future retrieval. - Ingesting documents from a specific directory into an in-memory embedding store for contextual analysis. - Querying a vector store for specific information using semantic search. - Retrieving multiple relevant documents or text segments from an embedding store based on a given prompt. ### Image Generation Operations Some common use cases for Image operations include: - Analyzing images in business reports, presentations, or customer service scenarios. - Generating content describing images for blog posts, articles, or social media. - Extracting visual insights from images in research or design projects. - Creating visuals for marketing and advertising campaigns based on specific descriptions. - Generating images for blog posts, articles, or social media based on given prompts. - Prototyping and design, such as quickly generating concept images from textual descriptions. ### RAG Operations Use Retrieval-Augmented Generation (RAG) operations to retrieve information from a document based on a plain text prompt. Some common use cases for Retrieval-Augmented Generation (RAG) operations include: - Knowledge Management Extract specific information from documents stored in a knowledge base. - Customer Support Retrieve relevant data from customer service documents to assist with inquiries. - Research Access information from research papers or documents based on specific queries. ### Sentiment Operations Use sentiment operations to analyze the sentiment of text, such as for: - Customer Feedback Analysis Determine whether customer feedback is positive, negative, or neutral. - Social Media Monitoring Analyze the sentiment of social media posts or comments to gauge public opinion. - Market Research Assess the sentiment of survey responses or market research data. ### Tools Operations Some common use cases for Tools operations include: - Automating Routine Tasks Create autonomous agents that handle routine tasks by calling appropriate APIs. - Customer Support Automate responses to common queries by integrating tools that provide necessary information. - Inventory Management Check inventory levels or order status based on user prompts. - Employee Management Retrieve employee information or manage employee-related tasks through API calls. - Sales and Marketing Access CRM data or manage leads and accounts efficiently using predefined tools. ## Next Step After you complete the prerequisites, you are ready to create an app and configure the connector using [Anypoint Studio](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-studio) or [Anypoint Code Builder](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-config-acb). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [Upgrading and Migrating MuleSoft AI Chain Connector to 2.x](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-upgrade-migrate) - [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference) - [MuleSoft AI Chain - Additional Configuration Information](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-additional-config) - [Salesforce Help](https://help.salesforce.com) --- product: MuleSoft AI Chain Connector version: 2.0 is-latest-version: true --- # MuleSoft AI Chain Connector 2.0 Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The main class of an extension, is the entry point from which configurations, connection providers, operations and sources are declared. ## Configuration Default Configuration for MuleSoft AI Chain Connector. ### Parameters
NameTypeDescriptionDefault ValueRequired

Name

String

Name for this configuration. Connectors reference the configuration with this name.

x

LLM type

String

Large Language Model type:

  • Anthropic

  • Azure OpenAI

  • GroqAI

  • Hugging Face

  • Mistral AI

  • Ollama

  • OpenAI

x

Config Type

String

Configuration type:

  • Environment Variables

  • Configuration JSON

x

File Path

String

File path.

x

Model Name

String

Supported model for the chosen LLM.

x

Temperature

Number

Controls the randomness of the output.

0.7

LLM timeout

Number

Timeout for the LLM request.

60 seconds

LLM timeout unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit to use for the LLM timeout.

SECONDS

Max Tokens

Number

Defines the number of LLM tokens to use when generating a response.

500

Name

String

ID used to reference this configuration.

x

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

## Supported Operations - [AGENT Define Prompt Template](#AgentDefinePromptTemplate) - [CHAT Answer Prompt](#ChatAnswerPrompt) - [CHAT Answer Prompt With Memory](#ChatAnswerPromptWithMemory) - [EMBEDDING Get Info From Store](#EmbeddingGetInfoFromStore) - [EMBEDDING Get Info From Store Legacy](#EmbeddingGetInfoFromStoreLegacy) - [IMAGE Generate](#ImageGenerate) - [IMAGE Read](#ImageRead) - [IMAGE Read Scanned Documents](#ImageReadScannedDocuments) - [RAG Load Document](#RagLoadDocument) - [SENTIMENT Analyze](#SentimentAnalyze) - [TOOLS Use Ai Service](#ToolsUseAiService) - [TOOLS Use Ai Service Legacy](#ToolsUseAiServiceLegacy) ## Operations ### AGENT Define Prompt Template `` Helps in defining an AI Agent configured with a prompt template #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Dataset

String

Refers to the user query to act upon.

#[payload]

Template

String

Refers to sample template used by LLM to respond adequately to the user queries.

x

Instructions

String

This provides instructions to the LLM about how to understand and respond to the user queries.

x

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

### For Configurations - [Configuration](#Config) ### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE ### CHAT Answer Prompt `` Implements a simple Chat agent to enable chat with the LLM. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Prompt

String

User-defined prompt query.

#[payload]

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

### Output

Type

Any

Attributes Type

### For Configurations - [Configuration](#Config) ### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE ### CHAT Answer Prompt With Memory `` Implements a chat memory for a defined LLM as an AI Agent. The memoryName allows the multichannel profile design. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

Refers to the user prompt.

#[payload]

Memory Name

String

Name of the memory to fetch for further processing by the LLMs.

x

Db File Path

String

Location of the file containing the memory.

x

Max Messages

Number

Maximum number of messages to analyze for that memory.

x

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ### EMBEDDING Get Info From Store `` Reads information via prompt from embedding store (in-Memory), which is imported from the storeName (full path) #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

The user prompt or query.

#[payload]

Store Name

String

Name of the store to query.

x

Get Latest

Boolean

Determines whether to freshly fetch the store from the location.

false

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ### EMBEDDING Get Info From Store Legacy `` Reads information via a prompt from the embedding store (in-Memory), which is imported from the storeName (full path). #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

The user prompt or query.

#[payload]

Store Name

String

Name of the store to query.

x

Get Latest

Boolean

Determines whether to freshly fetch the store from the location.

false

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

Object

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ### IMAGE Generate `` Generates an image based on the prompt in data. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

The user prompt.

#[payload]

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:IMAGE\_ANALYSIS\_FAILURE - MS-AICHAIN:IMAGE\_GENERATION\_FAILURE - MS-AICHAIN:IMAGE\_PROCESSING\_FAILURE ### IMAGE Read `` Reads an image from a URL and provides the responses for the user prompts. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

The user prompt.

#[payload]

Context URL

String

Image URL to analyze.

x

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:IMAGE\_ANALYSIS\_FAILURE - MS-AICHAIN:IMAGE\_GENERATION\_FAILURE - MS-AICHAIN:IMAGE\_PROCESSING\_FAILURE ### IMAGE Read Scanned Documents `` Reads scanned documents and converts to response as prompted by the user. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

The user prompt.

#[payload]

File Path

String

Path to the file to analyze.

x

Output Mime Type

String

MIME type of the payload that this operation outputs.

Output Encoding

String

Encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:IMAGE\_ANALYSIS\_FAILURE - MS-AICHAIN:IMAGE\_GENERATION\_FAILURE - MS-AICHAIN:IMAGE\_PROCESSING\_FAILURE ### RAG Load Document `` Enables the user to query the doc provided in natural language. The doc is embedded into an in-memory vector store. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

Defines the query input provided by the user.

#[payload]

Context Path

String

Defines the file path that is embedded.

x

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

File Type

String

text

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ### SENTIMENT Analyze `` Analyzes the sentiment of the user data. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

Refers to the user input to analyze.

#[payload]

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE ### TOOLS Use Ai Service `` (AI Services) Usage of tools by a defined AI Agent. Provides a list of tools (APIs) with all the required information (endpoint, headers, body, method, and so on) to the AI Agent to use. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

The user prompt or query.

#[payload]

Tool Config

String

Contains the configuration required by the LLM to enable calling tools.

x

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ### TOOLS Use Ai Service Legacy `` (Legacy) Usage of tools by a defined AI Agent. Provide a list of tools (APIs) with all the required information (endpoint, headers, body, method, and so on) to the AI Agent to use. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Data

String

The user prompt or query.

#[payload]

Tool Config

String

Contains the configuration required by the LLM to enable calling tools.

x

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

Object

#### For Configurations - [Configuration](#Config) #### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ### EMBEDDING Add Document To Store `` Add document of type text, any and URL to the embedding store (in-memory), which is exported to the defined storeName (full path). #### Parameters
NameTypeDescriptionDefault ValueRequired

Store Name

String

Name of the embedding store.

x

Context Path

String

Refers to the location of the file to process.

x

Max Segment Size In Chars

Number

Max allowed size of continuous sequence of characters while embedding.

x

Max Overlap Size In Chars

Number

Max size of overlapping characters allowed while embedding.

x

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

File Type

String

text

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

Object

#### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ### EMBEDDING Add Folder To Store `` Add document of type text, any and URL to the embedding store (in-memory), which is exported to the defined storeName (full path). #### Parameters
NameTypeDescriptionDefault ValueRequired

Store Name

String

Name of the embedding store.

x

Context Path

String

Refers to the location of the folder to process.

x

Max Segment Size In Chars

Number

Max allowed size of continuous sequence of characters while embedding.

x

Max Overlap Size In Chars

Number

Max size of overlapping characters allowed while embedding.

x

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

File Type

String

text

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

Object

#### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ### EMBEDDING New Store `` Create a new embedding store (in-memory), which is exported to the defined storeName (full path). #### Parameters
NameTypeDescriptionDefault ValueRequired

Store Name

String

Name of the embedding store.

x

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

Object

#### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ### EMBEDDING Query From Store `` Query information from the embedding store (in-Memory), which is imported from the storeName (full path) #### Parameters
NameTypeDescriptionDefault ValueRequired

Store Name

String

Name of the embedding store.

x

Question

String

The user prompt or query.

#[payload]

Max Results

Number

Max results to retrieve from the store.

x

Min Score

Number

Filters the response with this minScore.

x

Get Latest

Boolean

Determines whether to freshly fetch the store from the location.

false

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

#### Output

Type

Any

Attributes Type

Object

#### Throws - MS-AICHAIN:AI\_SERVICES\_FAILURE - MS-AICHAIN:EMBEDDING\_OPERATIONS\_FAILURE - MS-AICHAIN:FILE\_HANDLING\_FAILURE - MS-AICHAIN:RAG\_FAILURE - MS-AICHAIN:TOOLS\_OPERATION\_FAILURE ## Types ### Expiration Policy Configures an expiration policy strategy.
FieldTypeDescriptionDefault ValueRequired

Max Idle Time

Number

Configures the maximum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Max Idle Time field.

### LLM Response Attributes
FieldTypeDescriptionDefault ValueRequired

Additional Attributes

Object

Token Usage

### Token Usage Token usage metadata returned as attributes.
FieldTypeDescriptionDefault ValueRequired

Input Count

Number

Number of tokens used to process the input.

Output Count

Number

Number of tokens used to generate the output.

Total Count

Number

Total number of tokens used for input and output.

### Repeatable In-Memory Stream Configures the in-memory streaming strategy by which the request fails if the data exceeds the MAX buffer size. Always run performance tests to find the optimal buffer size for your specific use case.
FieldTypeDescriptionDefault ValueRequired

Initial Buffer Size

Number

Initial amount of memory to allocate to the data stream. If the streamed data exceeds this value, the buffer expands by Buffer Size Increment, with an upper limit of Max Buffer Size.

Buffer Size Increment

Number

Amount by which the buffer size expands if it exceeds its initial size. Setting a value of 0 or lower specifies that the buffer can’t expand.

Max Buffer Size

Number

The maximum amount of memory to use. If more than that is used then a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised. A value lower than or equal to zero means no limit.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Unit for the Initial Buffer Size, Buffer Size Increment, and Max Buffer Size fields.

### Repeatable File Store Stream Configures the repeatable file-store streaming strategy by which Mule keeps a portion of the stream content in memory. If the stream content is larger than the configured buffer size, Mule backs up the buffer’s content to disk and then clears the memory.
FieldTypeDescriptionDefault ValueRequired

In Memory Size

Number

Maximum amount of memory that the stream can use for data. If the amount of memory exceeds this value, Mule buffers the content to disk. To optimize performance:

  • Configure a larger buffer size to avoid the number of times Mule needs to write the buffer on disk. This increases performance, but it also limits the number of concurrent requests your application can process, because it requires additional memory.

  • Configure a smaller buffer size to decrease memory load at the expense of response time.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Unit for the In Memory Size field.

### Scanned Doc Response Attributes
FieldTypeDescriptionDefault ValueRequired

Additional Attributes

Object

Scanned Doc Attributes

### Doc Response Attribute
FieldTypeDescriptionDefault ValueRequired

Page

Number

Token Usage

## See Also - [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [MuleSoft AI Chain Connector Overview](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/) - [Salesforce Help](https://help.salesforce.com) --- product: MuleSoft AI Chain Connector version: 2.0 is-latest-version: true --- # MuleSoft AI Chain Connector 2.0 XML and Maven Support > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Code Builder or Studio: - If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Code Builder or Studio XML editor, or from a text editor, you can access the connector from your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file. - If you add the connector in Anypoint Code Builder or Studio, the XML is automatically populated the code with the connector’s namespace and schema location and it also adds a dependency to the `pom.xml` file. ## Add a Namespace for the Connector Paste the following code inside the `mule` tag of the header of your configuration XML: ```xml http://www.mulesoft.org/schema/mule/ms-aichain http://www.mulesoft.org/schema/mule/ms-aichain/current/mule-ms-aichain.xsd ``` This example shows how the namespace statements are placed in the `` XML block: ```xml ``` ## Add a POM File Dependency The Apache Maven `pom.xml` file generated by Anypoint Code Builder and Studio contains dependencies for a Mule app. If you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to this connector: ```xml com.mulesoft.connectors mule4-aichain-connector x.x.x mule-plugin ``` Replace `x.x.x` with the version that corresponds to the connector you are using. To get the most up-to-date `pom.xml` file information: 1. Go to [Anypoint Exchange](https://www.mulesoft.com/exchange/). 2. In Exchange, click **Login** and supply your Anypoint Platform username and password. 3. In Exchange, search for `muleSoft ai chain`. 4. Select the connector. 5. Click **Dependency Snippets** near the upper right of the screen. ## See Also - [MuleSoft AI Chain Connector Overview](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/) - [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference) - [MuleSoft AI Chain Connector - Additional Configuration](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-additional-config) --- product: MuleSoft AI Chain Connector version: 2.0 is-latest-version: true --- # Upgrading and Migrating MuleSoft AI Chain Connector to 2.x > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Upgrade Anypoint Connector for MuleSoft AI Chain (MuleSoft AI Chain Connector) from version 1.x to version 2.x. ## Supported Upgrade Paths
From VersionTo Version

1.x

2.x

## Changes ### 2.0 - This connector is now compatible with Java 17 only. - Java classes moved from `org.mule.extension.mulechain` to `com.mulesoft.connectors.mulechain`. Update custom Java code that imports the previous package. - `com.mulesoft.connectors.mulechain.internal.config.LangchainLLMConfiguration.getModel()` now returns `dev.langchain4j.model.chat.ChatModel`. In version 1.x, `org.mule.extension.mulechain.internal.config.LangchainLLMConfiguration.getModel()` returned `dev.langchain4j.model.chat.ChatLanguageModel`. - You can use tools with Ollama chat models. The embedded LangChain4j engine is upgraded from 0.34.0 to 1.20.0. For more information, see [Tools Use AI Service](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference#ToolsUseAiService). - File paths that contain a `..` segment are rejected. A **Configuration Json** [File Path](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference#Config) that contains `..` is not loaded. The [Image Read Scanned Documents](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference#ImageReadScannedDocuments) **File Path** fails with `MS-AICHAIN:FILE_HANDLING_FAILURE`. - The connector excludes `log4j-api` from the Apache Tika document parser and from `mule-metadata-model-xml`. Logging uses the SLF4J API. - These libraries are upgraded to address reported security vulnerabilities: - The `bcprov-jdk18on`, `bcpkix-jdk18on`, `bcutil-jdk18on`, and `bcjmail-jdk18on` libraries are upgraded to version 1.86. - The `netty-codec`, `netty-codec-http`, `netty-codec-http2`, and `netty-codec-http3` libraries are upgraded to version 4.2.18.Final. - The `opennlp-tools` library is upgraded to version 2.5.12. - The Jsoup library is upgraded to version 1.23.2. - The `jackson-databind` and `jackson-core` libraries are upgraded to version 2.22.3. - The Reactor Netty HTTP library is upgraded to version 1.3.7. - The Reactor Core library is upgraded to version 3.8.7. - The DJL API library is upgraded to version 0.38.0. - These libraries are upgraded: - The Google Guava library is upgraded to version 33.7.1-jre. - The Apache Mime4j Core library is upgraded to version 0.8.15. - The SLF4J API is upgraded to version 2.0.19. - The Junrar library is upgraded to version 8.1.1. - The Kotlin `kotlin-stdlib` library is upgraded to version 2.4.20. ## Requirements Ensure your system meets the following compatibility requirements before you perform the upgrade:
Application/ServiceVersion

Mule runtime

4.9.0 and later

Java

17

## Upgrade Prerequisites Before you perform the upgrade, you must: 1. Create a backup of your files, data, and configuration in case you need to restore to the previous version. 2. Ensure that your environment meets the version 2.x requirements, including Java 17 and Mule runtime 4.9.0 or later. 3. If your custom Java code imports `org.mule.extension.mulechain`, update it to `com.mulesoft.connectors.mulechain`. 4. If your custom Java code calls `getModel()`, update it for the `com.mulesoft.connectors.mulechain.internal.config.LangchainLLMConfiguration` class and the `dev.langchain4j.model.chat.ChatModel` return type. 5. Remove `..` from configuration and scanned-document file paths. ## Upgrade Steps Follow these steps to perform the upgrade from MuleSoft AI Chain Connector 1.x to MuleSoft AI Chain Connector 2.x: 1. In Anypoint Studio, create a Mule project. 2. In the Mule Palette view, click **Search in Exchange**. 3. In the **Add Dependencies to Project** window, enter `mulesoft ai chain` in the search field. 4. In the **Available modules** section, select **MuleSoft AI Chain Connector** and click **Add**. 5. Click **Finish**. 6. Verify that the `mule4-aichain-connector` dependency version is `2.x.x` in the `pom.xml` file, where `x.x` is the minor release and patch version number. For example, if you are upgrading to v2.0, the dependency version in the `pom.xml` file should be `2.0.0`. Studio upgrades the connector automatically. ## Verify the Upgrade After you install the latest version of the connector, follow these steps to verify the upgrade: 1. In Studio, verify that there are no errors in the **Problems** or **Console** views. 2. Check the project `pom.xml` file and verify that there are no problems. 3. Test the connection and verify that the operations work. ## Troubleshooting If the app doesn’t start, confirm that it runs on Mule runtime 4.9.0 or later and on Java 17. If custom Java code no longer compiles, update imports from `org.mule.extension.mulechain` to `com.mulesoft.connectors.mulechain`, and update `getModel()` to use the `dev.langchain4j.model.chat.ChatModel` return type. If a **Configuration Json** file is not loaded, or Image Read Scanned Documents fails with `MS-AICHAIN:FILE_HANDLING_FAILURE`, remove `..` from the file path. ## Revert the Upgrade If it is necessary to revert to the previous version of MuleSoft AI Chain Connector, change the `mule4-aichain-connector` dependency version in the project’s `pom.xml` file to the previous version. You must update the project’s `pom.xml` file in Anypoint Studio. ## See Also - [MuleSoft AI Chain Connector Overview](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/) - [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference) - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com) --- product: MuleSoft AI Chain Connector version: 1.0 --- # Using Anypoint Code Builder to Configure MuleSoft AI Chain Connector > 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. Cloud IDE (Beta) is scheduled for retirement on August 31, 2026. August 30, 2026 is the last day you can access Cloud IDE (Beta). Download your projects to work from Desktop IDE. Learn more in [Migrate a Project from Cloud IDE to Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/int-import-mule-project#migrate-cloud-to-desktop). To use Anypoint Code Builder to configure a connector or module, create a basic integration project in Anypoint Code Builder, add connectors and other components to your Mule application to process your business logic, and configure the attributes. ## Before You Begin Before creating an integration project, you must: - [Set up and access the Anypoint Code Builder web or desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb) - Have credentials to access the connector’s API - Ensure that the Visual Studio Code Extension Pack for Java is installed. To use this connector, you must be familiar with: - The connector’s API - Anypoint Connectors - Mule runtime engine (Mule) ## Create a New Integration Project To create a new integration project: 1. In the activity bar of the IDE, click the ![Anypoint Code Builder icon](/mulesoft/current/en-us/connectors/_images/acb-icon-ms-logo.png) (**Anypoint Code Builder**) icon. 2. From **Quick Actions**, click **Develop an Integration**: ![Develop an Integration link highlighted in the Getting started section](/mulesoft/current/en-us/anypoint-code-builder/_images/develop-integration-option-mat.png) 3. Complete the following in the **Develop an Integration** form:
AttributeValue

Project Name

Unique name for your project.

This name is used as the title and name of the integration project file. For example, if the project name is "Salesforce Integration," the project file name is salesforce-integration.

Project Location

Your home directory or another directory you create. Click Browse to select a different directory for the integration project.

Don’t create the project within another project directory.

4. Select the type of project to create by selecting either the **Empty Project** or **Template or Example** card. 5. Select the **Mule runtime** and **Java Version** for your app. 6. Click **Create Project**. ## Add Components to Your Project Add components to your integration project to build a flow: 1. In the **Explorer** view, open the XML file for your project, such as `my-project-name.xml`. 2. Select **Build a Flow** from the start card to create an empty flow: ![Anypoint Code Builder canvas with starting cards with the options to start from scratch, build a flow, or build a subflow](/mulesoft/current/en-us/connectors/_images/acb-build-flow.png) 3. Change the name of the flow: 1. Click **Flow**. 2. Click the edit icon. ![Arrow pointing to the flow name edit pencil icon](/mulesoft/current/en-us/connectors/_images/acb-change-flow-name.png) 3. Enter the flow name, and click the checkmark. 4. In the canvas UI, click the ![Add component icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon. 5. In the **Add Component** panel, search for and select your component from the results. The following example shows the **Listener** component from the **HTTP** search results: ![Listener component highlighted in the Add Component section](/mulesoft/current/en-us/anypoint-code-builder/_images/main-tutorial-add-first-listener.png) The configuration XML file now includes the XML for the HTTP Listener into the `` element, for example: ```XML ``` ## Configure the Trigger For the Flow A trigger (source) starts the flow when specified conditions are met. If a connector has its own associated sources, you can use a connector-specific trigger to initiate the flow. Each connector trigger has a unique configuration. You can configure the following sources for this connector: - **HTTP > Listener** Initiates a flow each time it receives a request on the configured host and port - **Scheduler** Initiates a flow when a time-based condition is met For example, to configure an HTTP Listener trigger, follow these steps: 1. Click the **Listener** component on the canvas UI. 2. (Optional) Click the edit icon to change the name of the **Listener** component. 3. (Optional) If you created a configuration file for the connector, select it. 4. In the **General** tab, in the **Path** field, enter the relative path for the path set in the HTTP configuration element. See [Configure Paths](https://docs.mulesoft.com/http-connector/latest/http-listener-ref#configure-paths). 5. Select the **Advanced** tab to configure the following attributes:
AttributeDescriptionRequired

Allowed methods

To allow all HTTP methods (default), do not define this attribute. To restrict certain methods, specify all allowed HTTP methods, for example, GET, POST, as a comma-separated list.

No

Response streaming mode

Whether to use streaming when the response is sent.

No

Output MIME type

MIME type of the payload that this component outputs.

No

Parameters

Appends a key-value pair for a reader property to the value of the Output MIME attribute. Multiple key-value pairs are allowed.

No

Output encoding

Encoding of the payload that this component outputs.

No

Streaming Strategy

Configures the way data streams are consumed in Mule apps.

No

Primary node only

Select this option to execute the Listener trigger on the primary node only when running in a cluster.

No

Redelivery policy

Configures the redelivery policy for executing requests that generate errors. You can add a redelivery policy to any source in a flow.

No

Reconnection strategy

When an operation in a Mule application fails to connect to an external server, the default behavior is for the operation to fail immediately and return a connectivity error. You can modify the default behavior by configuring the reconnection strategy for the operation.

No

Response

See HTTP Response Attributes.

No

Error Response

HTTP error response returns a status code for the error.

No

Body

Body of the error message.

No

Headers

Headers to include in the error message.

No

Status code

Status code of the error response, for example, 500.

No

Reason phrase

Reason for the error, for example, Gateway Timeout or Internal Server Error.

No

## Add the Connector to Your Integration Project 1. In the Explorer view, open the configuration XML file for your project, such as `my-project-name.xml`. 2. Click the ![Show Mule graphical mode icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-tree-view.png) (**Show Mule graphical mode**) icon in the activity bar to open the canvas UI if it doesn’t open automatically. 3. Add the connector the same way you added other components from the canvas UI: 1. In the canvas UI, click the ![Add component icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon. 2. In the **Add Component** panel, click **Connectors**. 4. Click the ![Search in Exchange icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-search-exchange.png) (**Search in Exchange**) toggle: ![Search in Exchange toggle](/mulesoft/current/en-us/anypoint-code-builder/_images/int-connector-search-exchange.png) 5. Enter `mulesoft ai chain` in the search box. 6. Select the connector to add it to your project. Adding a connector to an integration project does not make that connector available to other projects in your Anypoint Code Builder workspace. ## Add a Global Configuration 1. In the configuration XML, place your cursor before the `` element and type `ms-aichain`. Ensure that the cursor is not inside the `` element. 2. Select the `ms-aichain:config` snippet: The snippet adds the following code: ```xml ``` 3. Add the attributes to complete the configuration, for example: ```xml ``` This example shows a flow named "Define\_Prompt" with two global elements defined (`http:listener-config` and `ms-aichain:config`) ```xml ``` ## Configure Additional Connector Fields After you configure a global element for the connector, configure the other required fields. The required fields vary depending on which connector actions you use. For more information about configuring MuleSoft AI Chain Connector actions, see [MuleSoft AI Chain Connector - Additional Configuration Information](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-additional-config). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-connector-reference) - [MuleSoft AI Chain - Additional Configuration Information](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-additional-config) - [Salesforce Help](https://help.salesforce.com) --- product: MuleSoft AI Chain Connector version: 2.0 is-latest-version: true --- # Using Anypoint Code Builder to Configure MuleSoft AI Chain Connector > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Cloud IDE (Beta) is scheduled for retirement on August 31, 2026. August 30, 2026 is the last day you can access Cloud IDE (Beta). Download your projects to work from Desktop IDE. Learn more in [Migrate a Project from Cloud IDE to Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/int-import-mule-project#migrate-cloud-to-desktop). To use Anypoint Code Builder to configure a connector or module, create a basic integration project in Anypoint Code Builder, add connectors and other components to your Mule application to process your business logic, and configure the attributes. ## Before You Begin Before creating an integration project, you must: - [Set up and access the Anypoint Code Builder web or desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb) - Have credentials to access the connector’s API - Ensure that the Visual Studio Code Extension Pack for Java is installed. To use this connector, you must be familiar with: - The connector’s API - Anypoint Connectors - Mule runtime engine (Mule) ## Create a New Integration Project To create a new integration project: 1. In the activity bar of the IDE, click the ![Anypoint Code Builder icon](/mulesoft/current/en-us/connectors/_images/acb-icon-ms-logo.png) (**Anypoint Code Builder**) icon. 2. From **Quick Actions**, click **Develop an Integration**: ![Develop an Integration link highlighted in the Getting started section](/mulesoft/current/en-us/anypoint-code-builder/_images/develop-integration-option-mat.png) 3. Complete the following in the **Develop an Integration** form:
AttributeValue

Project Name

Unique name for your project.

This name is used as the title and name of the integration project file. For example, if the project name is "Salesforce Integration," the project file name is salesforce-integration.

Project Location

Your home directory or another directory you create. Click Browse to select a different directory for the integration project.

Don’t create the project within another project directory.

4. Select the type of project to create by selecting either the **Empty Project** or **Template or Example** card. 5. Select the **Mule runtime** and **Java Version** for your app. 6. Click **Create Project**. ## Add Components to Your Project Add components to your integration project to build a flow: 1. In the **Explorer** view, open the XML file for your project, such as `my-project-name.xml`. 2. Select **Build a Flow** from the start card to create an empty flow: ![Anypoint Code Builder canvas with starting cards with the options to start from scratch, build a flow, or build a subflow](/mulesoft/current/en-us/connectors/_images/acb-build-flow.png) 3. Change the name of the flow: 1. Click **Flow**. 2. Click the edit icon. ![Arrow pointing to the flow name edit pencil icon](/mulesoft/current/en-us/connectors/_images/acb-change-flow-name.png) 3. Enter the flow name, and click the checkmark. 4. In the canvas UI, click the ![Add component icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon. 5. In the **Add Component** panel, search for and select your component from the results. The following example shows the **Listener** component from the **HTTP** search results: ![Listener component highlighted in the Add Component section](/mulesoft/current/en-us/anypoint-code-builder/_images/main-tutorial-add-first-listener.png) The configuration XML file now includes the XML for the HTTP Listener into the `` element, for example: ```XML ``` ## Configure the Trigger For the Flow A trigger (source) starts the flow when specified conditions are met. If a connector has its own associated sources, you can use a connector-specific trigger to initiate the flow. Each connector trigger has a unique configuration. You can configure the following sources for this connector: - **HTTP > Listener** Initiates a flow each time it receives a request on the configured host and port - **Scheduler** Initiates a flow when a time-based condition is met For example, to configure an HTTP Listener trigger, follow these steps: 1. Click the **Listener** component on the canvas UI. 2. (Optional) Click the edit icon to change the name of the **Listener** component. 3. (Optional) If you created a configuration file for the connector, select it. 4. In the **General** tab, in the **Path** field, enter the relative path for the path set in the HTTP configuration element. See [Configure Paths](https://docs.mulesoft.com/http-connector/latest/http-listener-ref#configure-paths). 5. Select the **Advanced** tab to configure the following attributes:
AttributeDescriptionRequired

Allowed methods

To allow all HTTP methods (default), do not define this attribute. To restrict certain methods, specify all allowed HTTP methods, for example, GET, POST, as a comma-separated list.

No

Response streaming mode

Whether to use streaming when the response is sent.

No

Output MIME type

MIME type of the payload that this component outputs.

No

Parameters

Appends a key-value pair for a reader property to the value of the Output MIME attribute. Multiple key-value pairs are allowed.

No

Output encoding

Encoding of the payload that this component outputs.

No

Streaming Strategy

Configures the way data streams are consumed in Mule apps.

No

Primary node only

Select this option to execute the Listener trigger on the primary node only when running in a cluster.

No

Redelivery policy

Configures the redelivery policy for executing requests that generate errors. You can add a redelivery policy to any source in a flow.

No

Reconnection strategy

When an operation in a Mule application fails to connect to an external server, the default behavior is for the operation to fail immediately and return a connectivity error. You can modify the default behavior by configuring the reconnection strategy for the operation.

No

Response

See HTTP Response Attributes.

No

Error Response

HTTP error response returns a status code for the error.

No

Body

Body of the error message.

No

Headers

Headers to include in the error message.

No

Status code

Status code of the error response, for example, 500.

No

Reason phrase

Reason for the error, for example, Gateway Timeout or Internal Server Error.

No

## Add the Connector to Your Integration Project 1. In the Explorer view, open the configuration XML file for your project, such as `my-project-name.xml`. 2. Click the ![Show Mule graphical mode icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-tree-view.png) (**Show Mule graphical mode**) icon in the activity bar to open the canvas UI if it doesn’t open automatically. 3. Add the connector the same way you added other components from the canvas UI: 1. In the canvas UI, click the ![Add component icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon. 2. In the **Add Component** panel, click **Connectors**. 4. Click the ![Search in Exchange icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-search-exchange.png) (**Search in Exchange**) toggle: ![Search in Exchange toggle](/mulesoft/current/en-us/anypoint-code-builder/_images/int-connector-search-exchange.png) 5. Enter `mulesoft ai chain` in the search box. 6. Select the connector to add it to your project. Adding a connector to an integration project does not make that connector available to other projects in your Anypoint Code Builder workspace. ## Add a Global Configuration 1. In the configuration XML, place your cursor before the `` element and type `ms-aichain`. Ensure that the cursor is not inside the `` element. 2. Select the `ms-aichain:config` snippet: The snippet adds the following code: ```xml ``` 3. Add the attributes to complete the configuration, for example: ```xml ``` This example shows a flow named "Define\_Prompt" with two global elements defined (`http:listener-config` and `ms-aichain:config`) ```xml ``` ## Configure Additional Connector Fields After you configure a global element for the connector, configure the other required fields. The required fields vary depending on which connector actions you use. For more information about configuring MuleSoft AI Chain Connector actions, see [MuleSoft AI Chain Connector - Additional Configuration Information](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-additional-config). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference) - [MuleSoft AI Chain - Additional Configuration Information](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-additional-config) - [Salesforce Help](https://help.salesforce.com) --- product: MuleSoft AI Chain Connector version: 1.0 --- # Using Anypoint Studio to Configure MuleSoft AI Chain Connector 1.0 > 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. Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and configuration files. To add and configure a connector in Studio: 1. [Create a Mule project](#create-mule-project). 2. [Add the connector to your Mule project](#add-connector-to-project). 3. [Configure a source for the connector’s flow](#configure-source). 4. [Add a connector operation to the flow](#add-connector-operation). 5. [Configure a global element for the connector](#configure-global-element). 6. [Configure the other connector fields](#configure-other-fields). When you run the connector, you can view the app log to check for problems in real time, as described in [View the App Log](#view-app-log). If you are new to configuring connectors in Studio, see [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio). If, after reading this topic, you need additional information about the connector fields, see the [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-connector-reference). ## Create a Mule Project In Studio, create a new Mule project in which to add and configure Anypoint Connector for MuleSoft AI Chain (MuleSoft AI Chain Connector): 1. In Studio, select **File > New > Mule Project**. 2. Enter a name for your Mule project and click **Finish**. ## Add the Connector to Your Mule Project Add MuleSoft AI Chain Connector to your Mule project to automatically populate the XML code with the connector’s namespace and schema location and add the required dependencies to the project’s `pom.xml` file: 1. In **Mule Palette**, click **(X) Search in Exchange**. 2. In **Add Dependencies to Project**, type `mulesoft ai chain` in the search field. 3. Click **MuleSoft AI Chain Connector** in **Available modules**. 4. Click **Add**. 5. Click **Finish**. Adding a connector to a Mule project in Studio does not make that connector available to other projects in your Studio workspace. ## Configure a Source A source initiates a flow when a specified condition is met. You can configure one of these sources to use with MuleSoft Chain AI Connector: - **HTTP > Listener** Initiates a flow each time it receives a request on the configured host and port - **Scheduler** Initiates a flow when a time-based condition is met For example, to configure an **HTTP > Listener** source, follow these steps: 1. In **Mule Palette**, select **HTTP > Listener**. 2. Drag **Listener** to the Studio canvas. 3. On the **Listener** configuration screen, optionally change the value of the **Display Name** field. 4. Specify a value for the **Path** field. 5. Click the plus sign (**+**) next to the **Connector configuration** field to configure a global element that can be used by all instances of the **HTTP > Listener** source in the app. 6. On the **General** tab, specify the connection information for the connector. 7. On the **TLS** tab, optionally specify the TLS information for the connector. 8. On the **Advanced** tab, optionally specify reconnection information, including a reconnection strategy. 9. Click **Test Connection** to confirm that Mule can connect with the specified server. 10. Click **OK**. ## Add a Connector Operation to the Flow When you add a connector operation to your flow, you are specifying an action for that connector to perform. To add an operation for MuleSoft AI Chain Connector, follow these steps: 1. In **Mule Palette**, select **MuleSoft AI Chain Connector** and then select the operation to add. ![Mule palette in Studio with MuleSoft AI Chain selected and all of the connector’s operations listed](/mulesoft/current/en-us/mulesoft-ai-chain-connector/1.0/_images/mulesoft-ai-chain-palette-operations.png) 2. Drag the operation onto the Studio canvas, next to the source. ## Configure a Global Element for the Connector When you configure a connector, configure a global element that all instances of that connector in the app can use. Configuring a global element requires you to provide the authentication credentials that the connector requires to access the target system. You can reference a configuration file that contains ANT-style property placeholders (recommended), or you can enter your authorization credentials in the global configuration properties. For information about the benefits of using property placeholders and how to configure them, see [Anypoint Connector Configuration](https://docs.mulesoft.com/connectors/introduction/intro-connector-configuration-overview). To configure the global element for MuleSoft AI Chain Connector, follow these steps: 1. Select the operation in the Studio canvas. 2. On the properties screen for the operation, click the Add (**+**) icon to access the global element configuration fields. 3. In the **Global Elements Properties > General** tab, choose your preferred large language model (LLM) type from **LLM**: - Anthropic - Azure OpenAI - Groq AI - Hugging Face - Mistral AI - Ollama - OpenAI 4. From **Config type**, choose from these configuration types: - **Environment Variables** This configuration requires you to set the environment variables in the operating system where Mule runtime is deployed. When you choose this option, enter a `-` in the **File path** field. Based on the LLM type you chose, you must set different environment variables. These are the supported environment variables based on the supported LLM types: - Anthropic: `ANTHROPIC_API_KEY` - Azure OpenAI: `AZURE_OPENAI_ENDPOINT- AZURE_OPENAI_KEY- AZURE_OPENAI_DEPLOYMENT_NAME` - Groq AI: `GROQ_API_KEY` - Hugging Face: `HUGGING_FACE_API_KEY` - MistralAI: `MISTRAL_AI_API_KEY` - OpenAI: `OPENAI_API_KEY` - Ollama: `OLLAMA_BASE_URL` ![Global Element Properties window with configuration fields filled out for the Environment Variables configuration type](/mulesoft/current/en-us/mulesoft-ai-chain-connector/1.0/_images/mulesoft-ai-chain-config-studio.png) - **Configuration JSON** This configuration requires you to provide a configuration JSON file with all the required LLM properties. This is an example of the configuration JSON file: ```json { "OPENAI": { "OPENAI_API_KEY": "YOUR_OPENAI_API_KEY" }, "MISTRAL_AI": { "MISTRAL_AI_API_KEY": "YOUR_MISTRAL_AI_API_KEY" }, "OLLAMA": { "OLLAMA_BASE_URL": "http://baseurl.ollama.com" }, "GROQAI_OPENAI": { "GROQ_API_KEY": "YOUR_GROQAI_APIKEY" }, "HUGGING_FACE": { "HUGGING_FACE_API_KEY": "YOUR_HUGGING_FACE_API_KEY" }, "ANTHROPIC": { "ANTHROPIC_API_KEY": "YOUR_ANTHROPIC_API_KEY" }, "AZURE_OPENAI": { "AZURE_OPENAI_KEY": "YOUR_AZURE_OPENAI_KEY", "AZURE_OPENAI_ENDPOINT": "http://endpoint.azure.com", "AZURE_OPENAI_DEPLOYMENT_NAME": "YOUR_DEPLOYMENT_NAME" } } ``` Make sure you fill out the required properties for your LLM type. You can store the file externally or add it directly in the Mule application under the `src/main/resource` folder by using this DataWeave expression: ```dataweave mule.home ++ "/apps/" ++ app.name ++ "/envVars.json" ``` 5. In **File path**, enter `-` if you chose **Environment Variables** as the configuration type. If you chose **Configuration JSON**, enter the path to the JSON file, or the DataWeave expression if you are storing it in the Mule application under the `src/main/resource` folder. 6. In **Model name**, choose from the supported models for the LLM provider. 7. In **Temperature**, enter a number between `0` and `2`, or use the default value `0.7`. The temperature is used to control the randomness of the output. When you set it higher, you’ll get more random outputs. When you set it lower, towards `0`, the values are more deterministic. 8. In **LLM Timeout**, enter the number of seconds of when to time out the request. The default is `60` seconds. 9. In **Max tokens**, enter the number of LLM tokens to use when generating a response. This parameter helps control the usage and costs when engaging with LLMs. 10. Click **OK**. ## Configure Additional Connector Fields After you configure a global element for the connector, configure the other required fields. The required fields vary depending on which connector operation you use. ## View the App Log To check for problems, you can view the app log as follows: - If you’re running the app from Anypoint Platform, the app log output is visible on the Anypoint Studio console window. - If you’re running the app using Mule from the command line, the app log output is visible in your operating system console. Unless the log file path is customized in the app’s log file (`log4j2.xml`), you can also view the app log in the default location `MULE_HOME/logs/.log`. You can configure the location of the log path in the app log file `log4j2.xml`. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-connector-reference) - [MuleSoft AI Chain - Additional Configuration Information](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-additional-config) - [Salesforce Help](https://help.salesforce.com) --- product: MuleSoft AI Chain Connector version: 2.0 is-latest-version: true --- # Using Anypoint Studio to Configure MuleSoft AI Chain Connector 2.0 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and configuration files. To add and configure a connector in Studio: 1. [Create a Mule project](#create-mule-project). 2. [Add the connector to your Mule project](#add-connector-to-project). 3. [Configure a source for the connector’s flow](#configure-source). 4. [Add a connector operation to the flow](#add-connector-operation). 5. [Configure a global element for the connector](#configure-global-element). 6. [Configure the other connector fields](#configure-other-fields). When you run the connector, you can view the app log to check for problems in real time, as described in [View the App Log](#view-app-log). If you are new to configuring connectors in Studio, see [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio). If, after reading this topic, you need additional information about the connector fields, see the [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference). ## Create a Mule Project In Studio, create a new Mule project in which to add and configure Anypoint Connector for MuleSoft AI Chain (MuleSoft AI Chain Connector): 1. In Studio, select **File > New > Mule Project**. 2. Enter a name for your Mule project and click **Finish**. ## Add the Connector to Your Mule Project Add MuleSoft AI Chain Connector to your Mule project to automatically populate the XML code with the connector’s namespace and schema location and add the required dependencies to the project’s `pom.xml` file: 1. In **Mule Palette**, click **(X) Search in Exchange**. 2. In **Add Dependencies to Project**, type `mulesoft ai chain` in the search field. 3. Click **MuleSoft AI Chain Connector** in **Available modules**. 4. Click **Add**. 5. Click **Finish**. Adding a connector to a Mule project in Studio does not make that connector available to other projects in your Studio workspace. ## Configure a Source A source initiates a flow when a specified condition is met. You can configure one of these sources to use with MuleSoft Chain AI Connector: - **HTTP > Listener** Initiates a flow each time it receives a request on the configured host and port - **Scheduler** Initiates a flow when a time-based condition is met For example, to configure an **HTTP > Listener** source, follow these steps: 1. In **Mule Palette**, select **HTTP > Listener**. 2. Drag **Listener** to the Studio canvas. 3. On the **Listener** configuration screen, optionally change the value of the **Display Name** field. 4. Specify a value for the **Path** field. 5. Click the plus sign (**+**) next to the **Connector configuration** field to configure a global element that can be used by all instances of the **HTTP > Listener** source in the app. 6. On the **General** tab, specify the connection information for the connector. 7. On the **TLS** tab, optionally specify the TLS information for the connector. 8. On the **Advanced** tab, optionally specify reconnection information, including a reconnection strategy. 9. Click **Test Connection** to confirm that Mule can connect with the specified server. 10. Click **OK**. ## Add a Connector Operation to the Flow When you add a connector operation to your flow, you are specifying an action for that connector to perform. To add an operation for MuleSoft AI Chain Connector, follow these steps: 1. In **Mule Palette**, select **MuleSoft AI Chain Connector** and then select the operation to add. ![Mule palette in Studio with MuleSoft AI Chain selected and all of the connector’s operations listed](/mulesoft/current/en-us/mulesoft-ai-chain-connector/latest/_images/mulesoft-ai-chain-palette-operations.png) 2. Drag the operation onto the Studio canvas, next to the source. ## Configure a Global Element for the Connector When you configure a connector, configure a global element that all instances of that connector in the app can use. Configuring a global element requires you to provide the authentication credentials that the connector requires to access the target system. You can reference a configuration file that contains ANT-style property placeholders (recommended), or you can enter your authorization credentials in the global configuration properties. For information about the benefits of using property placeholders and how to configure them, see [Anypoint Connector Configuration](https://docs.mulesoft.com/connectors/introduction/intro-connector-configuration-overview). To configure the global element for MuleSoft AI Chain Connector, follow these steps: 1. Select the operation in the Studio canvas. 2. On the properties screen for the operation, click the Add (**+**) icon to access the global element configuration fields. 3. In the **Global Elements Properties > General** tab, choose your preferred large language model (LLM) type from **LLM type**: - Anthropic - Azure OpenAI - Groq AI - Hugging Face - Mistral AI - Ollama - OpenAI 4. From **Config Type**, choose from these configuration types: - **Environment Variables** This configuration requires you to set the environment variables in the operating system where Mule runtime is deployed. When you choose this option, enter a `-` in the **File Path** field. Based on the LLM type you chose, you must set different environment variables. These are the supported environment variables based on the supported LLM types: - Anthropic: `ANTHROPIC_API_KEY` - Azure OpenAI: `AZURE_OPENAI_ENDPOINT- AZURE_OPENAI_KEY- AZURE_OPENAI_DEPLOYMENT_NAME` - Groq AI: `GROQ_API_KEY` - Hugging Face: `HUGGING_FACE_API_KEY` - MistralAI: `MISTRAL_AI_API_KEY` - OpenAI: `OPENAI_API_KEY` - Ollama: `OLLAMA_BASE_URL` ![Global Element Properties window with configuration fields filled out for the Environment Variables configuration type](/mulesoft/current/en-us/mulesoft-ai-chain-connector/latest/_images/mulesoft-ai-chain-config-studio.png) - **Configuration JSON** This configuration requires you to provide a configuration JSON file with all the required LLM properties. This is an example of the configuration JSON file: ```json { "OPENAI": { "OPENAI_API_KEY": "YOUR_OPENAI_API_KEY" }, "MISTRAL_AI": { "MISTRAL_AI_API_KEY": "YOUR_MISTRAL_AI_API_KEY" }, "OLLAMA": { "OLLAMA_BASE_URL": "http://baseurl.ollama.com" }, "GROQAI_OPENAI": { "GROQ_API_KEY": "YOUR_GROQAI_APIKEY" }, "HUGGING_FACE": { "HUGGING_FACE_API_KEY": "YOUR_HUGGING_FACE_API_KEY" }, "ANTHROPIC": { "ANTHROPIC_API_KEY": "YOUR_ANTHROPIC_API_KEY" }, "AZURE_OPENAI": { "AZURE_OPENAI_KEY": "YOUR_AZURE_OPENAI_KEY", "AZURE_OPENAI_ENDPOINT": "http://endpoint.azure.com", "AZURE_OPENAI_DEPLOYMENT_NAME": "YOUR_DEPLOYMENT_NAME" } } ``` Make sure you fill out the required properties for your LLM type. You can store the file externally or add it directly in the Mule application under the `src/main/resource` folder by using this DataWeave expression: ```dataweave mule.home ++ "/apps/" ++ app.name ++ "/envVars.json" ``` 5. In **File Path**, enter `-` if you chose **Environment Variables** as the configuration type. If you chose **Configuration JSON**, enter the path to the JSON file, or the DataWeave expression if you are storing it in the Mule application under the `src/main/resource` folder. A path that contains `..` is rejected and the configuration file is not loaded. 6. In **Model Name**, choose from the supported models for the LLM provider. 7. In **Temperature**, enter a number between `0` and `2`, or use the default value `0.7`. The temperature is used to control the randomness of the output. When you set it higher, you’ll get more random outputs. When you set it lower, towards `0`, the values are more deterministic. 8. In **LLM timeout**, enter the timeout for the LLM request. The default is `60`, and the default **LLM timeout unit** is `SECONDS`. 9. In **Max Tokens**, enter the number of LLM tokens to use when generating a response. This parameter helps control the usage and costs when engaging with LLMs. 10. Click **OK**. ## Configure Additional Connector Fields After you configure a global element for the connector, configure the other required fields. The required fields vary depending on which connector operation you use. ## View the App Log To check for problems, you can view the app log as follows: - If you’re running the app from Anypoint Platform, the app log output is visible on the Anypoint Studio console window. - If you’re running the app using Mule from the command line, the app log output is visible in your operating system console. Unless the log file path is customized in the app’s log file (`log4j2.xml`), you can also view the app log in the default location `MULE_HOME/logs/.log`. You can configure the location of the log path in the app log file `log4j2.xml`. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-connector-reference) - [MuleSoft AI Chain - Additional Configuration Information](https://docs.mulesoft.com/mulesoft-ai-chain-connector/latest/mulesoft-ai-chain-additional-config) - [Salesforce Help](https://help.salesforce.com)