Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ This sample shows how to build an AI assistant using LangGraph and Tavily search
## [Company research agent](company-research-agent)
This sample demonstrates how to create an agent that researches companies and develops outreach strategies using web search capabilities.

## [Data Fabric coded agent](datafabric-coded-agent)
This sample demonstrates a coded LangGraph agent using the same Data Fabric query-tool core as low-code entity-set contexts, including runtime entity and folder overrides.

## [Email organizer agent](email-organizer-agent)
This sample shows how to automate Outlook inbox organization with AI-powered rule suggestions and human-in-the-loop approval.

Expand Down
17 changes: 17 additions & 0 deletions samples/datafabric-coded-agent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Data Fabric agent

A minimal LangGraph agent that queries a Data Fabric entity with
`create_datafabric_tool` with direct entity references.

Replace the entity ID, name, and folder key in `graph.py` with your entity values.

Pass the coded agent's outer system prompt to both `create_agent` and
`create_datafabric_tool`. The latter forwards it to the tool's inner
SQL-generation graph so the same agent instructions apply at both levels.

## Usage

```bash
uv sync
uip codedagent run agent '{"messages":[{"role":"user","content":"List the names."}]}'
```
24 changes: 24 additions & 0 deletions samples/datafabric-coded-agent/graph.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from langchain.agents import create_agent
from uipath.platform.entities import DataFabricEntityItem

from uipath_langchain.agent.tools import create_datafabric_tool
from uipath_langchain.chat import UiPathChat

llm = UiPathChat(model="gpt-4.1-mini-2025-04-14")
system_prompt = "Answer questions using only the configured Data Fabric entities."

datafabric_tool = create_datafabric_tool(
llm=llm,
name="query_agent_test",
description="Query the agentTest Data Fabric entity.",
base_system_prompt=system_prompt,
entities=[
DataFabricEntityItem(
id="1312e893-8295-f111-9b33-0022482a9eea",
name="agentTest",
folder_key="379fec63-62b1-41ec-b2fc-718f8f7dda3c",
)
],
)

graph = create_agent(llm, tools=[datafabric_tool], system_prompt=system_prompt)
7 changes: 7 additions & 0 deletions samples/datafabric-coded-agent/langgraph.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"dependencies": ["."],
"graphs": {
"agent": "./graph.py:graph"
},
"env": ".env"
}
14 changes: 14 additions & 0 deletions samples/datafabric-coded-agent/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[project]
name = "datafabric-coded-agent"
version = "0.0.1"
description = "Coded agent that queries a UiPath Data Fabric entity"
authors = [{ name = "UiPath" }]
dependencies = [
"uipath-langchain",
]
requires-python = ">=3.11"

[dependency-groups]
dev = [
"uipath-dev",
]
1 change: 1 addition & 0 deletions samples/datafabric-coded-agent/uipath.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
4 changes: 3 additions & 1 deletion src/uipath_langchain/agent/tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""Tool creation and management for LowCode agents."""
"""Tool creation and management for low-code and coded agents."""

from .a2a import A2aClient, create_a2a_tools_and_clients, open_a2a_tools
from .context_tool import create_context_tool
from .datafabric_tool import create_datafabric_tool
from .escalation_tool import create_escalation_tool
from .extraction_tool import create_ixp_extraction_tool
from .integration_tool import create_integration_tool
Expand All @@ -26,6 +27,7 @@
"create_tools_from_resources",
"create_tool_node",
"create_context_tool",
"create_datafabric_tool",
"open_mcp_tools",
"create_process_tool",
"create_integration_tool",
Expand Down
8 changes: 2 additions & 6 deletions src/uipath_langchain/agent/tools/datafabric_tool/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
"""Data Fabric tool module for entity-based SQL queries."""

from .datafabric_tool import (
create_datafabric_query_tool,
)
from .datafabric_tool import create_datafabric_query_tool, create_datafabric_tool

__all__ = [
"create_datafabric_query_tool",
]
__all__ = ["create_datafabric_query_tool", "create_datafabric_tool"]
Loading