Prompt Details
Model
(claude-5-5-sonnet)
Token size
3,815
Example input
[DESCRIBE WHAT YOU WANT THE AI AGENT TEAM TO ACCOMPLISH]: Build an AI customer-support team that answers customer questions, checks order status, and escalates complex issues.
[LIST THE MAJOR TASKS, WORKFLOWS, OR ACTIVITIES THE TEAM MUST HANDLE]: Answer FAQs Check order status Handle refunds Escalate complex complaints
[DESCRIBE WHO WILL USE THE SYSTEM, WHO RECEIVES OUTPUTS, AND WHO OWNS IMPORTANT DECISIONS]: Customers Support manager Business owner
[DESCRIBE KNOWLEDGE SOURCES, MEMORY REQUIREMENTS, DATABASES, DOCUMENTS, RAG, OR STATE]: FAQ documents Product information Customer/order records Conversation history
[DEFINE WHAT A SUCCESSFUL RESULT LOOKS LIKE, INCLUDING QUALITY, SAFETY, ACCURACY, AND COMPLETION REQUIREMENTS]: Accurate answers No unauthorized refunds Correct order information Clear escalation No customer-data leakage
Example output
π PHASE 1 β OBJECTIVE RECONSTRUCTION
π― Primary Goal
Create a reliable customer-support workflow that can independently resolve routine questions while escalating cases requiring human judgment or authorization.
π₯ Users
Customers receive support.
Support managers handle escalations.
Business owners retain authority over sensitive financial decisions.
π₯ Inputs
Customer messages
Order IDs
FAQ/product information
Customer records
Previous conversation context
π€ Outputs
Customer answer
Order-status information
Refund request/action
Escalation ticket/email
β οΈ Failure Consequences
Incorrect customer information
Unauthorized refund
Privacy violation
Poor customer experience
π Explicit vs Inferred
Explicit requirements:
FAQ answering
Order lookup
Refund handling
Escalation
βΉ5,000 human-approval threshold
Inferred requirements:
Authentication should occur before exposing private order information.
Refund actions should be logged.
Escalations should contain enough context for a human to continue the case.
---
π PHASE 2 β TASK DECOMPOSITION
Task Capability Dependency Type Risk
FAQ answering Knowledge retrieval Knowledge base Independent Low
Order lookup Data retrieval Customer/order DB Conditional Medium
Refund evaluation Policy analysis Order + policy data Conditional High
Refund execution Tool execution Approved refund Sequential High
Escalation Case summarization Conversation context Conditional Medium
Final response Communication Previous task result Sequential Medium
π Workflow
Customer Message
β Intent Detection
β FAQ / Order / Refund / Escalation
β Verification
β Customer Response
For refunds above βΉ5,000:
Refund Request
β Policy Check
β Human Approval
β Refund Execution
β Customer Notification
---
π PHASE 3 β CAPABILITY MAP
π§ Required Capabilities
Intent classification
Knowledge retrieval
Customer/order lookup
Policy evaluation
Refund execution
Customer communication
Escalation
Validation
Agent Separation Analysis
Not every capability needs its own agent.
For example:
FAQ + intent detection can safely belong to one Support Agent.
Refund evaluation + refund execution should have stricter boundaries because financial actions require controlled authority.
Therefore, the architecture should avoid creating separate agents for every small function.
---
π PHASE 4 β SINGLE-AGENT VS MULTI-AGENT ANALYSIS
Option A β Single Agent π€
One agent handles everything.
Advantages:
Simple
Low coordination overhead
Low latency
Problems:
Same agent may answer customers and execute refunds.
Financial authority becomes harder to isolate.
Permission boundaries become less clear.
Option B β Coordinator + Specialists π₯
Coordinator
β Support Agent
β Order Agent
β Refund Agent
Advantages:
Clear ownership
Better permission isolation
Refund execution can be restricted
Disadvantages:
More coordination
More implementation complexity
Option C β Peer Specialists
Multiple independent agents communicate directly.
Problem:
Too much coordination for this workflow.
Option D β Hierarchical Team
Coordinator
βββ Support
βββ Order
βββ Refund
Works, but adds unnecessary hierarchy.
Option E β Hybrid Architecture β
Recommended:
Customer
β Support Coordinator
β Routine resolution OR specialist workflow
β Validation
β Customer
Refund > βΉ5,000
β Human approval
π Decision
A small hybrid team with 2 AI agents + human authorization is sufficient.
No dedicated reviewer agent is necessary because deterministic validation and permission controls can handle the main risks.
---
π PHASE 5 β AGENT ROLE DISCOVERY
π€ Candidate 1 β Support Agent
Purpose:
Handle customer conversations and routine support.
Responsibilities:
Understand customer intent
Retrieve FAQ information
Provide product information
Request required order information
Route specialized requests
Tools:
Knowledge base
Conversation history
Website chat
Authority:
Can communicate with customers.
Cannot issue refunds.
Cannot modify orders.
Why this agent needs to exist:
It owns customer-facing support and conversation management.
---
π¦ Candidate 2 β Order & Refund Agent
Purpose:
Handle authenticated order information and refund workflows.
Responsibilities:
Verify order information
Read order status
Evaluate refund eligibility
Create approved refund actions
Prepare escalation information
Tools:
Order database
Refund API
Policy database
Authority:
Read customer/order data after verification.
Can execute refunds only within authorized limits.
Cannot approve refunds above βΉ5,000.
Why this agent needs to exist:
Order and financial operations require specialized tools and stricter permissions than normal customer communication.
---
π§βπΌ Human Decision Owner
Purpose:
Authorize high-value refunds and exceptional cases.
Authority:
Approve/reject refunds above βΉ5,000.
Resolve policy exceptions.
Override automated decisions where business policy allows.
---
π PHASE 6 β TEAM OPTIMIZATION
π Merge Candidates
FAQ Agent + Conversation Agent
β Support Agent
Order Agent + Refund Agent
β Order & Refund Agent
β Remove Candidates
Dedicated Reviewer Agent
Reason: independent review does not provide enough additional value for this relatively simple workflow.
β Add Candidates
No additional AI agent is required.
π Final Team
1. π€ Support Agent
2. π¦ Order & Refund Agent
3. π§βπΌ Human Decision Owner
This keeps the system small while preserving financial authorization boundaries.
---
π PHASE 7 β RESPONSIBILITY MATRIX
Task Primary Owner Support Reviewer Decision Owner
FAQ response Support Agent Knowledge Base Validation Rules Support Agent
Order lookup Order & Refund Agent Support Agent Access Validation Order Agent
Refund β€ βΉ5,000 Order & Refund Agent Support Agent Policy Validation Order Agent
Refund > βΉ5,000 Order & Refund Agent Support Agent Policy Validation Human
Complex complaint Support Agent Order Agent Human Human
Customer notification Support Agent Order Agent Output Validation Support Agent
π Ownership Rule
Only one primary owner exists for each task.
---
π PHASE 8 β AUTHORITY & PERMISSION ARCHITECTURE
π€ Support Agent
Can Read:
FAQ
Product information
Conversation history
Can Write:
Support conversation
Escalation notes
Can Execute:
Knowledge searches
Customer communication
Can Approve:
Routine informational responses
Cannot Do:
Modify orders
Issue refunds
Access unnecessary financial data
---
π¦ Order & Refund Agent
Can Read:
Verified order records
Refund policies
Can Write:
Refund request records
Case status
Can Execute:
Order lookup
Authorized refund operations
Can Approve:
Refunds within its permitted threshold
Cannot Do:
Approve refunds above βΉ5,000
Change business refund policy
---
π§βπΌ Human
Can Approve:
High-value refunds
Policy exceptions
Sensitive escalations
---
π PHASE 9 β TOOL & RESOURCE ASSIGNMENT
Tool Owner Purpose Permission
Knowledge Base Support Agent FAQ retrieval Read
Website Chat Support Agent Customer communication Read/Write
Order DB Order Agent Order lookup Restricted Read
Refund API Order Agent Refund execution Restricted Execute
Email Support Agent Escalation Send
Approval Interface Human High-value approval Approve
π Security Principle
The Support Agent does not receive refund API access.
---
π PHASE 10 β MEMORY & KNOWLEDGE ARCHITECTURE
π Shared Knowledge
Product catalog
FAQ
Refund policy
Owner: Business knowledge system
π Private State
Support Agent:
Current conversation context
Order Agent:
Current order/refund transaction state
π§Ύ Task State
Each request receives:
task_id
Each handoff receives:
handoff_id
Example:
TASK-1024
β HANDOFF-1024-A
β HANDOFF-1024-B
π§ Long-Term Memory
Store only approved business knowledge and necessary case records.
Do not permanently store unnecessary customer information.
βοΈ Conflict Handling
If database information conflicts with conversation claims:
Database record + verification rules take precedence, and the case can be escalated when uncertainty remains.
---
π PHASE 11 β TEAM ORCHESTRATION
ποΈ Selected Topology
Hybrid
π€ Customer
β
βΌ
π€ Support Agent
β
βββββββββββΌββββββββββ
β β β
FAQ Order Refund
β β β
β βΌ βΌ
β π¦ Order & Refund Agent
β β
β ββββββββ΄βββββββ
β β β
β β€ βΉ5,000 > βΉ5,000
β β β
β βΌ βΌ
β Execute π§βπΌ Human
β β
ββββββββββββββββ¬ββββββββββββ
βΌ
π€ Support Agent
β
βΌ
π€ Customer
π Completion Condition
The workflow stops when:
Customer receives a valid answer, OR
Approved action is completed, OR
Case is successfully escalated to a human.
---
π PHASE 12 β COMMUNICATION & HANDOFF DESIGN
Handoff 1
Sender: Support Agent
Receiver: Order & Refund Agent
Trigger: Customer requests order/refund information.
Required Context:
task_id
authenticated customer identifier
order ID
requested operation
relevant conversation summary
Context Excluded:
Unnecessary personal conversation details
Unrelated customer information
Output Contract:
{
"task_id": "...",
"status": "success|needs_approval|escalate|failed",
"order_status": "...",
"refund_amount": 0,
"reason": "...",
"next_action": "..."
}
Validation
Customer authorization verified
Order ID valid
Requested operation permitted
---
π PHASE 13 β QUALITY CONTROL
β
Input Validation
Check:
Valid customer identity
Valid order ID
Required information present
β
Knowledge Validation
FAQ responses must be grounded in the approved knowledge base.
β
Financial Validation
Before refund:
Correct order
Correct amount
Refund eligibility
Authorization threshold
β
Final Response Validation
Before customer receives the response:
No unsupported claims
No private data leakage
Action status accurately represented
π§βπΌ Human Approval
Required for:
Refund > βΉ5,000
and policy exceptions.
---
π PHASE 14 β FAILURE & RECOVERY
Failure Detection Recovery
Order DB unavailable Tool error/timeout Retry once, then escalate
Invalid order ID Validation failure Ask customer to verify
Refund API failure API error Do not claim refund succeeded
Conflicting data Data mismatch Escalate
Agent timeout Workflow timeout Resume from task state
Duplicate refund Idempotency check Block duplicate execution
Human approval unavailable Approval timeout Keep request pending
Unauthorized access Permission failure Stop workflow
π Retry Rule
Retries are bounded.
Example:
Maximum 1 automatic retry
After failure:
Recover β Escalate β Stop
The system must never repeatedly execute a financial action.
---
π§ͺ PHASE 15 β TEAM TESTING
Test 1 β FAQ
Scenario:
Customer asks: "What is your return period?"
Expected Agent:
Support Agent
Expected Action:
Retrieve approved return policy.
Expected Output:
Accurate return-period answer.
Failure:
Agent invents a policy.
Verification:
Compare response against knowledge base.
---
Test 2 β Order Status
Scenario:
Customer provides a valid order ID.
Expected Agent:
Order & Refund Agent
Expected Action:
Verify identity β retrieve order.
Expected Output:
Correct order status.
Failure:
Incorrect or unauthorized order information.
---
Test 3 β Small Refund
Scenario:
Customer requests an eligible βΉ2,000 refund.
Expected Agent:
Order & Refund Agent
Expected Action:
Validate policy β execute refund.
Expected Output:
Successful refund transaction.
Failure:
Refund executed without validation.
---
Test 4 β High-Value Refund
Scenario:
Customer requests an eligible βΉ8,000 refund.
Expected Agent:
Order & Refund Agent β Human
Expected Action:
Prepare approval request.
Expected Output:
Human approval required.
Failure:
AI executes refund without approval.
---
Test 5 β Permission Boundary π
Scenario:
Support Agent attempts to call Refund API.
Expected Action:
Permission denied.
Expected Output:
Security event logged.
Failure:
Refund API executes.
---
Test 6 β Tool Failure
Scenario:
Order database becomes unavailable.
Expected Action:
Attempt
β
Retry once
β
Still unavailable
β
Escalate
Failure:
Agent fabricates order information.
---
Test 7 β Circular Delegation π
Scenario:
Support Agent β Order Agent
Order Agent β Support Agent
Support Agent β Order Agent
Expected Action:
Delegation depth limit stops the loop.
Failure:
Infinite delegation.
---
Test 8 β Data Leakage π
Scenario:
Customer A asks about Customer B's order.
Expected Action:
Reject unauthorized access.
Failure:
Customer B's information is disclosed.
---
π PHASE 16 β FINAL AI AGENT TEAM BLUEPRINT
1. π― Team Objective
Provide automated customer support while maintaining strict boundaries around order data, refunds, and human authorization.
2. ποΈ Recommended Architecture
Hybrid 2-agent architecture + human authorization
This is simpler than a large multi-agent system while still separating customer communication from sensitive transactional operations.
3. π€ Agent Roster
Agent Purpose Owns Does Not Own Tools
π€ Support Agent Customer support Conversation Refund execution Chat, KB, Email
π¦ Order & Refund Agent Transaction operations Orders/refunds High-value approval Order DB, Refund API
π§βπΌ Human Sensitive decisions High-value approval Routine automation Approval system
---
π 4. Authority Matrix
Action Support Order/Refund Human
Answer FAQ β
β Optional
Read verified order β β
β
Execute β€ βΉ5,000 refund β β
β
Approve > βΉ5,000 refund β β β
Change refund policy β β β
Escalate complaint β
β
β
---
π§ 5. Memory Architecture
Shared Knowledge
βββ FAQ
βββ Product Information
βββ Refund Policy
Task State
βββ task_id
βββ customer verification
βββ order ID
βββ current workflow state
Agent Context
βββ Support conversation
βββ Transaction state
---
π 6. Orchestration Graph
Customer
β
Support Agent
β
Intent Classification
β
βββββββββββββββββ¬ββββββββββββββββββ
β β β
FAQ Order Refund
β β β
β ββββββββ¬βββββββββββ
Customer β
Response Order/Refund Agent
β
ββββββββ΄βββββββ
β β
β€ βΉ5K > βΉ5K
β β
Execute Human
β β
ββββββββ¬βββββββ
β
Support Agent
β
Customer
---
π 7. Agent Prompt Responsibilities
π€ Support Agent
Role: Customer Support Specialist
Mission: Resolve routine customer questions and correctly route transactional requests.
Inputs:
Customer message
Conversation history
Approved knowledge
Outputs:
Customer response
Structured handoff request
Rules:
Never invent policy information.
Never expose unauthorized customer data.
Never execute refunds.
Escalate when authority is insufficient.
Completion:
Customer receives a valid response or a correctly structured escalation.
---
π¦ Order & Refund Agent
Role: Transaction Operations Specialist
Mission: Safely process verified order and refund workflows.
Inputs:
Verified customer information
Order ID
Requested operation
Policy information
Outputs:
Order result
Refund result
Approval request
Escalation
Rules:
Verify authorization before accessing private records.
Validate refund eligibility.
Never exceed refund authority.
Never report an unsuccessful action as successful.
Use idempotency protection for financial operations.
Completion:
Transaction completed, approval requested, or case escalated.
---
π§ͺ 8. Evaluation Metrics
Track:
FAQ accuracy
Order lookup accuracy
Refund-policy accuracy
Unauthorized-action rate
Refund execution accuracy
Escalation accuracy
Data leakage incidents
Tool failure recovery
Average response time
Workflow completion rate
Duplicate-action rate
Human approval compliance
---
π 9. Implementation Sequence
1. Build the knowledge base.
2. Define customer authentication.
3. Build Support Agent.
4. Build Order & Refund Agent.
5. Implement permission boundaries.
6. Implement refund threshold.
7. Add human approval workflow.
8. Add task/handoff IDs.
9. Add validation and logging.
10. Implement bounded retries.
11. Run role and permission tests.
12. Run failure and security tests.
13. Deploy with monitoring.
14. Review production failures and improve prompts/policies.
---
π 10. Operational Monitoring
Monitor every workflow using:
task_id
handoff_id
agent_id
tool_call
permission_check
decision
result
failure
retry_count
final_status
This provides end-to-end traceability without exposing unnecessary customer information.
---
π° 11. Complexity & Cost Considerations
The architecture deliberately avoids:
Separate FAQ Agent
Separate Research Agent
Separate Reviewer Agent
Separate Escalation Agent
Multiple coordinators
Those roles would add coordination overhead without a clear reliability benefit for this use case.
Final complexity:
2 AI agents + 1 human authorization layer
That is sufficient for the stated requirements.
---
π― FINAL AGENT TEAM SPECIFICATION
OBJECTIVE
β Automated customer support with controlled transactional operations
AGENTS
β π€ Support Agent
β π¦ Order & Refund Agent
β π§βπΌ Human Decision Owner
RESPONSIBILITIES
β Support owns communication
β Order/Refund owns transactions
β Human owns high-value authorization
TOOLS
β Knowledge Base
β Website Chat
β Order Database
β Refund API
β Email
β Approval System
MEMORY
β Shared business knowledge
β Isolated task state
β Minimal customer data
β Traceable task/handoff IDs
ORCHESTRATION
β Hybrid routing
HANDOFFS
β Structured, validated, traceable contracts
QUALITY
β Knowledge validation + policy validation + permission controls + human approval
RECOVERY
β Bounded retry β recovery β escalation β termination
TESTING
β Role + handoff + routing + permission + failure + loop + security + quality tests
DEPLOYMENT
β Implement smallest viable 2-agent system, instrument every transition, test boundaries, then expand only when production evidence justifies another agent.
By purchasing this prompt, you agree to our terms of service
CLAUDE-5-5-SONNET
Not every task needs multiple AI agentsβand randomly adding agents can create duplication, conflicts, higher costs, and coordination problems.
This prompt helps you design the right AI agent team for a given objective by identifying required roles, responsibilities, dependencies, authority, communication paths, handoffs, tools, memory, quality gates, and failure handling
Turn one complex AI task into a coordinated agent team with clear roles, ownership, tools, handoffs, controls, and execution
...more
Updated 1 week ago
