microsoft / autogen

A programming framework for agentic AI 🤖
https://microsoft.github.io/autogen/
Creative Commons Attribution 4.0 International
32.37k stars 4.72k forks source link

[Feature Request]: AutogenStudio: Generalize workflows between agents and groups #1570

Open sidhujag opened 8 months ago

sidhujag commented 8 months ago

Is your feature request related to a problem? Please describe.

Workflow makes the user decide context of the receiver from twoagent and groupchat. Perhaps we can generalize this and receiver can be dynamically chosen and editable based on its type.

Describe the solution you'd like

Screen Shot 2024-02-06 at 3 31 05 PM

Today when creating a workflow you have to choose between the two types. But I am wondering why this is? When you click on the receiver you can detect type and show the right UX for that type to edit it (assistant vs group chat).

Screen Shot 2024-02-06 at 3 56 37 PM

Above you can change receiver to work something like this:

Screen Shot 2024-02-06 at 3 57 59 PM

For receiver agents/groups (Both are conversable agents so shouldn't matter what type of receiver they are here. Both conversate until they are done and both can summarize response back and carry over to the next receiver).

Furthermore, given #1402 got merged you can probably extend this to just +add the receiver's so that you can do something like this:

groupchat_1 = autogen.GroupChat(agents=[user_proxy, research_assistant, critic], messages=[], max_round=50)

groupchat_2 = autogen.GroupChat(agents=[user_proxy, writer, critic], messages=[], max_round=50)

manager_1 = autogen.GroupChatManager(
    groupchat=groupchat_1,
    name="Research_manager",
    llm_config={"config_list": config_list},
    is_termination_msg=lambda x: x.get("content", "").find("TERMINATE") >= 0,
    code_execution_config={
        "last_n_messages": 1,
        "work_dir": "groupchat",
        "use_docker": False,
    },
)
manager_2 = autogen.GroupChatManager(
    groupchat=groupchat_2,
    name="Writing_manager",
    llm_config={"config_list": config_list},
    is_termination_msg=lambda x: x.get("content", "").find("TERMINATE") >= 0,
    code_execution_config={
        "last_n_messages": 1,
        "work_dir": "groupchat",
        "use_docker": False,
    },
)

user = autogen.UserProxyAgent(
    name="User",
    human_input_mode="NEVER",
    is_termination_msg=lambda x: x.get("content", "").find("TERMINATE") >= 0,
    code_execution_config={
        "last_n_messages": 1,
        "work_dir": "tasks",
        "use_docker": False,
    },  # Please set use_docker=True if docker is available to run the generated code. Using docker is safer than running the generated code directly.
)
user.initiate_chats(
    [
        {"recipient": research_assistant, "message": financial_tasks[0], "summary_method": "last_msg"},
        {"recipient": manager_1, "message": financial_tasks[1], "summary_method": "reflection_with_llm"},
        {"recipient": manager_2, "message": writing_tasks[0]},
    ]
)

Where each receiver can also select the summary_method passed along to the next. (from: https://github.com/microsoft/autogen/blob/main/notebook/agentchat_multi_task_chats.ipynb)

Thus you can have N number of receivers and you initiate it as such above with initiate_chats.

If you are able to do this I would also suggest a Groups section under Agents:

Screen Shot 2024-02-06 at 3 47 35 PM

In above. So that you can create your group, associate the agents/skills and steer the group through the system message. You would then select the group as a receiver(s) in a workflow, the same as an agent. Once the GroupChatConfig.allow_repeat_speaker supports the transition specification then we can configure graphs or strategies around how agents should respond in which order through UX elements guiding us in the setup. If the API is made, then we can have skills that will create agents and pass in these transition rules so you can have automated workflow/agent building.

Additional context

No response

sidhujag commented 8 months ago

Another option is to make the workflow manager conversable agent, so that messages can be sent to and from it to allow for cross workflow participation. This would allow skills to guide certain workflows (and not be hardcoded like #1402) and natural conversation to get the data between workflows, while UX would be able to show all the conversations between the workflows.

rysweet commented 1 week ago

bringing autogen studio to 0.4 would enable this..