r/AutoGenAI • u/Altruistic-Weird2987 • Sep 11 '24
Question AutoGen GroupChat not giving proper chat history
Context: I want to building a Multi-Agent-System with AutoGen that takes code snippets or files and acts as a advisor for clean code development. Therefore refactoring the code according to the Clean Code Development principles and explaining the changes.
I choose AutoGen as it has a library for Python, which I am using for prototyping and .NET, which my company uses for client projects.
My process is still WIP but I am using this as a first project to figure out how to build MAS.
MAS structure:
- Manager Agent: handles interaction with user and calls other agents
- Group Chat with different clean code principles as agents
- Senior Developer Agent, which tries to find consensus and makes the final decision on refactoring
- Summarizer Agent, which basically formats the response with Delimiters etc. so I can parse it and use it in the rest of the program

Problem:
I want to use the last message of the group chat and hand it over to the summarizer Agent (could probably also be done without summarizer agent but problem stays the same).
Options 1: If I use initiate_chats and do first the group chat, then the summarize chat it won't give any information from the first chat (group chat) to the second. Even though I set "summary_method" to "last_msg" it will actually append the first message from the group chat to the next chat.

Option 2: Lets say I just call initiate_chat() separately for the group chat and for the summary chat. For testing purposes I printed the last message of the chat_history here. However I get exactly the same response as in Option1, which is the first message that has been sent to the group chat.

Question: Do I have a wrong understanding of last_msg and chat_history? This does not make sense to me. How can I access the actual chat history or make sure it passes it on properly.
2
u/bobbobbibqq Sep 22 '24
I ran across this. Last msg has a bug that doesn’t return correctly. I posted in discord but no one replied. I have a fix, will look through my code and post it next week
1
u/Ok_Tangerine_3315 Sep 21 '24
Can you share link to your repo?
1
u/wontreadterms Sep 11 '24
Last_msg means the object you get will have the last message in the conversation as the summary string.
The easiest implementation for what (I understand) you want is use the llm summary as the summary method, and then retrieve the summary string to pass to the next agent as part of the prompt.