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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions maestro/src/agents/meta_agent/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# META AGENT

Our goal is to create an agent that can create the relevant agents/workflow.yaml files necessary for you to delegate your tasks.
Our goal is to create an agent that can create the relevant agents/workflow.yaml files necessary for you to delegate your tasks. Currently, because we are process of generalizing our prompts, currently the workflow is split into 2 files, `workflow_agent.yaml` and `workflow_workflow.yaml`.

## Validating/Creating Agents/Workflow files

Expand All @@ -13,7 +13,7 @@ Validating the YAML file adheres to the schema:

Creating the agents(with the ability to manually add tools): `maestro create ./src/agents/meta_agent/agents.yaml`

To run the workflow:
To run the workflow: (Replace `workflow.yaml` with the desired workflow for now)

If you already created the agents and enabled the tool: `maestro run None ./src/agents/meta_agent/workflow.yaml`

Expand Down
93 changes: 92 additions & 1 deletion maestro/src/agents/meta_agent/agents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,95 @@ spec:
**Rules:**
- Replace `N` with the number of agents.
- Replace `{agent_list}` with a **newline-separated list** of agents.
- Output the formatted text exactly as structured."
- Output the formatted text exactly as structured."
---
apiVersion: maestro/v1alpha1
kind: Agent
metadata:
name: Format Workflow Agent
labels:
app: meta-agent
spec:
model: llama3.1
description: "Formats a structured prompt by replacing placeholders with user-defined values."
instructions: |
You are a **workflow prompt formatter agent**. Your job is to format a structured workflow as given below.
**Your task:**
- Replace `{agent_list}` with a newline-separated list of user-defined agents.
- Replace `{num_agents}` with the total number of agents.
**Template (with placeholders):**
START HERE
```
Build a structured workflow using the `workflow_schema` tool as a reference.
I have {num_agents} agents in agents.yaml:
{agent_list}
Requirements:
Ensure the workflow follows the `workflow.schema.json` format.
Each step must:
Reference a valid agent from agents.yaml.
Have a name that describes its function.
The final output should be a valid structured workflow in YAML format, please make it easily readable in a code block.
```
**Example User Input:**
```
number of agents: 2
agent1: weather_fetcher – Retrieves weather data for a given location using OpenMeteo.
Copy link
Member

Choose a reason for hiding this comment

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

should we say "OpenMeteo tool" ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ya

agent2: temperature_comparator – Compares the retrieved temperature with historical averages using OpenMeteo.
```
**Expected Output:**
```
Build a structured workflow using the `workflow_schema` tool as a reference.
I have 2 agents in agents.yaml:
weather_fetcher – Retrieves weather data for a given location using OpenMeteo.
temperature_comparator – Compares the retrieved temperature with historical averages using OpenMeteo.
Requirements:
Ensure the workflow follows the `workflow.schema.json` format.
Each step must:
Reference a valid agent from agents.yaml.
Have a name that describes its function.
The final output should be a valid structured workflow in YAML format, please make it easily readable in a code block.
```
**Rules:**
- Ensure **exact structure formatting**.
- Always replace `{num_agents}` and `{agent_list}` correctly.
- The output **must match the given structure exactly**."
# TEMPORARY AGENTS TO PASS TESTS
---
apiVersion: maestro/v1alpha1
kind: Agent
metadata:
name: Run Workflow Agent
labels:
app: meta-agent
spec:
model: llama3.1
description: "Executes workflow_agent.yaml."
instructions: |
"Your task is to run `workflow_agent.yaml` using the provided user input."
tools: []

---
apiVersion: maestro/v1alpha1
kind: Agent
metadata:
name: Run Workflow Workflow
labels:
app: meta-agent
spec:
model: llama3.1
description: "Executes workflow_workflow.yaml."
instructions: |
"Your task is to run `workflow_workflow.yaml` using the provided user input."
tools: []
42 changes: 11 additions & 31 deletions maestro/src/agents/meta_agent/workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,44 +1,24 @@
apiVersion: maestro/v1alpha1
kind: Workflow
metadata:
name: meta_agent_workflow
name: meta_agent_combined
labels:
project: maestro-demo
spec:
template:
metadata:
name: meta_agent_workflow
name: meta_agent_combined
labels:
project: maestro-demo
agents:
- Format Input Agent
- Create Agent YAML
- Create Workflow YAML
- Run Workflow Agent
- Run Workflow Workflow
prompt: |
number of agents: 2
agent1: weather_fetcher – Retrieves weather data for a given location using OpenMeteo.
agent2: temperature_comparator – Compares the retrieved temperature with historical averages using OpenMeteo.
number of agents: 2
agent1: weather_fetcher – Retrieves weather data using OpenMeteo.
agent2: temperature_comparator – Compares the retrieved temperature with historical averages using OpenMeteo.
steps:
- name: Format Input
agent: Format Input Agent
- name: Create Agent YAML
agent: Create Agent YAML
- name: input
input:
prompt: |
Build a structured workflow using the workflow_schema tool as a reference.

I have two agents in agents.yaml:
weather_fetcher – Retrieves weather data for a given location using the OpenMeteo tool.
temperature_comparator – Compares the retrieved temperature with historical averages using OpenMeteo.

Requirements:

Ensure the workflow follows the workflow.schema.json format.
Each step must:
Reference a valid agent from agents.yaml.
Have a name that describes its function.
The final output should be a valid structured workflow in YAML format, please make it easily readble in a code block
template: "{CONNECTOR}"
- name: Create Workflow YAML
agent: Create Workflow YAML
- name: Run Workflow Agent
agent: Run Workflow Agent
- name: Run Workflow Workflow
agent: Run Workflow Workflow
24 changes: 24 additions & 0 deletions maestro/src/agents/meta_agent/workflow_agent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: maestro/v1alpha1
kind: Workflow
metadata:
name: meta_agent_workflow
labels:
project: maestro-demo
spec:
template:
metadata:
name: meta_agent_workflow
labels:
project: maestro-demo
agents:
- Format Input Agent
- Create Agent YAML
prompt: |
number of agents: 2
agent1: weather_fetcher – Retrieves weather data for a given location using OpenMeteo tool.
agent2: temperature_comparator – Compares the retrieved temperature with historical averages using OpenMeteo tool.
steps:
- name: Format Input
agent: Format Input Agent
- name: Create Agent YAML
agent: Create Agent YAML
24 changes: 24 additions & 0 deletions maestro/src/agents/meta_agent/workflow_workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: maestro/v1alpha1
kind: Workflow
metadata:
name: meta_agent_workflow
labels:
project: maestro-demo
spec:
template:
metadata:
name: meta_agent_workflow
labels:
project: maestro-demo
agents:
- Format Workflow Agent
- Create Workflow YAML
prompt: |
number of agents: 2
agent1: weather_fetcher – Retrieves weather data for a given location using OpenMeteo tool.
agent2: temperature_comparator – Compares the retrieved temperature with historical averages using OpenMeteo tool.
steps:
- name: Format Workflow Agent
agent: Format Workflow Agent
- name: Create Workflow YAML
agent: Create Workflow YAML