add-agent — Add Agent to Project
Adds a new agent to an existing AgentOps Stacks project by copying an existing agent as a template and wiring it into databricks.yml and the manifest.
When to use
- User wants to add a second (or third, etc.) agent to their project
- User says "add agent", "new agent", "create another agent"
- The project already exists (has
databricks.ymland.agentops-stacks/manifest.yml)
Workflow
- Locate the project — find
databricks.ymlin the current directory or parents - List existing agents — show what agents already exist under
src/agents/ - Gather inputs:
- Agent name — must match
^[a-z][a-z0-9_]{2,}$ - Source agent — which existing agent to copy from (default: first found)
- Agent name — must match
- Run the script:
python plugin/skills/agentops-stacks/scripts/add_agent.py \ --name <agent_name> \ --from <source_agent> \ --project-dir <project_root> - Guide customization — tell the user to edit:
src/agents/<name>/graph.py— agent behavior and component wiringsrc/agents/<name>/tools.py— which tools this agent usessrc/agents/<name>/eval/gates.yml— quality bar for this agentsrc/agents/<name>/app.yaml— runtime env vars if different from source
What the script does
- Copies
src/agents/<source>/tosrc/agents/<new_name>/ - Replaces all references to the source agent name with the new name
- Appends a per-agent experiment resource to
databricks.yml - Appends a new app resource to
databricks.yml - Adds the agent to
.agentops-stacks/manifest.yml
Error handling
- Agent name already exists → abort
- Invalid name format → abort with pattern hint
- Source agent not found → abort, show available agents
- No
databricks.ymlfound → abort, not an AgentOps Stacks project
Example
User: add a support agent to this project
Assistant: I'll add a new agent based on your existing "rag" agent.
> python .../add_agent.py --name support --from rag --project-dir .
Created: src/agents/support/
Updated: databricks.yml
Updated: manifest.yml
Next, customize the agent:
- Edit src/agents/support/graph.py for this agent's behavior
- Edit src/agents/support/tools.py for tool selection
- Run: databricks bundle deploy -t dev