generalbots/bottemplates/multiagent/customer-support-workflow.gbai/customer-support-workflow.bas
Rodrigo Rodriguez (Pragmatismo) 037db5c381 feat: Major workspace reorganization and documentation update
- Add comprehensive documentation in botbook/ with 12 chapters
- Add botapp/ Tauri desktop application
- Add botdevice/ IoT device support
- Add botlib/ shared library crate
- Add botmodels/ Python ML models service
- Add botplugin/ browser extension
- Add botserver/ reorganized server code
- Add bottemplates/ bot templates
- Add bottest/ integration tests
- Add botui/ web UI server
- Add CI/CD workflows in .forgejo/workflows/
- Add AGENTS.md and PROD.md documentation
- Add dependency management scripts (DEPENDENCIES.sh/ps1)
- Remove legacy src/ structure and migrations
- Clean up temporary and backup files
2026-04-19 08:14:25 -03:00

54 lines
1.6 KiB
QBasic

' Example: Customer Support Workflow with Enhanced Orchestration
' This demonstrates the new ORCHESTRATE WORKFLOW, event system, and bot memory sharing
USE KB "support-policies"
USE TOOL "check-order"
USE TOOL "process-refund"
' Set up event handlers
ON EVENT "approval_received" DO
TALK "Manager approval received, processing refund..."
END ON
ON EVENT "timeout_occurred" DO
TALK "Approval timeout, escalating to director..."
END ON
' Main workflow orchestration
ORCHESTRATE WORKFLOW "customer-complaint-resolution"
STEP 1: BOT "classifier" "analyze complaint"
' Classifier bot analyzes the complaint and sets variables
STEP 2: BOT "order-checker" "validate order details"
' Order checker validates the order and warranty status
' Conditional logic based on order value
IF order_amount > 100 THEN
STEP 3: HUMAN APPROVAL FROM "manager@company.com"
TIMEOUT 1800 ' 30 minutes
ON TIMEOUT: ESCALATE TO "director@company.com"
' Wait for approval event
WAIT FOR EVENT "approval_received" TIMEOUT 3600
END IF
STEP 4: PARALLEL
BRANCH A: BOT "refund-processor" "process refund"
BRANCH B: BOT "inventory-updater" "update stock levels"
END PARALLEL
STEP 5: BOT "follow-up" "schedule customer check-in"
DELAY 86400 ' 24 hours later
' Share successful resolution patterns with other support bots
BOT SHARE MEMORY "successful_resolution_method" WITH "support-bot-2"
BOT SHARE MEMORY "customer_satisfaction_score" WITH "support-bot-3"
' Sync knowledge from master support bot
BOT SYNC MEMORY FROM "master-support-bot"
' Publish completion event for analytics
PUBLISH EVENT "workflow_completed"
TALK "Customer complaint resolved successfully!"