PraisonAI icon indicating copy to clipboard operation
PraisonAI copied to clipboard

Process String Definition for Agent Execution Order Not Working

Open autelai4 opened this issue 11 months ago • 1 comments

Description

I am trying to define the execution order between agents using a string as process, passed into the agents.start(process) function, but it seems to have no effect. The agents still execute in the order I initialized them, rather than following the order defined in the process string.

Here is the complete code:

from praisonaiagents import Agent, PraisonAIAgents

# developer agent
developer = Agent(
    name="developer",
    role="Developer",
    goal="Develop a feature based on requirements with React",
    tools=[],
    self_reflect=False
)

# designer agent
designer = Agent(
    name="designer",
    role="Designer",
    goal="Design a feature's UI style and interaction details based on requirements",
    tools=[],
    self_reflect=False
)

# tester agent
tester = Agent(
    name="tester",
    role="Tester",
    goal="Test a feature based on requirements",
    tools=[],
    self_reflect=False
)

# product_manager agent
product_manager = Agent(
    name="product_manager",
    role="Product Manager",
    goal="Output a product requirement document based on requirements",
    tools=[],
    self_reflect=False
)

# Running agents
agents = PraisonAIAgents(
    agents=[developer, designer, tester, product_manager]
)

process = """
Task: Develop a select box component that supports single and multiple selection based on requirements

Process:
1. The product manager executes: Output a product requirement document based on requirements

2. The designer executes: Design a feature's UI style and interaction details based on requirements

3. The product manager, developer, and tester discuss and challenge the design and interaction details until everyone agrees on the solution

4. The developer executes: Develop the feature based on the requirements and the design

5. The tester executes: Test the feature to ensure it works as expected, and output a test report

6. The product manager executes: Perform a second round of testing to ensure the feature works as expected, and output a second round of test report

7. The product manager executes: Summarize the feature based on the test results, and output a product archive document
"""

agents.start(process)

Steps to Reproduce

  1. Define multiple agents (e.g., developer, designer, tester, product_manager).
  2. Define a string process to set the execution order.
  3. Call agents.start(process) and observe the results.

Expected Behavior

I expect the agents to execute in the order defined by the process string.

Actual Behavior

The agents execute in the order they were initialized, ignoring the defined process string.

Environment

  • OS: Mac
  • Version: praisonaiagents v0.0.65

Additional Context

https://github.com/user-attachments/assets/e96280bc-2b34-452a-a1bd-8c25e7c40a22

autelai4 avatar Mar 17 '25 03:03 autelai4

@autelai4 There are different types of process,es and it's implementation is here https://docs.praison.ai/concepts/process

Below is not a process but an instruction.

instruction = """
Task: Develop a select box component that supports single and multiple selection based on requirements

Process:
1. The product manager executes: Output a product requirement document based on requirements

2. The designer executes: Design a feature's UI style and interaction details based on requirements

3. The product manager, developer, and tester discuss and challenge the design and interaction details until everyone agrees on the solution

4. The developer executes: Develop the feature based on the requirements and the design

5. The tester executes: Test the feature to ensure it works as expected, and output a test report

6. The product manager executes: Perform a second round of testing to ensure the feature works as expected, and output a second round of test report

7. The product manager executes: Summarize the feature based on the test results, and output a product archive document
"""

agents.start(instruction)

MervinPraison avatar May 27 '25 04:05 MervinPraison

@autelai4 please re-open if you still find issues.

MervinPraison avatar May 30 '25 10:05 MervinPraison