Skip to content

Implement a loop agent #862

@dgageot

Description

@dgageot

This is a special type of agent / sub-agent with those characteristics:

  • It calls its sub-agents in a loop
  • It loops until it's done
  • It has multiple ways to exit the loop:
    • It can exit after a user defined number of iterations
    • Each sub-agent can also exit if some per agent condition is met. An exit condition is probably a "question" and an expected "answer" that triggers the exit
  • The output of each sub-agent goes as an input to the next sub-agent in the list

The configuration would be something along those lines (lots of room for improvements!):

agents:
  root:
    model: model
    type: loop
    sub_agents: [first, second]
    exit_conditions:
      max_iterations: 5
      per_agent_conditions:
        first:
          question: "Are we done?"
          expected_answer: "yes"

  first:
    ...
  second:
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions