Contact Us 1-800-596-4880

MuleSoft AI Chain Connector 1.0 Reference - Mule 4

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

Name Type Description Default Value Required

Name

String

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

x

LLM type

String

Large Language Model type:

  • Anthropic

  • Azure OpenAI

  • Mistral AI

  • Ollama

  • OpenAI

  • GroqAI

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.

Operations

AGENT Define Prompt Template

<ms-aichain:agent-define-prompt-template>

Helps in defining an AI Agent configured with a prompt template

Parameters

Name Type Description Default Value Required

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

Throws

  • MS-AICHAIN:AI_SERVICES_FAILURE

CHAT Answer Prompt

<ms-aichain:chat-answer-prompt>

Implements a simple Chat agent to enable chat with the LLM.

Parameters

Name Type Description Default Value Required

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

Throws

  • MS-AICHAIN:AI_SERVICES_FAILURE

CHAT Answer Prompt With Memory

<ms-aichain: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

Name Type Description Default Value Required

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

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

<ms-aichain:embedding-get-info-from-store>

Reads information via prompt from embedding store (in-Memory), which is imported from the storeName (full path)

Parameters

Name Type Description Default Value Required

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

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

<ms-aichain: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

Name Type Description Default Value Required

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

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

<ms-aichain:image-generate>

Generates an image based on the prompt in data.

Parameters

Name Type Description Default Value Required

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

Throws

  • MS-AICHAIN:FILE_HANDLING_FAILURE

  • MS-AICHAIN:IMAGE_ANALYSIS_FAILURE

  • MS-AICHAIN:IMAGE_GENERATION_FAILURE

  • MS-AICHAIN:IMAGE_PROCESSING_FAILURE

IMAGE Read

<ms-aichain:image-read>

Reads an image from a URL and provides the responses for the user prompts.

Parameters

Name Type Description Default Value Required

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

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

<ms-aichain:image-read-scanned-documents>

Reads scanned documents and converts to response as prompted by the user.

Parameters

Name Type Description Default Value Required

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

Throws

  • MS-AICHAIN:FILE_HANDLING_FAILURE

  • MS-AICHAIN:IMAGE_ANALYSIS_FAILURE

  • MS-AICHAIN:IMAGE_GENERATION_FAILURE

  • MS-AICHAIN:IMAGE_PROCESSING_FAILURE

RAG Load Document

<ms-aichain: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

Name Type Description Default Value Required

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

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

<ms-aichain:sentiment-analyze>

Analyzes the sentiment of the user data.

Parameters

Name Type Description Default Value Required

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

Throws

  • MS-AICHAIN:AI_SERVICES_FAILURE

TOOLS Use Ai Service

<ms-aichain: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

Name Type Description Default Value Required

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

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

<ms-aichain: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

Name Type Description Default Value Required

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

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

<ms-aichain: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

Name Type Description Default Value Required

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

<ms-aichain: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

Name Type Description Default Value Required

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

<ms-aichain:embedding-new-store>

Create a new embedding store (in-memory), which is exported to the defined storeName (full path).

Parameters

Name Type Description Default Value Required

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

<ms-aichain:embedding-query-from-store>

Query information from the embedding store (in-Memory), which is imported from the storeName (full path)

Parameters

Name Type Description Default Value Required

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.

Field Type Description Default Value Required

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

Field Type Description Default Value Required

Additional Attributes

Object

Token Usage

Token Usage

Token usage metadata returned as attributes.

Field Type Description Default Value Required

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.

Field Type Description Default Value Required

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.

Field Type Description Default Value Required

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

Field Type Description Default Value Required

Additional Attributes

Object

Scanned Doc Attributes

Doc Response Attribute

Field Type Description Default Value Required

Page

Number

Token Usage

View on GitHub