Skip to main content

Controller Setup Guide

This guide walks you through customizing your Supervaizer controller step by step.

Overview

info

This step-by-step guide uses the EmailAIAgent as an example.

See the Quickstart guide for installation instructions.

After running supervaizer scaffold, you'll have a template file to customize. This guide shows you how to:

Define agent parameters: ParameterSetup()

Define agent methods: AgentMethod()

Define the fields of the AgentMethods: AgentMethodField()

Declare the agent: Agent()

Define the account: Account()

Setup the server: Server()

note

Open supervaizer_control_example.py and adapt the content to the EmailAIAgent.

1. Define agent parameters

Use Parameter / ParametersSetup to declare what the agent needs. These show up in Supervaize UI and can be marked as env or secret.

Map Parameters
loading...

📖 See the model references

Parameter Documentation

ParameterSetup Documentation

2. Define agent methods

Point Supervaizer to your agent's functions.

tip

It usually saves time to duplicate the main file of the script and create an adapted version where all methods are called with the expected parameters. This is what we have done in the sv_main.py file.

Methods: wire your agent's functions
from supervaizer import AgentMethod

job_start = AgentMethod(
name="start", # This is required
method="sv_main.process_email_workflow", # Path to the main function in dotted notation.
params={}, # If default parameters must be passed to the function.
is_async=False, # Only use sync methods for the moment
fields=[] # Defined below

See below for definition of fields

Additional required methods
job_stop = AgentMethod(
name="stop", # Must be present
method="email_agent.jobs.stop", # Initial deployment does not require this method to do anything
is_async=False,
)

job_status = AgentMethod(
name="status", # Must be present
method="email_agent.jobs.status", # Initial deployment does not require this method to do anything
is_async=False,
)

📖 See the model reference

ParameterModel Documentation

3. Define the fields of the AgentMethods

The fields parameter defines the user input form that will be displayed in the Supervaize UI. Each field specifies what data users need to provide when calling your agent method.

Field setup for the "Start" method

Fields of Start AgentMethod
loading...

📖 See the model reference

AgentMethodField Documentation

4. Declare the agent

The Agent class defines your agent's metadata and capabilities. This is where you specify what your agent does, who maintains it, and how it can be discovered.

Agent definition
loading...

📖 See the model reference

Agent Documentation

5.Setup the Supervaize Account and configure your Environment variables

info

This step is not needed to run the supervaizer as an A2A / ACP server only. See Protocol support

Create your developer account on the Supervaize platform.

Create your API Key and collect your environment variables.

See the Quickstart guide to setup the environment variables

Account definition
loading...

📖 See the model reference

Account Documentation

6. Setup the Server

Config

The Server class wraps all the defined components together.

At the minimum, the server requires at least one agent to be defined and the supervisor account (we are using Supervaize as the supervisor).

Server definition
loading...
Important

Note that if supervaizor_account is provided, the A2A protocol is automatically activated

📖 See the model reference

Server Documentation

Server launch

Server launch
loading...

See Server Start 🚀 for CLI instructions

What's next?