Skip to content

feat: add context grounding metadata to tool spans#531

Open
saksharthakkar wants to merge 3 commits intomainfrom
feat/context-grounding-traces
Open

feat: add context grounding metadata to tool spans#531
saksharthakkar wants to merge 3 commits intomainfrom
feat/context-grounding-traces

Conversation

@saksharthakkar
Copy link
Contributor

Summary

  • Set tool_type to "context_grounding" (was "context"/"internal") for all CG tools across context_tool.py, batch_transform_tool.py, and deeprag_tool.py
  • Add CG-specific metadata: retrieval_mode, output_columns, web_search_grounding, citation_mode, number_of_results, and conditional static_query
  • Add recording=False to all @mockable decorators on CG tool functions to suppress duplicate inner spans

Test plan

  • Run batch_transform agent via uipath run, export traces, verify contextGroundingTool span with correct attributes
  • Run deep_rag agent, verify retrieval_mode: "DeepRag" and citation_mode in trace
  • Run semantic_search agent, verify retrieval_mode: "SemanticSearch" and number_of_results in trace
  • Verify static query tools populate static_query in metadata
  • Verify no duplicate inner toolCall spans from @mockable

🤖 Generated with Claude Code

@CalebMartinUiPath CalebMartinUiPath force-pushed the feat/context-grounding-traces branch from 330c391 to 73e1752 Compare February 11, 2026 21:16
@CalebMartinUiPath CalebMartinUiPath marked this pull request as ready for review February 12, 2026 00:00
@CalebMartinUiPath CalebMartinUiPath changed the title (wip) feat: add context grounding metadata to tool spans feat: add context grounding metadata to tool spans Feb 12, 2026
"display_name": tool_name,
"args_schema": input_model,
"output_schema": output_model,
"retrieval_mode": "BatchTransform",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

nit: metadata creation can be extracted in to common helper function to avoid duplication across multiple tools...

saksharthakkar and others added 3 commits February 16, 2026 13:44
Set tool_type to "context_grounding" and populate retrieval_mode, output_columns,
web_search_grounding, citation_mode, number_of_results, and static_query in tool
metadata for all CG tools (SemanticSearch, DeepRag, BatchTransform). Add
recording=False to @mockable decorators to suppress duplicate inner spans.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Enables the agents-python instrumentor to parse tool output back into a
dict and extract output attachments, index_id, and other structured fields
for context grounding tool spans.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@CalebMartinUiPath CalebMartinUiPath force-pushed the feat/context-grounding-traces branch from 73e1752 to a3a5cfb Compare February 16, 2026 21:47
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