Skip to Content

Complete Worked Example: Customer Support Workflow

Build a customer support agent from scratch, query it, and combine it with a triage agent into a team. Every YAML block here is validated against the Ark CRD schemas in CI.

Prerequisites

  • Ark installed (see the Quickstart)
  • kubectl pointing at the cluster
  • A model named default — ark models create default if missing
  • jq for the pretty-print steps
kubectl get pods -n ark-system kubectl get models

Step 1: Working Directory

mkdir -p customer-support-bot/{agents,queries,teams} cd customer-support-bot

Step 2: Support Agent

cat > agents/support-agent.yaml <<'EOF' apiVersion: ark.mckinsey.com/v1alpha1 kind: Agent metadata: name: support-agent spec: description: Handles customer support inquiries modelRef: name: default prompt: | You are a helpful customer support agent for a SaaS platform. Answer politely, professionally, and concisely. Common topics: - Password resets - Account access - Billing questions - Feature inquiries EOF

Step 3: Deploy

kubectl apply -f agents/support-agent.yaml kubectl get agent support-agent

Expect support-agent ready.

Step 4: Test Query

cat > queries/test-password-reset.yaml <<'EOF' apiVersion: ark.mckinsey.com/v1alpha1 kind: Query metadata: name: test-password-reset spec: input: "How do I reset my password?" target: type: agent name: support-agent EOF kubectl apply -f queries/test-password-reset.yaml

Step 5: Watch It Run

kubectl get query test-password-reset -w

Phase progression (lowercase per the CRD): pending → running → done. Ctrl+C to stop.

Step 6: View the Response

kubectl get query test-password-reset \ -o jsonpath='{.status.response.content}'

Example:

To reset your password: 1. Go to the login page 2. Click "Forgot Password" 3. Enter your registered email 4. Open the reset link from the email 5. Set a new password No email after 5 minutes? Check your spam folder.

Step 7: Full Details

kubectl describe query test-password-reset

Shows phase, the response, token usage, and start/end times.

Step 8: Dashboard

ark dashboard

Opens the dashboard in your browser. Navigate to Queries, open test-password-reset, and inspect input, response, timeline, tokens, and model.

Step 9: Another Scenario

cat > queries/test-billing.yaml <<'EOF' apiVersion: ark.mckinsey.com/v1alpha1 kind: Query metadata: name: test-billing spec: input: "How can I upgrade my subscription plan?" target: type: agent name: support-agent EOF kubectl apply -f queries/test-billing.yaml kubectl get query test-billing \ -o jsonpath='{.status.response.content}'

Step 10: Triage Agent

A second agent that classifies the request before support answers.

cat > agents/triage-agent.yaml <<'EOF' apiVersion: ark.mckinsey.com/v1alpha1 kind: Agent metadata: name: triage-agent spec: description: Categorizes and routes customer inquiries modelRef: name: default prompt: | Categorize the inquiry into one of: - technical: Password resets, login issues, bugs - billing: Subscription, payment, invoices - sales: Upgrades, new features, pricing Respond with just the category name. EOF kubectl apply -f agents/triage-agent.yaml

Step 11: Team

Triage first, then support — sequential strategy.

cat > teams/support-team.yaml <<'EOF' apiVersion: ark.mckinsey.com/v1alpha1 kind: Team metadata: name: support-team spec: description: Triage then answer strategy: sequential members: - type: agent name: triage-agent - type: agent name: support-agent EOF kubectl apply -f teams/support-team.yaml cat > queries/team-test.yaml <<'EOF' apiVersion: ark.mckinsey.com/v1alpha1 kind: Query metadata: name: team-test spec: input: "I want to upgrade my plan and my payment failed" target: type: team name: support-team EOF kubectl apply -f queries/team-test.yaml kubectl get query team-test -o jsonpath='{.status.response}' | jq

Next Steps

Last updated on