The following step-by-step guides you to create your first agent on IBM watsonx Orchestrate Agent builder.

Before you begin

Before you start to follow this tutorial, you must set up your IBM watsonx Orchestrate ADK environment, where you build agents and tools. It also provides a convenient interface for managing credentials, sending requests, and handling responses from the service’s APIs. See the Installing the watsonx Orchestrate ADK and Installing the watsonx Orchestrate Developer Edition.

Developing the ‘Hello world’ agent

The following steps guide you to make you agent available on Agent builder.

  1. In your directory, create a folder with the name hello-world.

  2. Open a text editor, such as Visual Studio Code.

  3. To create the agent, copy the following code:

    [YAML]
    spec_version: v1
    kind: native
    name: greeter
    description: An agent that greets you using the output from its tool
    instructions: Always run the tool "Greeting" when the user types Greeting in the chat. 
    llm: watsonx/meta-llama/llama-3-2-90b-vision-instruct
    style: default
    collaborators: []
    tools: 
    - greeting
    
  4. Paste the code in the text editor and save the file as greeter.yaml in the *hello-world folder.

  5. To create the tool, copy the following code:

    [Python]
    #greetings.py
    from ibm_watsonx_orchestrate.agent_builder.tools import tool
    
    
    @tool
    def greeting() -> str:
        """
        Greeting for everyone   
        """
    
        greeting = "Hello World"
        return greeting
    
  6. Paste the code in the text editor and save the file as greetings.py in the *hello-world folder.

  7. Open the terminal that you commonly use.

  8. Navigate to the folder. For instance, cd ~/Desktop/hello-world.

  9. Run the command orchestrate tools import -k python -f tools/greetings.py.

  10. Run the command orchestrate agents import -f greeter.yaml.

  11. Run the command orchestrate chat start.

Testing your agent

After the configuration, you can enter “Greeting” into the chat window and continue interacting with your agent.