dify icon indicating copy to clipboard operation
dify copied to clipboard

Is it possible to expose the intermediate results or execution process of an ReAct Agent as variables that can be referenced by downstream nodes?

Open linhao622 opened this issue 7 months ago • 1 comments

Self Checks

  • [x] I have searched for existing issues search for existing issues, including closed ones.
  • [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • [x] Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Add observability to track intermediate results

In certain cases, the final output of a ReAct Agent may fall short of expectations. In such situations, leveraging the agent’s intermediate results or execution trace as input for downstream nodes could provide additional value.

For instance, while the agent may invoke multiple tools over several rounds, it typically returns only the result from the final round. It would be beneficial to explore whether the full execution process — including the thought, action_name, action_input, and observation from each round — can be captured and made available as referenceable variables for subsequent processing stages.

2. Additional context or comments

I have conducted tests on both junjiem/mcp_see_agent and langgenius/agent, and found that neither framework currently supports capturing and caching the intermediate results or execution traces as referenceable variables.

3. Can you help us with this feature?

  • [ ] I am interested in contributing to this feature.

linhao622 avatar May 19 '25 06:05 linhao622

Really need!

jhrcc avatar May 21 '25 00:05 jhrcc

Hi, @linhao622. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You requested a feature to expose intermediate results and execution traces (thoughts, actions, observations) of a ReAct Agent as variables for downstream nodes.
  • This enhancement aims to improve observability and enable better multi-step reasoning utilization.
  • You noted that current frameworks like junjiem/mcp_see_agent and langgenius/agent do not support capturing or caching these intermediate steps.
  • A maintainer, jhrcc, has expressed strong agreement with the importance of this feature.
  • The issue remains unresolved with no recent updates.

Next Steps:

  • Please let me know if this feature request is still relevant to the latest version of Dify by commenting on this issue.
  • If I do not hear back within 15 days, I will automatically close this issue.

Thank you for your understanding and contribution!

dosubot[bot] avatar Aug 27 '25 16:08 dosubot[bot]