Skip to content

feat: v1 SQL prompt with enriched DataFabric tool description#833

Merged
UIPath-Harshit merged 1 commit intomainfrom
feat/datafabric-v1-prompt-enriched-tool-description
May 8, 2026
Merged

feat: v1 SQL prompt with enriched DataFabric tool description#833
UIPath-Harshit merged 1 commit intomainfrom
feat/datafabric-v1-prompt-enriched-tool-description

Conversation

@UIPath-Harshit
Copy link
Copy Markdown
Contributor

@UIPath-Harshit UIPath-Harshit commented May 7, 2026

Summary

  • Versioned prompt system (prompts/v0.py, prompts/v1.py, prompts/registry.py, prompts/context.py): v1 cherry-picks high-impact patterns from BIRD v7-hybrid — structured 10-step query planning, value resolution via ECP metadata, error taxonomy with targeted fixes, and convergence rules to prevent infinite retry loops.
  • Enriched outer tool description: The query_datafabric tool description now includes actual entity names and descriptions from the agent config, so the outer ReAct agent can ground its "what can I do?" responses in real data instead of hallucinating generic examples like "open orders" or "revenue by region".
  • SQL normalization: Strips trailing semicolons and validates against multi-statement queries in DataFabricQueryTool.
  • SqlPromptContext model: Pydantic model with template variables (value_resolution_strategy, aggregation_hints, domain_guidance, example_queries) that get overridden at runtime based on ECP metadata presence and resource description.

Test plan

  • Verify test_datafabric_query_tool.py passes — SQL normalization and validation
  • Verify test_datafabric_tool.py passes — tool creation and description enrichment
  • Verify test_datafabric_prompt_builder.py passes — prompt building and formatting
  • Manual test: agent correctly lists entity names when asked "what can you do?"
  • Manual test: cross-entity JOIN queries resolve correctly with domain guidance configured

🤖 Generated with Claude Code

Comment thread src/uipath_langchain/agent/tools/datafabric_tool/prompts/v1.py Outdated
Copy link
Copy Markdown
Contributor

@milind-jain-uipath milind-jain-uipath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with a minor comment

Comment thread src/uipath_langchain/agent/tools/datafabric_tool/prompts/v1.py Outdated
…Fabric

Introduces a versioned prompt system (v0/v1) for the DataFabric inner
sub-graph LLM, cherry-picking high-impact patterns from BIRD v7-hybrid:
structured query planning, value resolution via ECP metadata, error
taxonomy, and convergence rules.

Enriches the outer tool description with actual entity names and
descriptions from the agent config so the outer ReAct agent can ground
its responses in real data instead of hallucinating generic examples.

Also adds SQL normalization (trailing semicolon stripping) and
multi-statement validation to the query tool.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@UIPath-Harshit UIPath-Harshit force-pushed the feat/datafabric-v1-prompt-enriched-tool-description branch from 28ffac6 to d03b7a9 Compare May 8, 2026 06:49
@UIPath-Harshit UIPath-Harshit enabled auto-merge (squash) May 8, 2026 06:51
@UIPath-Harshit UIPath-Harshit merged commit 8475f84 into main May 8, 2026
45 checks passed
@UIPath-Harshit UIPath-Harshit deleted the feat/datafabric-v1-prompt-enriched-tool-description branch May 8, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants