Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive flows #2279

Closed
iceman3000 opened this issue Mar 10, 2024 · 6 comments
Closed

Recursive flows #2279

iceman3000 opened this issue Mar 10, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request no-recent-activity There has been no recent activity on this issue/pull request

Comments

@iceman3000
Copy link

Is your feature request related to a problem? Please describe.
Inability to have recursion in flows.

Describe the solution you'd like
Ability to have a loop within the flow

Describe alternatives you've considered
Build recursion into a python node and complete all logic in that.

Additional context
Especially with the introduction of tool calling, and more "agent like" uses of OpenAI, it would be handy to be able to (based on logic), repeat a section of the flow.

e.g. Customer asks a question, search query is generated, request is made to docs, docs are reviewed, new search query is generated based off learning from the docs, docs are reviewed, then response is given to the customer (if AI is now happy with answer).

@iceman3000 iceman3000 added the enhancement New feature or request label Mar 10, 2024
@D-W-
Copy link
Contributor

D-W- commented Mar 11, 2024

Hi @iceman3000 , we don't have plan to introduce recursion/loops in DAG flow since it's not easy to write it in YAML. But we'll introduce a flexible way to execute code script with prompt flow, where your can define orchestration logic with python code. Will that meet your need?

@D-W- D-W- self-assigned this Mar 11, 2024
@LastRemote
Copy link

LastRemote commented Mar 12, 2024

+1 on this request as well. There are some advanced LLM flows (e.g. Self-RAG) that utilize recursion to enhance LLM reliability on various tasks.

@D-W- Thanks for looking into this. I think it might be useful if the orchestration logic, like @iceman3000 said, can trigger part of the flow (usually there will be multiple steps) in a recursive way.

Here is an example from the Knowledge Card paper that uses conditional recursion in its knowledge retrieval process:
Screenshot 2024-03-12 at 20 15 39
I hope we can implement this in Prompt Flow!

@D-W-
Copy link
Contributor

D-W- commented Mar 14, 2024

Hi @LastRemote , in my understanding, in we model above process as a flow, it can be implemented with flex mode:

def entry():
    while need_more_information(question, result):
        auto_selection_result = auto_select(question)
        exp_selection_result = explain_select(question)
        result = retrive(auto_selection_result, exp_selection_result)

Will this meet your requirements?

@ElliotWood
Copy link

Hi @LastRemote , in my understanding, in we model above process as a flow, it can be implemented with flex mode:

def entry():
    while need_more_information(question, result):
        auto_selection_result = auto_select(question)
        exp_selection_result = explain_select(question)
        result = retrive(auto_selection_result, exp_selection_result)

Will this meet your requirements?

Could we please see a complete example of this - also a description of 'flex mode'?

@D-W-
Copy link
Contributor

D-W- commented Mar 26, 2024

Hi @LastRemote , in my understanding, in we model above process as a flow, it can be implemented with flex mode:

def entry():
    while need_more_information(question, result):
        auto_selection_result = auto_select(question)
        exp_selection_result = explain_select(question)
        result = retrive(auto_selection_result, exp_selection_result)

Will this meet your requirements?

Could we please see a complete example of this - also a description of 'flex mode'?

Hi @ElliotWood , flex mode is a mode we're working on to directly execute code script with prompt flow with tracing ability. The code script will be provided by user so user can run complex orchestration logic in it. (e.g. the while loop in above example). Since it's still working in progress, we currently don't have examples/docs about it. I'll update here when it's publicly available.

Copy link

Hi, we're sending this friendly reminder because we haven't heard back from you in 30 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 7 days of this comment, the issue will be automatically closed. Thank you!

@github-actions github-actions bot added the no-recent-activity There has been no recent activity on this issue/pull request label Apr 25, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request no-recent-activity There has been no recent activity on this issue/pull request
Projects
None yet
Development

No branches or pull requests

4 participants