Proposal to Add a "Cache" Feature for Cross-Iteration Data Transfer #6671

Closed
opened 2026-02-21 18:16:47 -05:00 by yindo · 4 comments
Owner

Originally created by @zhangeden on GitHub (Nov 11, 2024).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • 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.

First, thank you for your continuous hard work in making each iteration more powerful and user-friendly. I have been impressed by the improvements and innovations introduced so far.

However, I've encountered a limitation during my work. I need to perform calculations and generate reports that span multiple sections (for example, a report for a client with 5-10 chapters). To ensure quality, I generate each chapter one by one. When I generate the second chapter, in addition to my new prompt, I would like to incorporate the content already generated in the first chapter to maintain coherence and consistency. Currently, there doesn’t seem to be a feature that allows me to achieve this kind of cross-iteration information transfer.

2. Additional context or comments

To address this issue, I propose adding a "cache" module. This feature would function as a storage area where outputs from one iteration can be saved, then accessed as inputs in subsequent or other locations as needed. I suggest making this cache module a system-level parameter module, which can be read and written from any point in the workflow. Furthermore, allowing multiple cache instances would add flexibility in orchestration, making it easier to manage data across complex workflows.

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @zhangeden on GitHub (Nov 11, 2024). ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [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. First, thank you for your continuous hard work in making each iteration more powerful and user-friendly. I have been impressed by the improvements and innovations introduced so far. However, I've encountered a limitation during my work. I need to perform calculations and generate reports that span multiple sections (for example, a report for a client with 5-10 chapters). To ensure quality, I generate each chapter one by one. When I generate the second chapter, in addition to my new prompt, I would like to incorporate the content already generated in the first chapter to maintain coherence and consistency. Currently, there doesn’t seem to be a feature that allows me to achieve this kind of cross-iteration information transfer. ### 2. Additional context or comments To address this issue, I propose adding a "cache" module. This feature would function as a storage area where outputs from one iteration can be saved, then accessed as inputs in subsequent or other locations as needed. I suggest making this cache module a system-level parameter module, which can be read and written from any point in the workflow. Furthermore, allowing multiple cache instances would add flexibility in orchestration, making it easier to manage data across complex workflows. ### 3. Can you help us with this feature? - [X] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 18:16:47 -05:00
yindo closed this issue 2026-02-21 18:16:47 -05:00
Author
Owner

@yuncengshangdepingyuan commented on GitHub (Nov 11, 2024):

I also hope that the nth iteration of the iterative module can input the results of the previous n-1 iterations. For example:

① A workflow I made needs to expand the input problem multiple times, the number of expansions is not fixed, and the results of the previous expansion need to be input as input each time;

② A workflow for solving problems step by step: divide the problem into multiple sub-tasks, and sometimes the solution of the later sub-task needs the solution of the previous sub-task. This function should be easily implemented in code.

@yuncengshangdepingyuan commented on GitHub (Nov 11, 2024): I also hope that the nth iteration of the iterative module can input the results of the previous n-1 iterations. For example: ① A workflow I made needs to expand the input problem multiple times, the number of expansions is not fixed, and the results of the previous expansion need to be input as input each time; ② A workflow for solving problems step by step: divide the problem into multiple sub-tasks, and sometimes the solution of the later sub-task needs the solution of the previous sub-task. This function should be easily implemented in code.
Author
Owner

@zhangeden commented on GitHub (Nov 11, 2024):

I also hope that the nth iteration of the iterative module can input the results of the previous n-1 iterations. For example:

① A workflow I made needs to expand the input problem multiple times, the number of expansions is not fixed, and the results of the previous expansion need to be input as input each time;

② A workflow for solving problems step by step: divide the problem into multiple sub-tasks, and sometimes the solution of the later sub-task needs the solution of the previous sub-task. This function should be easily implemented in code.

I believe that the cache module I proposed could meet both of our needs. Taking your example, after the first iteration runs, the content can be stored in the cache. For the next iteration, you only need to call the cached result, and then add the new result to the bottom of the cache. This would effectively fulfill the functionality you’re looking for. Additionally, this cache module could be used in other parts of the workflow, making it a versatile and powerful foundational feature with great potential.

@zhangeden commented on GitHub (Nov 11, 2024): > I also hope that the nth iteration of the iterative module can input the results of the previous n-1 iterations. For example: > > ① A workflow I made needs to expand the input problem multiple times, the number of expansions is not fixed, and the results of the previous expansion need to be input as input each time; > > ② A workflow for solving problems step by step: divide the problem into multiple sub-tasks, and sometimes the solution of the later sub-task needs the solution of the previous sub-task. This function should be easily implemented in code. I believe that the cache module I proposed could meet both of our needs. Taking your example, after the first iteration runs, the content can be stored in the cache. For the next iteration, you only need to call the cached result, and then add the new result to the bottom of the cache. This would effectively fulfill the functionality you’re looking for. Additionally, this cache module could be used in other parts of the workflow, making it a versatile and powerful foundational feature with great potential.
Author
Owner

@yuncengshangdepingyuan commented on GitHub (Nov 12, 2024):

I also hope that the nth iteration of the iterative module can input the results of the previous n-1 iterations. For example:
① A workflow I made needs to expand the input problem multiple times, the number of expansions is not fixed, and the results of the previous expansion need to be input as input each time;
② A workflow for solving problems step by step: divide the problem into multiple sub-tasks, and sometimes the solution of the later sub-task needs the solution of the previous sub-task. This function should be easily implemented in code.

I believe that the cache module I proposed could meet both of our needs. Taking your example, after the first iteration runs, the content can be stored in the cache. For the next iteration, you only need to call the cached result, and then add the new result to the bottom of the cache. This would effectively fulfill the functionality you’re looking for. Additionally, this cache module could be used in other parts of the workflow, making it a versatile and powerful foundational feature with great potential.

You are right. And if we put the entire workflow in a large iteration module, so that the results of the previous run can be used in the next run for further optimization or task advancement, it would be a very powerful approach. This would be an important step towards moving the workflow from its current "linear" form to a "networked" form.

@yuncengshangdepingyuan commented on GitHub (Nov 12, 2024): > > I also hope that the nth iteration of the iterative module can input the results of the previous n-1 iterations. For example: > > ① A workflow I made needs to expand the input problem multiple times, the number of expansions is not fixed, and the results of the previous expansion need to be input as input each time; > > ② A workflow for solving problems step by step: divide the problem into multiple sub-tasks, and sometimes the solution of the later sub-task needs the solution of the previous sub-task. This function should be easily implemented in code. > > I believe that the cache module I proposed could meet both of our needs. Taking your example, after the first iteration runs, the content can be stored in the cache. For the next iteration, you only need to call the cached result, and then add the new result to the bottom of the cache. This would effectively fulfill the functionality you’re looking for. Additionally, this cache module could be used in other parts of the workflow, making it a versatile and powerful foundational feature with great potential. You are right. And if we put the entire workflow in a large iteration module, so that the results of the previous run can be used in the next run for further optimization or task advancement, it would be a very powerful approach. This would be an important step towards moving the workflow from its current "linear" form to a "networked" form.
Author
Owner

@dosubot[bot] commented on GitHub (Dec 13, 2024):

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

Issue Summary

  • You proposed a "cache" feature to enhance cross-iteration data transfer in workflows.
  • The feature aims to improve coherence and consistency in tasks like generating multi-chapter reports.
  • User yuncengshangdepingyuan supports this idea, noting its potential to facilitate iterative workflows.
  • Both of you agree that this could transform workflows from linear to networked, enhancing flexibility.

Next Steps

  • Is this issue still relevant to the latest version of the Dify repository? If so, please comment to keep the discussion open.
  • Otherwise, this issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Dec 13, 2024): Hi, @zhangeden. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog. I'm marking this issue as stale. **Issue Summary** - You proposed a "cache" feature to enhance cross-iteration data transfer in workflows. - The feature aims to improve coherence and consistency in tasks like generating multi-chapter reports. - User yuncengshangdepingyuan supports this idea, noting its potential to facilitate iterative workflows. - Both of you agree that this could transform workflows from linear to networked, enhancing flexibility. **Next Steps** - Is this issue still relevant to the latest version of the Dify repository? If so, please comment to keep the discussion open. - Otherwise, this issue will be automatically closed in 15 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6671