watsonx-developer-hub icon indicating copy to clipboard operation
watsonx-developer-hub copied to clipboard

How to work and test the agent first locally with the CLI before the agent will be deployed to watsonx.ai?

Open thomassuedbroecker opened this issue 4 months ago • 5 comments

Question: Local development and test not supported with the CLI?

This is possible with the "old" example applications, but not with the CLI.

1. Expected flow

  1. Generate agent and tools with a template
  2. Change agent implementation and tools locally
  3. Test tools isolated
  4. Test new agent and tools locally
  5. Deploy agent and tools as the ai-service to watsonx.ai

2. Current situation

Currently, I don't see any chance to work with my agent locally, when I going to use the CLI.

watsonx-ai --help
                                                                                                          
 Usage: watsonx-ai [OPTIONS] COMMAND [ARGS]...                                                            
                                                                                                          
 Entry point for the CLI.                                                                                 
                                                                                                          
 Args:     version (bool): If set to True, prints the CLI version and exits.                              
                                                                                                          
╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────╮
│ --version  -v        Print the current CLI version.                                                    │
│ --help               Show this message and exit.                                                       │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────────────────────────────────────────╮
│ template   Explore, download and try-out the template.                                                 │
│ service    Work with deployed templates.                                                               │
│ app        Build & run an UI playground.                                                               │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯

@royderks

thomassuedbroecker avatar Aug 18 '25 15:08 thomassuedbroecker

Hi @thomassuedbroecker!
To execute the template locally you have to run the below command:

$ watsonx-ai template invoke "Hello!”


This is also described in the help section, which you can view by running:

$ watsonx-ai template --help

Image


For more information about the CLI, you can check the documentation on PyPI: IBM watsonx.ai CLI for Agents

KajetanOzog avatar Aug 20 '25 07:08 KajetanOzog

@KajetanOzog This doesn't work for me!

thomassuedbroecker avatar Sep 29 '25 14:09 thomassuedbroecker

This doesn't work for me!

Could you please provide more information ?. What's the error you are experiencing ? How to recreate the issue ?.

LukaszCmielowski avatar Oct 02 '25 11:10 LukaszCmielowski

Hi @LukaszCmielowski, from my perspective it is simple to reproduce:

Use a clean machine with no configuration for watsonx.ai and the Secret Manager.

Follow for example the steps in the related GitHub to set up the local configuration: https://github.com/IBM/watsonx-developer-hub/tree/main/agents/community/langgraph-graph-rag

You will notice that there is no information on how to use and set up the Secret Manager on IBM Cloud for local execution. (BTW, there is no Public Endpoint OOTB for the Secret Manager, as far as I have discovered.) So a local execution for the CLI will never work.

CC: @KajetanOzog @Mateusz-Switala

thomassuedbroecker avatar Oct 06 '25 12:10 thomassuedbroecker

@thomassuedbroecker We've recently added information to Graph RAG Readme on how to set up IBM Cloud Secret Manager and store secrets - https://github.com/IBM/watsonx-developer-hub/tree/main/agents/community/langgraph-graph-rag#-modifying-and-configuring-the-template In addition, if you set env variable NEO4J_CONN_ARGS_FROM_ENV to "True", the neo4j connection arguments will be retrieved from the environment.

Mateusz-Switala avatar Oct 06 '25 12:10 Mateusz-Switala