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

[Bug]: Implicit "carryover" in nested chats in AssistantAgent.initiate_chat() leads to wrong output #3100

Open
nitink-ads opened this issue Jul 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@nitink-ads
Copy link

nitink-ads commented Jul 10, 2024

Describe the bug

[Background: Lesson 4 "Reflection" from AI Agentic Design Patterns with AutoGen course on DeepLearning.ai .
https://learn.deeplearning.ai/courses/ai-agentic-design-patterns-with-autogen/lesson/4/reflection-and-blogpost-writing ]

This is a good use case where a "critic" agent talks to a "writer" agent, and also calls three additional agents serially as an internal monologue: SEO reviewer, legal reviewer, ethical reviewer. In the write_with_nested_critics() function, the code calls AssistantAgent.initiate_chat() to initiate this chat workflow.

The issue is this: the summary output of the first agent is automatically appended as carryover for the second agent and so on. Unfortunately this causes the summary to go wrong - instead of a summary of the three responses, the first response is used twice and the second one is skipped. I think this is happening because the LLM gets confused with multiple items in the carryover.

Problem: Because the AssistantAgent in its internal code calls chat.initiate_chats(), there is no way to pass the 'finished_chat_indexes_to_exclude_from_carryover' flag all the way from the main AssistantAgent.initiate_chat() method to the chat.initiate_chats() method; even if we provide the flag in the 'kwargs' for AssistantAgent, it does not get to the end.

Steps to reproduce

I can provide code to reproduce the issue.

Model Used

gpt-3.5-turbo-0125

Expected Behavior

==> If we want to call AssistantAgent.register_nested_chats() followed by AssistantAgent.initiate_chat(), we need to be able to control what information is carried over from one chat to the next, otherwise the output can go wrong.

Screenshots and logs

This is what the output looks like: (note that SEO_reviewer output is duplicated and legal_reviewer output is skipped, even though all three were called one after the other: SEO, Legal, Ethical, and all three provided feedback.)

Aggregrate feedback from all reviewers and give final suggestions on the writing.
Context:
{'Reviewer': 'SEO Specialist', 'Review': 'Title could be optimized with relevant keywords. Content can benefit from integrating target keywords for better search visibility. A more compelling meta description could improve click-through rate.'}
{'Reviewer': 'SEO Specialist', 'Review': 'Title could be optimized with relevant keywords. Content can benefit from integrating target keywords for better search visibility. A more compelling meta description could improve click-through rate.'}
{'reviewer': 'Ethics Reviewer', 'review': 'Ensure that the claims made about the benefits and opportunities provided by DeepLearning.AI are accurate and supported by evidence. Avoid making exaggerated statements that could potentially mislead individuals about the outcomes of engaging with the platform. Clearly disclose any affiliations or sponsorships that may affect the objectivity of the content.'}

Additional Information

No response

@nitink-ads nitink-ads added the bug Something isn't working label Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
1 participant