Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create generalization for workflow, agents #286

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

george-lhj
Copy link
Collaborator

@george-lhj george-lhj commented Mar 5, 2025

This is solving issue #281
 
If you look at the workflow, I've separated the original workflow into 2, workflow.agent which creates the agents.yaml file and also workflow.workflow which creates the workflow.yaml file. This is becuase it gives better control over the prompt as well as simplifies the execution.

I've created the original prompt so that both of these actually have the same starting prompt, which means they can be either:
(1) run in parallel to be executed from the original prompt (so that both these agents use that og prompt, and not the output of whatever gets executed first)
(2) create another overarching workflow that calls on both of these workflows, so we need to add support for a workflow executing another workflow? As I would have an overarching workflow.yaml that has one prompt that should be passed and execute the 2 current workflow files.
(3) other ideas

I'm not too sure which one to go for, seems like the parallel right now may be a bit slow? So I'm leaning toward the 2nd idea. WDYT? And is this possibly creating any new features in the backend we need to address?

@george-lhj george-lhj marked this pull request as draft March 5, 2025 18:16
@george-lhj
Copy link
Collaborator Author

Note: test currently failing because I have renamed the workflow files, easy fix once a solution is decided.

@george-lhj george-lhj requested a review from psschwei March 5, 2025 18:32
@george-lhj george-lhj added the discussion Items requiring discussions label Mar 5, 2025
@george-lhj george-lhj linked an issue Mar 5, 2025 that may be closed by this pull request
@psschwei
Copy link
Collaborator

psschwei commented Mar 5, 2025

I'm having a bit of trouble following what the different options you laid out entail (possibly just due to me not being familiar with this workstream). Could you maybe spell them out in a bit more detail?

@george-lhj
Copy link
Collaborator Author

I'm having a bit of trouble following what the different options you laid out entail (possibly just due to me not being familiar with this workstream). Could you maybe spell them out in a bit more detail?

Sure sorry.

Right now, to execute a demo, we would simply run the command maestro run agent.yaml workflow.yaml. Then, this creates the agents based on the agent yaml file and then executes the workflow based on the workflow.yaml file.

Now, we have a new goal which is to have an meta-agent that given a prompt, we can create the agents/workflow yamls automatically.

I am able to generalize the process for the creation of agents currently, but its hard to generalize for workflow if its executed after the creation of agents (as sequentially or condionally, the output of the previous step should be the agents.yaml file, which doesn't make sense for the prompt of creating the workflow.yaml file.

Instead, I have split these processes to use the same prompt, but in 2 different workflow files because their process is different. Because they have the same prompt, I think we can execute them in parallel, or instead create an overarching workflow that would execute both of these using the same prompt.

Is this a bit more clear? Sorry, the nature of meta-agent is just a bit recursive so its a bit confusing at first

@psschwei
Copy link
Collaborator

psschwei commented Mar 5, 2025

Thanks, that's helpful.

I wonder if the agent creation step should have two outputs:

  1. the agent yaml, and
  2. a list of agent names

They'd get returned as a dictionary, and then we could pass (2) as part of the input for the workflow creation step.

Alternatively, maybe there's a need for a third agent that can scan the agent file and return the name(s) of available agents.

It is also very possible I'm drastically overthinking things and there's a simpler solution. Just wanted to call that one out too :)

@george-lhj
Copy link
Collaborator Author

Thanks, that's helpful.

I wonder if the agent creation step should have two outputs:

  1. the agent yaml, and
  2. a list of agent names

They'd get returned as a dictionary, and then we could pass (2) as part of the input for the workflow creation step.

Alternatively, maybe there's a need for a third agent that can scan the agent file and return the name(s) of available agents.

It is also very possible I'm drastically overthinking things and there's a simpler solution. Just wanted to call that one out too :)

This makes sense, but currently based on how we have defined our process in workflow.py, step.py, etc, we directly pass the output of the previous agent into the next agent as the prompt, which means we would have to pass the entire dictionary object as the prompt which isn't necessary and adds complexity. Of course, we can add more changes inside the backend, but thats prob a question for @maximilien or @akihikokuroda

Copy link
Member

@maximilien maximilien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this... I assume you have more work since it's DRAFT. I'll keep an eye and review soon as you update. Really excited to try this. Nice progress @george-lhj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Items requiring discussions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generalize workflow creation in meta agents
3 participants