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

add reflexion agent #13089

Closed
wants to merge 1 commit into from
Closed

add reflexion agent #13089

wants to merge 1 commit into from

Conversation

jerryjliu
Copy link
Collaborator

No description provided.

@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Apr 24, 2024
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@nerdai
Copy link
Contributor

nerdai commented Apr 25, 2024

Was wondering if it made sense to add a reflection auxiliary method to be used within run_step? That way we can handle orthogonal reflection and run_step logics simultaneously. Specifically, if we do that then "CRITIC" can be a reflection implementation that can be used with any run_step logic? Not sure if that makes sense, but just throwing it out there as a thing to perhaps consider. CC: @logan-markewich

@nerdai
Copy link
Contributor

nerdai commented Apr 25, 2024

Was wondering if it made sense to add a reflection auxiliary method to be used within run_step? That way we can handle orthogonal reflection and run_step logics simultaneously. Specifically, if we do that then "CRITIC" can be a reflection implementation that can be used with any run_step logic? Not sure if that makes sense, but just throwing it out there as a thing to perhaps consider. CC: @logan-markewich

For CRITIC, I probably will just implement it for now within run_step to move this along. Self-Reflection can be viewed as a a special case to CRITIC (i.e., no tool use in critique phase, and just rely on the LLM itself to perform the reflection).

@logan-markewich
Copy link
Collaborator

Yea I was trying to think of a generic way to do this. Adding a "reflection" method to the agent feels a little too specific though 🤔 unless you meant just a general utils function somewhere (then Maybe that's nice, like a little tool box of agent reasoning tools when building a custom loop?)

@nerdai
Copy link
Contributor

nerdai commented Apr 25, 2024

I agree having a public method reflection feels a bit too much. Was thinking of it to be a private method, but maybe thats not much different.

I like the sounds of the general utils approach for agents to use. How would you envision implementing something like this?

@@ -0,0 +1,502 @@
{
Copy link
Contributor

@nerdai nerdai Apr 25, 2024

Choose a reason for hiding this comment

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

Line #60.        return reflection, ChatMessage.from_str(feedback_str, role="user")

Should the reflection take on the role of "user" or "assistant"?


Reply via ReviewNB

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think its supposed to mimic feedback from a human/3rd-party, so user makes sense to me 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, just about 10-15 mins ago I had to similar things for CRITIC implementation lol. This makes more sense to me now -- my b.

@logan-markewich
Copy link
Collaborator

@nerdai Yea I don't know how feasible or extensible it is, but having a set of tools that have the same API interface to use when designing run_step loops might be useful

I tried doing this at one point, but everything is use-case specific that I wasn't finding it easy to generalize. Maybe a common API interface is just not possible

@nerdai nerdai mentioned this pull request May 2, 2024
9 tasks
@nerdai
Copy link
Contributor

nerdai commented May 2, 2024

I've adapted the self reflection class and ported over to #13108 instead. I've listed you (@jerryjliu) as the author for it in the llamahub metadata 😀

As such, I'm closing this PR!

@nerdai nerdai closed this May 2, 2024
@jerryjliu
Copy link
Collaborator Author

I've adapted the self reflection class and ported over to #13108 instead. I've listed you (@jerryjliu) as the author for it in the llamahub metadata 😀

As such, I'm closing this PR!

lol don't worry about attribution i'm going to say you made it on the outgoing socials

@nerdai
Copy link
Contributor

nerdai commented May 2, 2024

I've adapted the self reflection class and ported over to #13108 instead. I've listed you (@jerryjliu) as the author for it in the llamahub metadata 😀
As such, I'm closing this PR!

lol don't worry about attribution i'm going to say you made it on the outgoing socials

lol i figured as much -- excuse my pedantic nature haha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants