Switching to agentic or agentic assistant mode

After you successfully upgrade watsonx Orchestrate from previous version to Version 5.3.x, you can run the scripts to switch from agentic skill assistant mode to agentic or agentic assistant mode.

Prerequisites

  • You must have access to the Red Hat® OpenShift® cluster with appropriate permissions.
  • You must have admin access to the watsonx Orchestrate namespace.
  • Ensure that the upgrade process is successful.
Note: If you switch from agentic skills assistant mode to agentic or agentic assistant mode, your existing models will be removed from watsonx Orchestrate CR. Refer to Configuring IFM models after install or upgrade or Registering external models through AI gateway to re-enable the models.

Switching to agentic mode

If your watsonx Orchestrate installation previously included skills and assistants and you no longer want to use these features, you must patch the watsonx Orchestrate custom resource (wo wo) to remove the features.

To remove skills and assistants, patch the watsonx Orchestrate custom resource.
cat > switch_to_agentic_mode.sh <<'EOF'
#!/bin/bash
# -----------------------------------------------------------------------------
# Watsonx Orchestrate UAB disable + Agentic enable script
# - Patches WO CR to disable UAB and enable wxolite (with IFM enabled)
# - Waits until watsonxOrchestrateStatus becomes "Completed"
# -----------------------------------------------------------------------------
set -euo pipefail

# -----------------------------
# Required namespace variable
# -----------------------------
: "${PROJECT_CPD_INST_OPERANDS:?Set PROJECT_CPD_INST_OPERANDS before running this script}"

# -----------------------------
# Patch WO CR
# -----------------------------
echo "[INFO] Patching Watsonx Orchestrate CR in namespace ${PROJECT_CPD_INST_OPERANDS}..."
oc patch watsonxorchestrate wo \
  --namespace="${PROJECT_CPD_INST_OPERANDS}" \
  --type=merge \
  --patch='{
    "spec": {
      "wxolite": {
        "enabled": true,
        "enable_ifm": true
      },
      "uab": {
        "enabled": false
      }
    }
  }'

echo "[INFO] Watsonx Orchestrate CR patch completed successfully."

# -----------------------------
# Wait for watsonxOrchestrateStatus=Completed
# -----------------------------
echo "[INFO] Waiting for watsonxOrchestrateStatus to become 'Completed'..."
TIMEOUT=7200   # 2 hours (in seconds)
INTERVAL=30    # check every 30 seconds
ELAPSED=0

while true; do
  STATUS=$(oc get wo -n "${PROJECT_CPD_INST_OPERANDS}" -o jsonpath='{.items[0].status.watsonxOrchestrateStatus}' 2>/dev/null || echo "Unknown")
  if [[ "${STATUS}" == "Completed" ]]; then
    echo "[INFO] watsonxOrchestrateStatus is Completed."
    break
  fi
  if (( ELAPSED >= TIMEOUT )); then
    echo "[ERROR] Timeout reached (${TIMEOUT}s). watsonxOrchestrateStatus did not reach 'Completed'."
    exit 1
  fi
  echo "[INFO] Current status: ${STATUS} (elapsed: ${ELAPSED}s)"
  sleep "${INTERVAL}"
  (( ELAPSED += INTERVAL ))
done

echo "[INFO] Script execution completed successfully."
EOF

chmod 775 switch_to_agentic_mode.sh && sh switch_to_agentic_mode.sh

Switching to agentic assistant mode

If your watsonx Orchestrate installation previously included skills and assistants and you no longer want to use the skill features, you must patch the watsonx Orchestrate custom resource (wo wo) to remove the features.
Note: After switching to agentic assistant mode, you must complete the steps that are mentioned in Post-switching steps for agentic assistant mode for database cleanup.
To remove the skills, patch the watsonx Orchestrate custom resource:
cat > switch_to_agenticassistant_mode.sh <<'EOF'
#!/bin/bash
# -----------------------------------------------------------------------------
# Watsonx Orchestrate switch to Agentic Assist mode script
# - Enables Agentic with IFM and Assistant
# - Disables UAB
# - Waits until watsonxOrchestrateStatus becomes "Completed"
# -----------------------------------------------------------------------------
set -euo pipefail

# -----------------------------
# Required namespace variable
# -----------------------------
: "${PROJECT_CPD_INST_OPERANDS:?Set PROJECT_CPD_INST_OPERANDS before running this script}"

# -----------------------------
# Patch WO CR
# -----------------------------
echo "[INFO] Patching Watsonx Orchestrate CR in namespace ${PROJECT_CPD_INST_OPERANDS}..."
oc patch watsonxorchestrate wo \
  -n "${PROJECT_CPD_INST_OPERANDS}" \
  --type=merge \
  -p '{
    "spec": {
      "wxolite": {
        "enabled": true,
        "enable_ifm": true,
        "assistant": {
          "enabled": true
        }
      },
      "uab": {
        "enabled": false
      },
      "watsonAssistants": {
        "internalDeploy": true
      }
    }
  }'

