Langchain4J is used as the base framework for this extension, which integrates Langchain4j capabilities into MuleSoft Anypoint Platform.
๐๐ฏ๐ด๐ฑ๐ช๐ณ๐ฆ๐ฅ ๐ฃ๐บ ๐๐ข๐ฏ๐จ๐๐ฉ๐ข๐ช๐ฏ4๐ซ, Dmytro Liubarskyi, and Lize Raes, we are launching an open-source project for MuleSoft called ๐ด๐๐๐๐ช๐๐๐๐.
๐ฉ ๐๐ก๐๐ญ ๐ข๐ฌ ๐๐ฎ๐ฅ๐๐๐ก๐๐ข๐ง AI Connector?
MuleChain AI is a MuleSoft custom connector (๐ฃ๐ข๐ด๐ฆ๐ฅ on ๐๐ข๐ฏ๐จ๐๐ฉ๐ข๐ช๐ฏ4๐ซ) to provide a complete framework for MuleSoft users to design, build, and manage the lifecycle of AI Agents fully in the Anypoint Platform. It is part of the MuleChain Project with the overall goal to provide capabilities, examples, etc. for MuleSoft Developers.
๐ ๐๐จ๐ฆ๐ฉ๐จ๐ง๐๐ง๐ญ๐ฌ ๐จ๐ ๐๐ฎ๐ฅ๐๐๐ก๐๐ข๐ง Enabled through LangChain4j, MuleChain will provide:
โ ๐๐ข๐ด๐ช๐ฆ๐ณ ๐ช๐ฏ๐ต๐ฆ๐ณ๐ข๐ค๐ต๐ช๐ฐ๐ฏ ๐ธ๐ช๐ต๐ฉ ๐๐๐๐ด ๐ข๐ฏ๐ฅ ๐๐ฆ๐ค๐ต๐ฐ๐ณ ๐๐ต๐ฐ๐ณ๐ฆ๐ด,
โ ๐๐ฑ๐ต๐ช๐ฎ๐ช๐ป๐ฆ๐ฅ ๐๐ด๐ข๐จ๐ฆ ๐ช๐ฏ ๐๐ถ๐ญ๐ฆ๐๐ฐ๐ง๐ต ๐๐ฑ๐ฑ๐ด,
โ ๐๐ค๐ค๐ฆ๐ด๐ด ๐ต๐ฐ ๐๐ ๐๐ฆ๐ณ๐ท๐ช๐ค๐ฆ๐ด, ๐๐๐, ๐๐ฐ๐ฐ๐ญ๐ด, ๐๐ฉ๐ข๐ช๐ฏ, ๐ฆ๐ต๐ค.
๐๐๐ก๐๐ญ ๐๐ข๐ ๐ฐ๐ ๐๐๐ ๐จ๐ง ๐ญ๐จ๐ฉ ๐จ๐ ๐๐๐ง๐ ๐๐ก๐๐ข๐ง4๐ฃ?
MuleChain leverages the MuleSoft ecosystem to provide additional capabilities on top of the great LangChain4j project.
โ Dynamic tooling through a configuration file
โ Flexible tooling through Anypoint Exchange
Through MuleSoft Anypoint Platform, we enabled:
โ E2E Lifecycle Management for AI Agents
โ Centralized design of AI Agents (Anypoint Design Center)
โ AI Agent Portal (Exchange & Anypoint Experience Hub)
โ Fully fledged AI Agent Monitoring (Anypoint Monitoring & Visualizer)
โ Low Code IDE (Anypoint Studio & Anypoint Code Builder)
โ Unit-testing framework (MUnit, currently only in Studio)
๐ ๐๐ก๐๐ง ๐ฐ๐ข๐ฅ๐ฅ ๐๐ฎ๐ฅ๐๐๐ก๐๐ข๐ง ๐๐ ๐๐ฏ๐๐ข๐ฅ๐๐๐ฅ๐ ๐ญ๐จ ๐ญ๐ก๐ ๐๐ฎ๐ฅ๐๐๐จ๐๐ญ ๐๐จ๐ฆ๐ฆ๐ฎ๐ง๐ข๐ญ๐ฒ?
We are targeting the end of June / beginning of July to release MuleChain as an open-source project on GitHub. It will be available on my GitHub account: https://lnkd.in/erFX3HeY.
๐ป ๐๐จ๐ง๐ญ๐ซ๐ข๐๐ฎ๐ญ๐จ๐ซ๐ฌ
Who are the contributors:
-
Jeroen Reizevoort (advisor),
-
Prashant Choudhary (advisor),
-
Ajay Rana (developer),
-
Mihael Bosnjak (devops engineer),
-
Vibhor Sharma (developer),
-
Damian Scherrer (developer)
-
Philipp Schรถne (advisor)
-
and Amir Khan (advisor & developer)
If you want to become a contributor for MuleChain AI Connector, you have to wait until the project is publicly available on GitHub by the end of June.
๐ฅ ๐๐๐ญ๐๐ก ๐จ๐ฎ๐ญ ๐๐จ๐ซ ๐ฆ๐จ๐ซ๐ ๐๐๐ฆ๐จ๐ฌ
We will provide more demos in the coming days, so watch out. You can also subscribe to the YouTube playlist: https://www.youtube.com/watch?v=NeUIduqZLeY&list=PLnuJGpEBF6ZAvWcGm8uwcIkuElVrUaH7l
Also checkout our YouTube Channel: https://www.youtube.com/@MuleChainProject
๐๐ถ๐ฃ๐ด๐ค๐ณ๐ช๐ฃ๐ฆ ๐ต๐ฐ ๐ต๐ฉ๐ช๐ด LinkedIn ๐จ๐ณ๐ฐ๐ถ๐ฑ, ๐ช๐ง ๐บ๐ฐ๐ถ ๐ธ๐ข๐ฏ๐ต ๐ต๐ฐ ๐ญ๐ฆ๐ข๐ณ๐ฏ ๐ฎ๐ฐ๐ณ๐ฆ ๐ข๐ฃ๐ฐ๐ถ๐ต ๐๐ถ๐ญ๐ฆ๐๐ฉ๐ข๐ช๐ฏ: https://lnkd.in/gW3eZrbF
This project extends the Mule Palette with a MuleChain adapter, allowing users to leverage advanced natural language processing and AI features within MuleSoft flows.
- Language Models: Integrate various language models provided by Langchain to generate text, perform language analysis, and handle complex language-based tasks.
- Embeddings: Utilize embedding models to transform text into numerical vectors for tasks such as text similarity, clustering, and search functionalities.
- Tools Integration: Incorporate APIs and other dynamic functionalities into MuleSoft, facilitating the use of external services and data processing tools.
- Image Models: Work with image models for tasks like image generation, recognition, and manipulation.
- Streaming: Support for real-time data processing and interaction with language models.
- The maximum supported version for Java SDK is JDK 17. You can use JDK 17 only for running your application.
- Compilation with Java SDK must be done with JDK 8.
To use this connector, add the following dependency to your application's pom.xml
:
<dependency>
<groupId>com.mule.mulechain</groupId>
<artifactId>mulechain-ai-connector</artifactId>
<version>{version}</version>
<classifier>mule-plugin</classifier>
</dependency>
1.Clone the Repository:
git clone https://github.com/yourusername/langchain4mule.git
cd langchain4mule
- Set Up Your Development Environment:
Ensure you have the necessary tools installed, such as JDK 8 and Maven.
- Build the Project:
mvn clean install
Here's an example of how to use the Langchain connector in a Mule flow:
<flow name="Jira-AI-Summary-Sentiments" doc:id="ecbe99eb-d390-45b0-ab06-802e7c6dc52d" >
<jira:on-updated-issue-trigger doc:name="On new and updated issue trigger" doc:id="005a3180-c483-48ad-aaac-04cb45dd1895" config-ref="Jira_Connector_Config" startDate="2024-05-30" projectIdOrKey="ED" issueType="bug">
<scheduling-strategy >
<fixed-frequency />
</scheduling-strategy>
</jira:on-updated-issue-trigger>
<set-variable value="#[payload.key]" doc:name="Jira Key" doc:id="3a312f7e-a1ef-4f2b-9448-4d2f45d2a250" variableName="key"/>
<set-variable value="#[payload]" doc:name="Changed Issue" doc:id="2d0967e3-561f-48f9-b4ce-c09ca2bea72c" variableName="payload"/>
<os:retrieve doc:name="Retrieve Jira id" doc:id="9865c167-0787-46e5-bad2-67af76d4a069" key="#[vars.key]" objectStore="Object_store">
<os:default-value ><![CDATA[not_synched]]></os:default-value>
</os:retrieve>
<logger level="INFO" doc:name="Logger" doc:id="61981f7d-f242-43ae-8201-0e4b5efcc22c" message="#[payload]"/>
<choice doc:name="Choice" doc:id="844f6743-fcfa-4eee-a3ef-2dafd0ae8048" >
<when expression='#[payload=="not_synched"]'>
<os:store doc:name="Store Jira Id" doc:id="1bff40c1-09eb-4f7f-a574-95909873c947" key="#[vars.key]" objectStore="Object_store">
<os:value ><![CDATA[#["synched"]]]></os:value>
</os:store>
<logger level="INFO" doc:name="Logger" doc:id="cf283a04-9b99-439b-9da2-adc43ea78218" message="#[payload]"/>
<jira:get-rest-api3-issue-comment-by-issue-id-or-key doc:name="Get Comments" doc:id="3c57ae28-ba40-4e4d-bc49-d58576567ad2" config-ref="Jira_Connector_Config" issueIdOrKey="#[vars.key]" />
<ee:transform doc:name="extract all comment bodies" doc:id="8f725d76-eba2-4a93-81a3-73968b4c4b64">
<ee:message>
<ee:set-payload><![CDATA[%dw 2.0
output application/json
---
{
comments: payload.comments..body..content..content..text
}]]></ee:set-payload>
</ee:message>
</ee:transform>
<ee:transform doc:name="Transform Message" doc:id="2f629133-723a-4d20-b275-115a28513fa6">
<ee:message>
<ee:set-payload><![CDATA[%dw 2.0
output application/java
---
write(payload, "application/json")]]></ee:set-payload>
</ee:message>
</ee:transform>
<scatter-gather doc:name="Scatter-Gather" doc:id="8be657af-4236-4888-8c72-419c43148784">
<route>
<mulechain:agent-define-prompt-template doc:name="Agent define prompt template" doc:id="1d2bbd4f-3853-446f-9cf2-80f7f36a59d3" config-ref="DemoKeyLangchain4j" template="You are a support representative who is tasked with creating a short summary of a case that happened between a customer and a company support rep. " instructions="Follow the instructions precisely, do not add any information not provided. Summarize in 1 sentence, and use clear, concise, and straightforward language using the active voice and strictly avoiding the use of filler words and phrases and redundant language. Guide the next steps as maximum 2 bullet points. Keep the emotion of the summary relaxed." dataset='#["dataset: " ++ payload]'/>
</route>
<route>
<mulechain:sentiment-analyze doc:name="Sentiment analyze" doc:id="4c29c266-80d0-42df-9208-7003e8bbff26" config-ref="DemoKeyLangchain4j" data="#[payload]"/>
</route>
</scatter-gather>
<ee:transform doc:name="Transform Message" doc:id="e212a9c0-c8d7-46d1-8ac6-c1666544548c">
<ee:message>
<ee:set-payload><![CDATA[%dw 2.0
output application/json
---
{
"fields": {
"customfield_10050": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": payload."0".payload
}
]
}
]
},
"customfield_10051": payload."1".payload
}
}]]></ee:set-payload>
</ee:message>
</ee:transform>
<jira:update-rest-api3-issue-by-issue-id-or-key doc:name="Edit Issue" doc:id="36f26b7e-f52a-486e-bb97-6de89af232bf" config-ref="Jira_Connector_Config" issueIdOrKey="#[vars.key]" />
</when>
<otherwise >
<os:remove doc:name="Remove" doc:id="3f298f08-c02f-471a-b76b-de25a562993b" key="#[vars.key]" objectStore="Object_store"/>
<logger level="INFO" doc:name="Logger" doc:id="dd7e5a5e-a10b-45c2-a77f-660a9fbfa10d" message='#["Issue already synched: " ++ vars.key]' />
</otherwise>
</choice>
</flow>
We welcome contributions to enhance the functionality and features of this connector. Please follow these steps to contribute:
-
Fork the Repository:
Create your own fork of the repository by clicking the "Fork" button at the top right corner of the repository page.
-
Clone Your Fork: Clone your forked repository to your local machine.
git clone https://github.com/yourusername/mulechain-ai-connector.git cd mulechain-ai-connector
-
Create a Branch:
Create a new branch for your feature or bug fix.
git checkout -b feature/your-feature-name
-
Make your changes:
Implement your changes and commit them with a descriptive commit message.
git add . git commit -m "Add your commit message here"
-
Push your changes:
Push your changes to your forked repository.
git push origin feature/your-feature-name
-
Create a Pull Request:
- Go to your forked repository on GitHub.
- Click the "Compare & pull request" button next to your newly pushed branch. Ensure the base fork is MuleChain-Project/mulechain-ai-connector and the base branch is develop.
- Provide a clear and descriptive title and description for your pull request, explaining what changes you made and why.
- Submit the pull request.
-
Review Process:
Your pull request will be reviewed by the maintainers. You might be asked to make additional changes or provide further explanations. Once your pull request is approved, it will be merged into the develop branch.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or support, please open an issue on GitHub.