7) Inter-Agent Dependencies (Multi-Repository)
Overview
When agents are managed in separate Git repositories and have dependencies on each other, such as AgentA depending on AgentB, you need a strategy to coordinate deployments across repositories.Core Principle: CI/CD Pipeline as the Only Authorized Deployment Path
The general approach is to use the CI/CD pipeline as the only authorized path to deploy agents to production environments. Customers should not deploy agents manually by hand or with ad hoc scripts. This ensures:- Consistency: all deployments follow the same process
- Auditability: every deployment is tracked in CI/CD logs
- Governance: approval gates and quality checks are enforced
- Traceability: deployments are linked to Git commits and pull requests
Key Challenges
- Version synchronization: dependent agents must reference compatible versions
- Deployment order: dependencies must be deployed before dependents
- Cross-tenant coordination: agents must exist in the same tenant and environment
- Testing: integration tests require all dependent agents to be available
- Single active version: only one version of an agent or tool is active in a given environment
Illustrative Solution: File-Based Agent Registry
Given that only one version of an agent or tool is active in a given environment, a simple file-based agent registry can be used to maintain dependencies and validate deployments.Example Registry Structure
How This Illustrative Approach Works
- The pipeline reads
agent-registry.yaml - It builds a dependency graph such as
document_processor→employee_onboarding - It deploys in order: first
document_processor, thenemployee_onboarding - It validates version requirements before each deployment
- It updates the registry with new versions and timestamps
Why This Simple Approach Can Work
Single Active Version
One active version per environment simplifies tracking
No Extra Infrastructure
No server infrastructure is required beyond a YAML file in Git
Version Controlled
Git tracks every registry change
Dependency Validation
Helps prevent incompatible deployments
Alternative Approaches
Option 1: More Sophisticated Solutions
Option 1: More Sophisticated Solutions
- Dedicated dependency management service
- Integration with enterprise service catalog
- Advanced version resolution algorithms
- Real-time dependency validation APIs
Option 2: Simpler Solutions
Option 2: Simpler Solutions
- Manual coordination via documentation
- Orchestrated multi-repository pipeline without a registry
- Git submodules for dependent agent definitions
Option 3: No Explicit Dependency Management
Option 3: No Explicit Dependency Management
- Appropriate when agents are loosely coupled and failures are acceptable
- Rely on runtime error handling and monitoring
8) Testing and Quality Gates
- Unit tests: knowledge bases, tools, and flows
- Static validation: JSON Schema for
agent.yamland*-releases.yaml - Contract tests: tool I/O and validation that agents reference valid tool versions
- Prompt regression: low-temperature runs to validate tool selection and output format
- Security: SAST and dependency scans
- Policy: OPA or Conftest rules, for example forbidding
latest, enforcing approved model IDs, and applying temperature caps in production
8) Git-Based Promotion and Rollback
Promotion Workflow via Branch Merging
Promotions follow a strict path: dev → qa → preprod → prod All promotions are performed through Git branch merges by using pull requests.Within-Tenant Promotions
- Dev to QA
- PreProd to Prod
Dev → QA within
dev-qa-tenantCross-Tenant Promotion
QA → PreProd crosses the tenant boundary fromdev-qa-tenant to prod-tenant.
Handling Merge Conflicts
Promotion Best Practices
- Always use pull requests: never push directly to environment branches
- Use merge commits: use
--no-ffto preserve promotion history - Enforce approval gates
dev → qa: automated after CI checks passqa → preprod: team lead approval for the cross-tenant boundarypreprod → prod: CAB approval and a change ticket
- Run smoke tests after each deployment before marking success
- Tag only after success: Git tags are created automatically by Jenkins after successful deployment
- Review diffs: use
git diff qa..preprodto inspect what will be promoted
Comparing Branches Before Promotion
Rollback Strategies
Knowledge-Base Promotion and Rollback
Knowledge bases require special handling during promotion and rollback. Promotion workflow:- Knowledge bases are not promoted from Draft to Live because that concept does not exist
- During cross-tenant promotion (
qa → staging), knowledge bases must be redeployed toprod-tenant - Git merges bring the knowledge-base YAML files forward, but CI/CD must still execute deployment
- Rolling back an agent does not automatically roll back its knowledge base
- Rolling back a knowledge base requires explicit redeployment of the previous version
Simple Rollback (Revert Merge)
Rollback to Specific Tag
Emergency Rollback (Cross-Tenant)
If Production (prod-tenant Live) has critical issues:
Rollback Considerations
- Git history: all rollbacks remain visible in Git history
- Backward compatibility: verify that old versions still work with current infrastructure
- Database migrations: might require manual intervention when schema changes exist
- Connection changes: verify that old versions still work with current connection settings
- Tenant isolation: a rollback in
prod-tenantdoes not affectdev-qa-tenant - Tag references: use tags to identify exact versions for rollback
Promotion Checklist
Before promoting qa → preprod
- All QA tests passed
- Security scan completed
- Performance benchmarks met
-
git diff qa..preprodreviewed - Merge conflicts resolved, especially configuration files
- Documentation updated
- Runbooks reviewed
- Rollback plan documented
- Change ticket approved
- Stakeholders notified
Before promoting preprod → prod
- PreProd validation completed
- No critical issues in PreProd
- Load testing completed
-
git diff preprod..prodreviewed - Disaster recovery tested
- On-call team briefed
- Maintenance window scheduled if needed
- CAB approval obtained
- Emergency rollback plan ready
Git Workflow Diagram
9) Security and Governance
- Secrets: use secret managers only; never commit secrets; rotate regularly
- RBAC: restrict Jenkins credentials and use scoped tokens for the wxO API
- Network: use allowlists for API endpoints
- Images: if using image mode, sign images and avoid
:latest - Reviews: use code owners for
agents/andenvs/prod/
11) wxO ADK CLI Deployment Commands
This section provides examples of using the watsonx Orchestrate ADK CLI to deploy agents, flows, and tools to different environments and tenants.Prerequisites
- Install wxO ADK:
pip install ibm-watsonx-orchestrate - Activate environment: point the CLI to the correct tenant
- Authenticate: ensure the proper credentials are configured
Environment Activation
Before deploying, activate the correct tenant environment:Deploying Tools
Tools must be deployed before agents that use them.- Python tool
- Flow
- OpenAPI tool
Deploying Knowledge Bases
Knowledge bases must be deployed before an agent can use them.- Built-in knowledge base
- External knowledge base
Agent Deployment Commands
Agents use two different commands depending on the target environment.
1. orchestrate agents import
- Used for Dev and PreProd Draft environments
- Imports the hand-written agent YAML into Draft
2. orchestrate agents deploy
- Used for QA and Prod Live environments
- Promotes an existing agent from Draft to Live within the same tenant
- See Deploying an agent
Deployment Flow
- Deploy flows first if the agent uses them
- For Dev and PreProd, use
importto deploy the agent to Draft- Tools are automatically deployed based on the agent’s
tools:section
- Tools are automatically deployed based on the agent’s
- Test the agent in Draft
- For QA and Prod, use
deployto promote from Draft to Live
Agent YAML Creation
- Agent YAML files are hand-written and stored in Git
- Do not use
orchestrate agents createto generate YAML - YAML files serve as the source of truth for agent configuration
- This supports version control and code review for agent definitions
Deployment Examples by Environment
- Dev
- QA
- PreProd
- Prod
Dev Deployment (
dev-qa-tenant, Draft)Complete Deployment Script Example
Usage
Key Differences by Tenant
| Aspect | dev-qa-tenant | prod-tenant |
|---|---|---|
| Activation | orchestrate env activate dev-qa-tenant | orchestrate env activate prod-tenant |
| Environments | Draft (Dev), Live (QA) | Draft (PreProd), Live (Prod) |
| Credentials | Dev/QA API keys | Prod API keys |
| Connections | connections/dev-qa-tenant/ | connections/prod-tenant/ |
| Approval | Automated | Requires CAB approval |
Additional CLI Commands
- List agents
- Export agent
- Delete agent
- List tools
- Export tool
11) Summary
Core Principles
- Apply GitOps principles by using Git branches for versioning instead of manual version directories
- Replace Argo CD with a Jenkins multi-branch pipeline as the orchestrator
- Use the wxO CLI to deploy agents, flows, tools, and knowledge bases through
orchestratecommands - Keep agent YAML files hand-written and stored in Git
- Treat knowledge bases as tenant-scoped and not environment-scoped
- Maintain secret-free Git through
connections.template.yamlplus secret substitution at deploy time - Achieve traceable promotions through Git merges, safe rollbacks through Git reverts, and consistent deployments across environments without direct cluster access
Git-Based Versioning
- Git branches represent environment state such as
dev,qa,preprod, andprod - Git tags mark deployments such as
v1.2.3-devandv1.2.3-qa - Git merges promote code between environments
- No manual version management is required because Git handles versioning
- Natural evolution is possible because agent structures can change between environments
Two-Tenant Architecture
- Tenant 1
- Tenant 2
dev-qa-tenant for non-production workloads- Draft → Dev (
develop) - Live → QA (
qa-<version>)
Key Benefits
Complete Isolation
Production infrastructure remains separated from development and testing
Security
Different credentials, RBAC, and network policies per tenant
Compliance
Separate audit trails for production and non-production
Risk Mitigation
Issues in Dev or QA cannot impact PreProd or Prod
Flexibility
Each tenant can have different configurations, quotas, and policies
Simplified Versioning
Git branches and tags replace manual version directories
Natural Evolution
Code structure can evolve through branches
Easy Comparison
git diff shows exactly what will be promotedPromotion Path
Critical Cross-Tenant Transition
Theqa-<version> → staging-<version> merge is the critical boundary where:
- The pipeline switches from
dev-qa-tenantauthentication toprod-tenant - API endpoints and credentials change
- Configuration files such as
tenant.yamlandvalues.yamlmay require conflict resolution - Additional approval gates apply
- Production-grade validation begins
Implementation Checklist
- Provision two wxO tenants:
dev-qa-tenantandprod-tenant - Set up Git repository with protected branches:
develop,qa-*,staging-*, andmain - Configure branch protection rules and approval requirements
- Set up tenant-specific secrets in the secret manager
- Configure Jenkins multi-branch pipeline
- Configure Jenkins with tenant-aware credentials
- Create tenant-specific connection templates
- Implement approval gates for cross-tenant promotions
- Set up Git tagging automation in Jenkins
- Set up monitoring and alerting per tenant
- Document merge conflict resolution strategy
- Document runbooks for each tenant
- Train the team on the versioned branch workflow
- Train the team on rollback procedures

