UiPath LangChain Integration
The UiPath LangChain Integration SDK enables developers to build and deploy LangGraph agents that interact with the UiPath Cloud Platform. It provides tools for interacting with UiPath processes and activities within LangChain workflows. The current PyPI version is 0.9.26. Its release cadence is currently irregular, with significant future releases (v0.1.0, v0.2.0) announced for late 2025.
Warnings
- breaking Future versions (v0.1.0 and above, projected for Dec 2025) will require LangChain 1.0.0+ and LangGraph 1.0.0+. This is a significant dependency upgrade.
- gotcha The current PyPI version `0.9.26` is incompatible with LangChain `1.0.0+` and LangGraph `1.0.0+`. Attempting to use these newer versions will likely result in import errors or runtime issues.
- gotcha Dependency requirements for the `uipath` library also change between `uipath-langchain` versions. `0.9.26` expects `uipath>=2.0.0,<3.0.0`, while future releases like `v0.1.0` specify `uipath 2.2.0` and `v0.2.0` specifies `uipath 2.3.0` and `uipath-runtime 0.3.0`.
Install
-
pip install uipath-langchain
Imports
- UiPathTools
from uipath_langchain.tool_interfaces import UiPathTools
- UiPathChatModel
from uipath_langchain.chat_models import UiPathChatModel
- UiPathLLM
from uipath_langchain.llms import UiPathLLM
- UiPathEmbeddings
from uipath_langchain.embeddings import UiPathEmbeddings
Quickstart
import os
from uipath_langchain.tool_interfaces import UiPathTools
# Configure UiPath LangChain integration
# Replace with your actual values or ensure environment variables are set.
# These are placeholders and must be valid for the integration to work.
os.environ["LANGCHAIN_API_KEY"] = os.environ.get("LANGCHAIN_API_KEY", "your_langchain_api_key_here")
os.environ["LANGCHAIN_API_URL"] = os.environ.get("LANGCHAIN_API_URL", "https://cloud.uipath.com/langchain_api")
os.environ["UIPATH_AGENT_ID"] = os.environ.get("UIPATH_AGENT_ID", "your_uipath_agent_id_here")
print("Attempting to initialize UiPathTools...")
try:
uipath_tools = UiPathTools()
available_tools = uipath_tools.get_available_tools()
print(f"\nSuccessfully initialized UiPathTools. Found {len(available_tools)} tools.")
for tool in available_tools:
print(f"- Tool Name: {tool.name}, Description: {tool.description}")
print("\nFor full agent integration, you would typically integrate these tools with a LangChain LLM and AgentExecutor.")
print("Example:")
print(" from uipath_langchain.chat_models import UiPathChatModel")
print(" from langchain.agents import AgentExecutor, create_react_agent")
print(" from langchain import hub")
print(" from langchain_core.tools import Tool")
print(" # llm = UiPathChatModel()")
print(" # tools_for_agent = [Tool(name=t.name, func=t.func, description=t.description) for t in available_tools]")
print(" # prompt = hub.pull('hwchase17/react')")
print(" # agent = create_react_agent(llm, tools_for_agent, prompt)")
print(" # agent_executor = AgentExecutor(agent=agent, tools=tools_for_agent, verbose=True)")
print(" # response = agent_executor.invoke({'input': 'Your query that uses a UiPath tool'})")
except Exception as e:
print(f"\nFailed to initialize UiPathTools: {e}")
print("Please ensure your LANGCHAIN_API_KEY, LANGCHAIN_API_URL, and UIPATH_AGENT_ID are correctly configured and reachable.")
print("Also, verify that the UiPath Assistant is running and connected if you expect specific tools.")