Stage WXO-1 · Build · 5 min
Bob Builds Agents
From natural language to production-ready agents
Demo Scene · Architecture Walkthrough
TALKING POINT · #1
What you're about to see is IBM Bob working together with watsonx Orchestrate to take you from zero to a fully operational, production-ready agent system — end to end.
The use case we're building is Intelligent Loan Processing. Think about what it takes to evaluate a loan application today — document verification, credit risk analysis, fraud detection, business viability assessment, regulatory compliance. Each of these demands specialized expertise, and they all need to work together seamlessly.
We're going to build a system of six coordinated agents, each bringing its own specialized tools and domain knowledge to deliver a thorough, consistent loan decision. Let's start by walking through the architecture.
Prompt to Bob:
Draw a Mermaid architecture diagram for the Loan Processing system. Include all agents, their specialized tools, and how they coordinate based on @/wxo_spec.md in agent_architecture.md. Make the decision logic and relationships between agents visually clear and easy to understand.
TALKING POINT · #2 · Before generating
I'll ask Bob to generate an architecture diagram using Mermaid based on our specification — which is a very detailed document that defines every agent, every tool, their parameters, return formats, decision logic, and how they all coordinate together. Let's see what Bob comes up with.
Why this matters: Starting with an architecture diagram gives the audience a visual mental model before any code is written. It also demonstrates that Bob understands the system holistically — not just individual components.
TALKING POINT · #3 · Walking through the diagram
At the top, we have the Loan Application Input — this is where everything begins. An application comes in and gets handed to the Loan Processing Orchestrator.
The orchestrator is the brain of the system. Its main job is coordination — it sends the application through three specialist agents, each running sequentially with early rejection. If a stage fails, subsequent stages are skipped entirely.
Stage 1: Document & Credit — the document_credit_agent verifies all submitted documents, extracts financial data, pulls the credit report, calculates DTI/DSCR ratios, and assigns a credit risk score. If document score < 50 or credit score < 50, the orchestrator rejects immediately — no need to continue.
Stage 2: Risk & Fraud — if Stage 1 passes, the risk_fraud_agent takes over. It screens for fraud, checks identity against watchlists (OFAC, FBI, FinCEN), validates KYC/AML and regulatory compliance, and checks lending limits. If fraud score < 80 or compliance violations are found, the orchestrator rejects — Stage 3 is skipped.
Stage 3: Business Viability — the business_viability_agent evaluates the business plan, analyzes market conditions and industry trends, and assesses financial projection realism against benchmarks. If viability score < 50, the application is rejected.
Three possible outcomes: Reject if any early rejection is triggered or overall score < 60. Manual Review if overall score is 60–74 or there are conflicting signals. Approve if overall score ≥ 75, all stages passed, and no critical issues.
The orchestrator calculates a weighted overall score (Document & Credit 40%, Risk & Fraud 25%, Business Viability 35%) and delivers a Final Loan Decision — complete with risk rating, recommended terms, conditions, and a full rationale report.
Four agents, eleven tools, one cohesive decision — and Bob built all of it from the spec.
Presenter Note: Search "Mermaid" in VS Code extensions and install the first result. The chart will render in Markdown preview mode.
Demo Scene · Specification-Driven Build
TALKING POINT · #2
The Power of Specification-Driven Agent Generation:
We provide Bob with a comprehensive specification that defines:
• The complete system architecture (3 specialist agents + orchestrator, sequential workflow with early rejection)
• Each agent's instructions, capabilities, and decision-making logic
• All 11 specialized tools with parameters, return formats, and realistic behaviors
• Early rejection rules and decision thresholds per stage
• Agent weight distribution, decision matrices, and approval criteria
• Sample loan scenarios and expected outcomes
Bob analyzes this specification and generates:
✓ Production-ready YAML configurations for all 4 agents (3 specialist + orchestrator)
✓ Complete Python implementations of all 11 tools with realistic logic
✓ Sequential orchestration with early rejection patterns
✓ Sample data and test scenarios
✓ Documentation and deployment instructions
What would traditionally take weeks of development — multiple agents, complex tool implementations, inter-agent communication patterns — Bob generates in ~10 minutes with full consistency and best practices.
Demo Flow: Building the Loan Processing System
-
1Provide System SpecificationSubmit comprehensive specification for Sequential Loan Processing System with 3 specialist agents (Document & Credit, Risk & Fraud, Business Viability) + Orchestrator, using 11 tools total with early rejection logicHow to Use This Specification:
- Create a
spec.mdfile in your Bob project - Paste the specification (copied above) into the file
- In Code mode, prompt Bob: "implement this multi-agent system based on this specs"
📋 Sequential Loan Processing System Specification# Intelligent Loan Processing Multi-Agent System — Spec for Agent Generation ## Objective Build a multi-agent loan processing prototype on Watsonx Orchestrate. The system uses **3 specialist agents + 1 orchestrator**, processing applications **sequentially** with **early rejection** when a stage fails. --- ## Architecture ``` loan_processing_orchestrator (Sequential, early-exit) │ │ Stage 1 ├── document_credit_agent │ │ Stage 2 (skipped if Stage 1 rejects) ├── risk_fraud_agent │ │ Stage 3 (skipped if Stage 1 or 2 rejects) └── business_viability_agent ``` ### Early Rejection Rules - **Stage 1**: Reject if document score < 50 OR credit score < 50 → skip Stages 2 & 3 - **Stage 2**: Reject if fraud score < 80 OR compliance violations → skip Stage 3 - **Stage 3**: Reject if viability score < 50 --- ## Project Structure ``` loan-agent/ ├── agents/ │ ├── loan_processing_orchestrator.yaml │ ├── document_credit_agent.yaml │ ├── risk_fraud_agent.yaml │ └── business_viability_agent.yaml ├── tools/ │ ├── document_credit_tools.py │ ├── risk_fraud_tools.py │ └── business_tools.py ├── .env.sample ├── README.md └── requirements.txt ``` --- ## Agents ### 1. Document & Credit Agent (`document_credit_agent`) Combines document verification and credit analysis into a single stage. **Responsibilities**: - Validate completeness and authenticity of submitted documents (tax returns, bank statements, business licenses, IDs) - Extract financial data and verify business registration - Analyze credit reports, calculate DTI/DSCR ratios, and assign a credit risk score **Tools** (3): | Tool | Purpose | Key Parameters | |------|---------|---------------| | `verify_and_extract_documents` | Verify all submitted documents, check completeness, extract financial data, and validate business registration | `application_id` | | `analyze_credit_profile` | Pull credit report, calculate DTI and DSCR ratios | `application_id` | | `assess_credit_risk` | Comprehensive credit risk assessment combining all credit factors into a single score | `application_id` | All tools return JSON with relevant scores, statuses, and findings. Embed realistic hardcoded sample data inside each tool (no separate data modules). Use the same `application_id` across all tools for consistency. --- ### 2. Risk & Fraud Agent (`risk_fraud_agent`) Combines fraud detection and regulatory compliance into a single stage. **Responsibilities**: - Verify identity, detect synthetic identities, and check fraud databases/watchlists - Analyze application patterns for suspicious behavior - Validate KYC/AML, regulatory compliance, and lending limits **Tools** (3): | Tool | Purpose | Key Parameters | |------|---------|---------------| | `screen_fraud_risk` | Verify identity, check fraud databases (OFAC, FBI, FinCEN), detect synthetic identity, and analyze application patterns | `application_id` | | `check_compliance` | Validate KYC/AML requirements, check federal/state regulatory compliance (TILA, ECOA, FCRA, GLB, usury laws) | `application_id` | | `validate_lending_limits` | Validate loan amount against policy limits, authority levels, concentration limits, and LTV | `application_id`, `loan_amount` | --- ### 3. Business Viability Agent (`business_viability_agent`) Evaluates business fundamentals, market conditions, and management capability. **Responsibilities**: - Evaluate business plan feasibility and management team - Analyze industry trends and market conditions - Assess financial projection realism against benchmarks **Tools** (3): | Tool | Purpose | Key Parameters | |------|---------|---------------| | `evaluate_business_plan` | Evaluate business plan completeness, feasibility, and management team experience | `application_id` | | `analyze_market_conditions` | Analyze industry trends, competitive landscape, market size, and growth outlook | `industry`, `market_segment` | | `assess_financial_projections` | Validate revenue/margin projections against industry benchmarks and historical performance | `application_id` | --- ### 4. Loan Processing Orchestrator (`loan_processing_orchestrator`) Coordinates the 3 agents sequentially with early rejection. **Collaborators**: `document_credit_agent`, `risk_fraud_agent`, `business_viability_agent` **Workflow**: 1. Run Stage 1 → check pass/fail → reject early if needed 2. Run Stage 2 → check pass/fail → reject early if needed 3. Run Stage 3 → check pass/fail 4. Calculate overall score, generate decision (APPROVE / MANUAL_REVIEW / REJECT) **Tools** (2): | Tool | Purpose | Key Parameters | |------|---------|---------------| | `calculate_overall_score` | Calculate weighted overall score from all agent scores | `agent_scores`, `weights` (optional) | | `generate_loan_decision` | Generate final decision and comprehensive assessment report | `application_id`, `agent_results` | --- ## Decision Matrix | Decision | Criteria | |----------|----------| | **APPROVE** | Overall score >= 75, all stages passed, no critical issues | | **MANUAL REVIEW** | Overall score 60-74, or conflicting signals | | **REJECT** | Any early rejection triggered, or overall score < 60 | --- ## Agent Weight Distribution | Agent | Default Weight | |-------|---------------| | Document & Credit | 40% | | Risk & Fraud | 25% | | Business Viability | 35% | --- ## Tool Implementation Guidelines - Use `@tool()` decorator from `ibm_watsonx_orchestrate.agent_builder.tools` - All tools return `str` (JSON-serialized) - Embed hardcoded realistic sample data inside each tool — no separate data files - Use consistent `application_id` = `"LA-2026-0429"` across all tools - Include type hints and docstrings - Use ISO 8601 for timestamps --- ## Sample Test Prompts - "Process loan application LA-2026-0429" - "Should we approve this $250K business expansion loan?" - "Check the documents and credit for this applicant" - "Run fraud screening and compliance checks" - "Evaluate the business plan and market conditions" - "This applicant has a 480 credit score — process the loan" (expects early rejection at Stage 1) --- - Create a
-
2Bob Generates Agent Architecture and Tool ImplementationsBob creates complete multi-agent system: 4 YAML agent definitions (3 specialist + orchestrator) with sequential early-rejection workflow, plus 11 specialized tools with realistic loan processing logic covering document & credit analysis, risk & fraud screening, and business viability assessment
What Bob Generates
4 Agents
3 + Orchestrator YAML Configs
11 Tools
Python Implementation
Sequential
Orchestration Pattern
Decision Logic
Approve/Review/Reject
Sample Data
Realistic Scenarios
~10 mins
Generation Time