echo "[INFO] Watsonx Orchestrate CR patch completed successfully."

# -----------------------------
# Wait for watsonxOrchestrateStatus=Completed
# -----------------------------
echo "[INFO] Waiting for watsonxOrchestrateStatus to become 'Completed'..."
TIMEOUT=7200   # 2 hours (in seconds)
INTERVAL=30    # check every 30 seconds
ELAPSED=0

while true; do
  STATUS=$(oc get wo -n "${PROJECT_CPD_INST_OPERANDS}" -o jsonpath='{.items[0].status.watsonxOrchestrateStatus}' 2>/dev/null || echo "Unknown")
  if [[ "${STATUS}" == "Completed" ]]; then
    echo "[INFO] watsonxOrchestrateStatus is Completed."
    break
  fi
  if (( ELAPSED >= TIMEOUT )); then
    echo "[ERROR] Timeout reached (${TIMEOUT}s). watsonxOrchestrateStatus did not reach 'Completed'."
    exit 1
  fi
  echo "[INFO] Current status: ${STATUS} (elapsed: ${ELAPSED}s)"
  sleep "${INTERVAL}"
  (( ELAPSED += INTERVAL ))
done

echo "[INFO] Script execution completed successfully."
EOF

chmod 775 switch_to_agenticassistant_mode.sh && sh switch_to_agenticassistant_mode.sh

Post-switching steps for agentic assistant mode

After switching from agentic skills assistant mode to agentic assistant mode, you must clean the database to prevent errors when creating assistants.

Before making changes, it is highly recommended to backup the affected tables. Create a folder in your working directory for storing the backup files. Perform the following steps to complete the database cleanup.
  1. To backup the affected tables:
    # Connect to postgres pod
    POD_NAME=$(oc get pods -l app=wo-wa-postgres-16 -o jsonpath='{.items[0].metadata.name}')
    
    DATABASE_NAME="conversation_pprd_wo-wa"
    
    # Create backups
    oc exec $POD_NAME -- pg_dump -U postgres -d $DATABASE_NAME -t integration > /<your-backup-folder>/integration_backup.sql
    oc exec $POD_NAME -- pg_dump -U postgres -d $DATABASE_NAME -t catalog_integration > /<your-backup-folder>/catalog_integration_backup.sql
    oc exec $POD_NAME -- pg_dump -U postgres -d $DATABASE_NAME -t conversational_skill_provider > /<your-backup-folder>/conversational_skill_provider_backup.sql
  2. To verify whether the backup was created:
    ls -lh /tmp/*backup.sql
  3. Important: Run the following commands in the exact sequence provided to maintain referential integrity.
    1. To delete the Integration records:
      POD_NAME=$(oc get pods -l app=wo-wa-postgres-16 -o jsonpath='{.items[0].metadata.name}')
      DATABASE_NAME="conversation_pprd_wo-wa"
      
      oc exec $POD_NAME -- psql -U postgres -d $DATABASE_NAME -c "
      DELETE FROM integration
      WHERE name = 'Conversational Skill Provider Integration';
      "
    2. To delete the Catalog Integration records:
      oc exec $POD_NAME -- psql -U postgres -d $DATABASE_NAME -c "
      DELETE FROM catalog_integration
      WHERE title = 'Conversational Skill Provider';
      "
    3. To delete the Conversational Skill Provider records:
      oc exec $POD_NAME -- psql -U postgres -d $DATABASE_NAME -c "
      DELETE FROM conversational_skill_provider;
      "
  4. To confirm if Conversational Skill Provider records are deleted:
    POD_NAME=$(oc get pods -l app=wo-wa-postgres-16 -o jsonpath='{.items[0].metadata.name}')
    DATABASE_NAME="conversation_pprd_wo-wa"
    
    # Check conversational_skill_provider
    oc exec $POD_NAME -- psql -U postgres -d $DATABASE_NAME -c "
    SELECT COUNT(*) as provider_count FROM conversational_skill_provider;
    "
    Expected output:
    provider_count = 0
  5. To confirm if Catalog Integration records are deleted:
    # Check catalog_integration
    oc exec $POD_NAME -- psql -U postgres -d $DATABASE_NAME -c "
    SELECT COUNT(*) as catalog_count FROM catalog_integration WHERE title = 'Conversational Skill Provider';
    "
    Expected output:
    catalog_count = 0
  6. To confirm if Integration records are deleted:
    # Check integration
    oc exec $POD_NAME -- psql -U postgres -d $DATABASE_NAME -c "
    SELECT COUNT(*) as integration_count FROM integration WHERE name = 'Conversational Skill Provider Integration';
    "
    Expected output:
    integration_count = 0