Skip to content

(wip) feat: add context grounding metadata to tool spans#531

Draft
saksharthakkar wants to merge 2 commits intomainfrom
feat/context-grounding-traces
Draft

(wip) feat: add context grounding metadata to tool spans#531
saksharthakkar wants to merge 2 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

saksharthakkar and others added 2 commits February 6, 2026 14:24
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>
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.

1 participant