AWS Builder Center

From Customer Query to Safe Refund: Building an AI Support Agent with Amazon Bedrock AgentCore

I built and deployed Smart Support Agent, an AI-powered customer support system using Strands Agents, Amazon Bedrock, and Amazon Bedrock AgentCore. The project combines tool calling, session persistence, safety guardrails, refund verification, multi-agent delegation, and evaluation to create a more reliable agentic workflow.

Customer support agents need to do more than generate text. They need to access customer data, follow business rules, remember conversations, and handle sensitive actions safely.
To explore this, I built Smart Support Agent using Strands Agents, Amazon Bedrock, and Amazon Bedrock AgentCore Runtime.
Smart Support Agent architecture built with Amazon Bedrock AgentCore.


🛠️ What I Built

The agent can:
  • Look up customer accounts
  • Retrieve order history
  • Process refunds
  • Maintain session history
  • Apply steering and safety rules
  • Delegate technical issues to a specialist agent
  • Evaluate responses and tool-call workflows
The main customer-service tools are:
lookup_customerget_order_historyprocess_refund

🔐 Making Refunds Safer

One of the most valuable parts of the project was designing the refund workflow.
The agent doesn't immediately process a sensitive request. It first verifies the customer and checks the relevant order.
During testing, a partial $9.99 refund was proposed for a $79.99 order without sufficient context. Instead of blindly executing it, the steering layer blocked the action and required human review.
I then tested the complete valid workflow:
Customer C-1001 → Order ORD-5521 → Full refund of $79.99
The deployed AgentCore runtime successfully processed the refund.
The agent verifies customer identity before allowing a sensitive refund action.

This demonstrated an important principle:
High-impact agent actions should have deterministic controls around them, not rely only on the LLM.

💾 Solving Session Persistence

During deployment, I encountered:
PermissionError: [Errno 13] Permission denied: '/var/sessions'
The application needed a writable location for file-based session storage.
I changed the session directory to:
/tmp/smart-support-sessions
and kept the conversation manager for maintaining the agent's context.
This was a useful reminder that local development environments and cloud runtimes can have different filesystem constraints.

🤖 Multi-Agent Technical Support

I then extended the system using an agents-as-tools approach.
The main customer-service agent can delegate technical problems to a dedicated Tech Support Specialist.
Customer ↓Customer Service Agent ├── Account / Orders → Customer Tools ├── Refund → Verified Refund Workflow └── Technical Issue ↓ Tech Support Specialist ↓ Diagnostics & Troubleshooting
For example, when a customer reported that their wireless headphones were not pairing, the orchestrator delegated the issue to the specialist.
The test produced:
[DELEGATION] Tech support specialist activated[DELEGATION] Specialist responded
The customer-service orchestrator delegates technical troubleshooting to a specialized support agent.


🧪 Evaluating Agent Behavior

I also explored automated evaluation for the agent.
Output evaluation checks:
  • Accuracy
  • Completeness
  • Professional and empathetic tone
Trajectory evaluation checks whether the agent follows the expected tool workflow.
For a refund, the expected sequence is:
lookup_customer ↓get_order_history ↓process_refund
This matters because an agent can produce a convincing final answer while still following an unsafe workflow internally.

☁️ Deploying to Amazon Bedrock AgentCore

Runtime.
The runtime reached:
smartSupportAgent: Deployed - Runtime: READY
I then successfully invoked the deployed AWS runtime and tested customer lookup, order retrieval, and the complete refund workflow.
Smart Support Agent successfully deployed to Amazon Bedrock AgentCore Runtime.


After local testing, I packaged and deployed the application to Amazon Bedrock AgentCore :-


💡 What I Learned

This project taught me that building an AI agent isn't just about getting an LLM to generate a good answer.
Reliability comes from the system around the model:
Tools + Guardrails + Persistence + Delegation + Evaluation + Cloud Runtime
The most valuable part was debugging real deployment issues and understanding how these components work together.

🚀 What's Next?

Some improvements I would like to explore next:
  • A user-friendly web chat interface
  • Managed long-term memory
  • Human approval for high-value refunds
  • More specialist agents
  • Continuous evaluation
  • Better observability and monitoring
  • CI/CD deployment

🔗 Source Code

The complete project is available on GitHub:
Building Smart Support Agent gave me a much deeper understanding of how to move from a simple AI assistant to a tool-using, safety-aware, multi-agent application deployed on AWS.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article