AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Agent group

Open MKdir98 opened this issue 1 year ago • 5 comments

Duplicates

  • [X] I have searched the existing issues

Summary 💡

Having a group of agents is very important to us. Instead of working with just one agent, each agent can create a new agent in front of it. The agents can effectively perform tasks with more specialized prompts. My proposal for this issue is as follows.

AgentMember(Agent):
   properties:
      id: string: uuid based for recognizing an agent
      name: string
      description: string
      initial_promt: string
      boss: AgentMember: agent should reutrn result of task to its boss
      task_queue: queue<Task>: a storge for saving messages from other angets
      pending_tasks: Dict<id, Task>: all tasks have roles in it
      llm_provider: LLM Provier
      childs: List<AgentMember>: all agents work for this Agent
      able_to_create_agent: bool: This agent can create another agent
   methods:
      async_send(agenet_id, task: TaskRequestBody):
      async_recieve(sender_id, task: TaskRequestBody):
      async_reply(agent_id, task_id, taskResult: TaskResult):
AgentGroup:
   properties:
       ceo: the head of AgentGroup
       tasks:
   create_task(TaskRequestBody):
Task(we have this right now):
    properties:
       status: enum: can be pending or wait for doing by other agents

commands that we need: assign_task_to_child_agent tell_father_I_can't_do_it create_an_agent_for_this_task (if create agent is enable) recruite_agent_for_an_agent

Examples 🌈

ceo = AgentMember(
name="ceo",
description="you are ceo of a company",
able_to_create_agent=true,
boss=null
)

cto = AgentMember(
name="cto",
description="you are cto of a company",
able_to_create_agent=false,
boss=ceo
)

techLead = AgentMember(
name="techLead",
description="you are techLead of a company you'll reveiew and merge merge requests",
able_to_create_agent=false,
boss=cto
)

devops_lead = AgentMember(
name="devops_lead",
description="you are devops_lead of a company you should prepare infrustructre like gitlab, servers for deploy",
able_to_create_agent=false,
boss=cto
)

hr_lead = AgentMember(
name="hr_lead",
description="you are hr_lead of a company You'll recruite agents when we need it",
able_to_create_agent=true,
boss=ceo
)

agentGroup = AgentGrouop(
ceo = ceo
)

agentGroup.create_task("make and deploy a selling webiste")

Motivation 🔦

Agents in Autogpt can't talk with each other. they just can with themselves. we can create specific agents with specific tasks.

MKdir98 avatar Feb 10 '24 11:02 MKdir98

@Pwuts thoughts on the datastructure

ntindle avatar Feb 12 '24 01:02 ntindle

Data structure looks pretty good in itself. Comments:

  • AgentMember has both a boss and a childs property. Are these redundant?
  • Do all AgentMembers have access to the same set of commands/actions?

Pwuts avatar Feb 13 '24 10:02 Pwuts

  • AgentMember has both a boss and a childs property. Are these redundant?

Sometimes we need to access our boss to report our work. And sometimes find a good child or employee to assign tasks to it. Can we handle this in just one way?

MKdir98 avatar Feb 13 '24 11:02 MKdir98

  • Do all AgentMembers have access to the same set of commands/actions?

I'm not sure about this. One of the main challenges in implementation that I have is the create_agent part. My idea for that right now is to create an array of all agents that can create_agent (able_to_create_agent is true)(its name will be AgentFactory). When a normal agent needs to create a new agent (request for create agent) it will reach to CEO of AgentGroup and it will send this request to AgentFactory. It's not clean I think. In a normal company HR team will hire new employees. I'm trying to do something like this.

MKdir98 avatar Feb 13 '24 11:02 MKdir98

For report: I tried to implement whatever I said. I was forced to change some of the structure. It has a lot of work to do. I'm working on it right now https://github.com/MKdir98/AutoGPT/tree/feat/agent-group

MKdir98 avatar Feb 17 '24 11:02 MKdir98