feat: add coded agent Data Fabric tool - #1034
Conversation
837aace to
f8d81df
Compare
|
Jira tracking for the two Data Fabric issues covered/discovered during this change:
Both bugs are assigned to Harshit and added to DataFabric S201. |
f8d81df to
147ae0f
Compare
There was a problem hiding this comment.
Pull request overview
Adds a supported public construction path for the Data Fabric query tool in coded agents by reusing the same core implementation as low-code context tools, while keeping Data Fabric prompt guidance and adding a minimal coded-agent sample.
Changes:
- Refactors Data Fabric tool creation around a shared, framework-neutral config builder and entity normalization.
- Updates the Data Fabric SQL prompt rule around
LIMITto exempt scalar aggregate queries. - Adds/extends tests and introduces a minimal coded-agent sample wiring
create_datafabric_query_toolintocreate_agent.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/agent/tools/test_datafabric_tool.py | Adds coverage for the new public factory behavior, low-code factory reuse, and lazy entity resolution. |
| tests/agent/tools/test_datafabric_prompt_builder.py | Verifies the updated prompt guidance for scalar aggregate queries (no required LIMIT). |
| src/uipath_langchain/agent/tools/datafabric_tool/datafabric_tool.py | Introduces shared tool config + entity normalization and centralizes tool construction. |
| src/uipath_langchain/agent/tools/datafabric_tool/datafabric_prompts.py | Adjusts the “LIMIT” rule wording to avoid forcing LIMIT for scalar aggregates. |
| src/uipath_langchain/agent/tools/datafabric_tool/init.py | Simplifies exports for the Data Fabric tool module. |
| src/uipath_langchain/agent/tools/init.py | Re-exports create_datafabric_query_tool at the top-level tools package. |
| samples/README.md | Adds a pointer to the new Data Fabric coded-agent sample. |
| samples/datafabric-coded-agent/uipath.json | Adds minimal coded-agent sample config file. |
| samples/datafabric-coded-agent/README.md | Documents how to run the coded-agent sample. |
| samples/datafabric-coded-agent/pyproject.toml | Defines a minimal sample project depending on uipath-langchain. |
| samples/datafabric-coded-agent/langgraph.json | Declares the sample graph entrypoint and environment file. |
| samples/datafabric-coded-agent/graph.py | Demonstrates constructing and passing the Data Fabric query tool directly to create_agent. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
147ae0f to
3edbd98
Compare
3edbd98 to
bd846b4
Compare
|
Correction after revisiting the lifecycle boundary: the PR now intentionally exposes two interfaces. Coded agents use |
dc2ead6 to
008f4b1
Compare
008f4b1 to
a68afb3
Compare
|



Summary
create_datafabric_tool(...)factory for coded agents that accepts directDataFabricEntityItemreferences and the outer system promptcreate_datafabric_query_tool(...)as the low-codeAgentContextResourceConfigadapter used bycontext_toolWhy
Low-code and coded agents have different configuration lifecycles. Low-code receives an
AgentContextResourceConfigfrom Agent Builder, while coded agents declare the tool and entity references directly in Python. The public interfaces reflect that boundary instead of requiring coded agents to manufacture a low-code resource model.Interfaces
Coded agent
The coded caller explicitly passes the same outer system prompt to the Data Fabric factory. The factory forwards it to the inner SQL-generation graph as
## Agent Instructions.Low-code context adapter
The low-code adapter remains consumed internally by
create_context_tooland forwards the configured outer system prompt into the inner graph.Impact
Both paths build the same Data Fabric query implementation and resolve entity schemas lazily on first invocation. The current coded-agent binding scanner still does not discover entity bindings declared through the coded factory;
uip codedagent initemits an empty resource list. Default entity resolution is verified, while generated binding overrides remain a follow-up integration boundary.Tracking
LIMIT; fixed hereValidation
base_system_promptreaches the lazy Data Fabric handleruip codedagent run agenton alpha resolved entity1312e893-8295-f111-9b33-0022482a9eea, generatedSELECT name FROM agentTest LIMIT 100, received HTTP 200 with zero rows, and returnedThere are no names available in the data.entity_key="agentTest"; resolver now correctly uses the entity GUID