Docs
Getting Started

Getting Started

Use the Connector in Your Project

Application Requirements

Java Development Kit (JDK)

The application using the MuleSoft Vectors Connector can use Java Development Kit (JDK) 8, 11 and 17 with following exceptions:

  • OpenSearch vector store only support Java Development Kit (JDK) 11 and 17

MuleSoft Runtime

The application using the MuleSoft Vectors Connector requires a Mule Runtime >= 4.5.3.

Option 1: Maven Central Repository

Maven Central (opens in a new tab)

Edit File pom.xml

💡

The MAC Project connectors are constantly updated, and the version is regularly changed. Make sure to replace {version} with the latest release from Maven Central (opens in a new tab).

Copy and paste the following Maven Dependency into your Mule application pom file.

pom.xml
<dependency>
    <groupId>io.github.mulesoft-ai-chain-project</groupId>
    <artifactId>mule4-vectors-connector</artifactId>
    <version>{version}</version>
    <classifier>mule-plugin</classifier>
</dependency>

Option 2: Local Maven Repository

Build Requirements

Before you start, ensure you have the following prerequisites:

  • Java Development Kit (JDK) 8, 11, and 17
  • Apache Maven
  • MuleSoft Anypoint Studio

Download the MuleSoft Vectors Connector

Clone the MAC Vectors Connector repository from GitHub:

git clone https://github.com/MuleSoft-AI-Chain-Project/mule-vectors-connector.git
cd mule-vectors-connector

Build the Connector with Java 8

mvn clean install -Dmaven.test.skip=true -DskipTests -Dgpg.skip

Build the Connector with Java 11, 17, 21, 22, etc.

Step 1

export MAVEN_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED"

Step 2

 
For Java 11
mvn clean install -Dmaven.test.skip=true -DskipTests -Dgpg.skip -Djdeps.multiRelease=11
 
For Java 17
mvn clean install -Dmaven.test.skip=true -DskipTests -Dgpg.skip -Djdeps.multiRelease=17
 
For Java 21
mvn clean install -Dmaven.test.skip=true -DskipTests -Dgpg.skip -Djdeps.multiRelease=21
 
For Java 22
mvn clean install -Dmaven.test.skip=true -DskipTests -Dgpg.skip -Djdeps.multiRelease=22

Edit File pom.xml

💡

The MAC Project connectors are constantly updated, and the version is regularly changed. Make sure to replace {version} with the latest release from our GitHub repository (opens in a new tab).

Add the following dependency to your pom.xml file:

pom.xml
<dependency>
    <groupId>com.mulesoft.connectors</groupId>
    <artifactId>mule4-vectors-connector</artifactId>
    <version>{version}</version>
    <classifier>mule-plugin</classifier>
</dependency>

Connector Additional Dependencies

💡

In order reduce the overall size of the connector and avoid adding dependencies that are not required, all the optional libraries have been removed from the connector and only the required ones can be added depending on the specific use case.

Mule maven plugin allows to configure additional plugin dependencies for a connector, you can learn more here (opens in a new tab).

In order to add a dependency like the following to your application

pom.xml
<dependency>
    <groupId>dev.langchain4j</groupId>
    <artifactId>langchain4j-document-loader-azure-storage-blob</artifactId>
    <version>${langchain4jVersion}</version>
</dependency>
 

you need to modify your pom.xml file as follows.

The change is different depending on how you installed the connector..

pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="..." >
 
...
 
  <properties>
  	...
  	<mule.maven.plugin.version>4.3.0</mule.maven.plugin.version>
  	<langchain4jVersion>0.35.0</langchain4jVersion>
  </properties>
 
  <build>
  	<plugins>
  		...
  		<plugin>
  			<groupId>org.mule.tools.maven</groupId>
  			<artifactId>mule-maven-plugin</artifactId>
  			<version>${mule.maven.plugin.version}</version>
  			<extensions>true</extensions>
  			<configuration>
  				<additionalPluginDependencies>
  					<plugin>
  						<groupId>io.github.mulesoft-ai-chain-project</groupId>
  						<artifactId>mule4-vectors-connector</artifactId>
  						<additionalDependencies>
 
  							<!-- OPTIONAL DEPENDENCY GOES HERE -->
  							<dependency>
  								<groupId>dev.langchain4j</groupId>
  								<artifactId>langchain4j-document-loader-azure-storage-blob</artifactId>
  								<version>${langchain4jVersion}</version>
  							</dependency>
  							<!-- OPTIONAL DEPENDENCY GOES HERE -->
 
  						</additionalDependencies>
  					</plugin>
  				</additionalPluginDependencies>
  			</configuration>
  		</plugin>
  	</plugins>
  </build>
...
</project>

You'll find in the following sections the instruction to add the dependencies required by each specific service (eg. Amazon S3, Azure OpenAI, ...).

Storage Services

pom.xml
<dependency>
    <groupId>dev.langchain4j</groupId>
    <artifactId>langchain4j-document-loader-amazon-s3</artifactId>
    <version>${langchain4jVersion}</version>
</dependency>

Embedding Model Services

pom.xml
<dependency>
    <groupId>dev.langchain4j</groupId>
    <artifactId>langchain4j-azure-open-ai</artifactId>
    <version>${langchain4jVersion}</version>
</dependency>

Vector Stores

pom.xml
<dependency>
    <groupId>dev.langchain4j</groupId>
    <artifactId>langchain4j-azure-ai-search</artifactId>
    <version>${langchain4jVersion}</version>
</dependency>

Connector Configurations

The MuleSoft Vectors connector is shipped with 3 different categories of operations: Document, Embedding and Store. For each category a dedicated configuration must be defined.

Connector Configurations

Document Configuration

The document configuration allows to pick-up the right storage service option among the available ones. When configuring the connection to a specific storage service it's also possible to test it.

Go to the Global Elements in your MuleSoft project, and create a new configuration. In the Connector Configuration, you will find the MuleSoft Vectors Connector Document config. Select it and press OK.

Document Configuration

Depending on the specific storage service selected you'll be presented with different parameter to setup the connection. Following an example.

Document Configuration Connection Parameters

Embedding Configuration

The embedding configuration allows to pick-up the right embedding model service option among the available ones. When configuring the connection to a specific embedding model service it's also possible to test it.

Go to the Global Elements in your MuleSoft project, and create a new configuration. In the Connector Configuration, you will find the MuleSoft Vectors Connector Embedding config. Select it and press OK.

Embedding Configuration

Depending on the specific embedding model service selected you'll be presented with different parameter to setup the connection. Following an example.

Embedding Configuration Connection Parameters

Store Configuration

The store configuration allows to pick-up the right vector store option among the available ones. When configuring the connection to a specific vector store it's also possible to test it.

Go to the Global Elements in your MuleSoft project, and create a new configuration. In the Connector Configuration, you will find the MuleSoft Vectors Connector Store config. Select it and press OK.

Store Configuration

Depending on the specific vector store selected you'll be presented with different parameter to setup the connection. Following an example.

Store Configuration Connection Parameters