
From Question to Resolution: Building an AI Help Desk Using AWS Blocks
Build a secure AI-powered Help Desk with AWS Blocks, taking customers from questions to grounded answers and human support. Explore AI Agents, KnowledgeBase, authentication, role-based access, Realtime ticket updates, rate limiting, and observability. See how AWS Blocks brings these capabilities together in a local-first full-stack application.
Series: Series: AWS User Group Madurai - Skill Sprint Challenge - DevTool Month - AWS Blocks (3 articles)
- 3From Question to Resolution: Building an AI Help Desk Using AWS Blocks This article
From a Customer Question to Human Support
A customer types "How do I reset my password?" into a support form. What happens next?
The system doesn't just generate an answer and hope for the best. It searches a curated knowledge base for relevant documentation, scores its confidence in the match, and makes a decision: if the answer is reliable enough, it resolves the ticket automatically. If it isn't - if the question is ambiguous, the docs don't cover it, or the confidence falls below threshold - it creates a support ticket and routes it to a human agent.
That's the core idea behind this Help Desk. The goal isn't to replace human support with AI. It's to build a pipeline that retrieves trusted information first, attempts resolution when confidence is high, and escalates gracefully when it's not. Every ticket either gets answered from verified documentation or lands in front of a person who can help - nothing falls through the cracks, and nothing gets a hallucinated response passed off as fact.
What We Built
The application has two sides - one for customers seeking help, one for agents providing it.
The customer experience:
A customer signs in, describes their issue, and submits it. The system searches its knowledge base and returns an AI-generated answer along with the source document it drew from. If the answer doesn't resolve things, the customer can escalate to human support with one click. From there, they track the ticket's progress - open, in progress, resolved - without refreshing the page.
The agent experience:
A support agent signs in and sees a live queue of incoming tickets. New requests appear in real time as customers submit them. The agent can update a ticket's status as they work through it, assign it to a colleague, or upload documentation to the knowledge base so the AI handles similar questions automatically next time.
Two roles, one connected workflow. The AI handles what it can, the humans handle what it can't, and the knowledge base gets smarter with every resolution.
The Architecture Behind the Demo

Left side - Client Layer:
- Customer and Support Agent users
- TypeScript SPA with all components (Auth Gate, Ticket Form, List, Detail, KB Management)
- Role-based actions for each user type
Right side - AWS Cloud:
- ApiNamespace (API Gateway) → entry point for all HTTP requests
- AuthCognito (Cognito) → 3 groups: customers, agents, admins
- Ticket Service (Lambda) → core business logic with all endpoints
- DistributedTable (DynamoDB) → tickets + rate limits with GSI indexes
- FileBucket (S3) → presigned URL attachments
- AI Agent (Bedrock) → generates responses with confidence scoring
- KnowledgeBase (Bedrock KB) → RAG retrieval, semantic chunking
- Realtime (WebSocket) → pushes ticket.created, status_changed, assigned events
- CloudFormation → IaC deployment
- Logger + Metrics (CloudWatch) → resolution rate, time-to-response, escalation rate
Bottom - Request Flow: Customer submits ticket → API authenticates → stores in DynamoDB → AI queries KB → auto-resolve if confident, escalate if not → Realtime pushes to Agent Dashboard
Demo 1 - Customer Asks the AI
Let's walk through what happens when a real customer question hits the system.
A customer signs in and submits a ticket: "How do I reset my password? My reset link expired."

Behind the scenes, that question doesn't go to a general-purpose language model. It goes to a retrieval pipeline. The AI Agent takes the customer's words, queries the Knowledge Base, and pulls back the most relevant chunk from your local help documentation - in this case, the password-reset.md file you uploaded:
"Reset links expire after 1 hour for security. Request a new one from the sign-in page."
The response the customer sees comes with a confidence score. If that score is high enough (≥ 70%), the ticket resolves automatically, tagged with "Resolved by AI" and the source document that backed the answer. If confidence is low, the system leaves the ticket open and routes it to a human - but still attaches the draft response so the agent has context.

This is the critical distinction: the AI isn't making things up. Every answer traces back to a specific document in the Knowledge Base. The agent put that document there. The retrieval engine found it. The customer sees both the answer and where it came from.
The flow:
Customer signs in → submits a question
Ticket Service receives it → passes subject + description to the AI Agent
AI Agent queries the Knowledge Base (RAG retrieval)
Knowledge Base returns the best-matching chunk + relevance score
If confident → auto-resolve with source attribution
If not → escalate to human agent with the draft attached
No hallucination. No unbounded generation. Just retrieval, scoring, and a clear handoff when the system isn't sure.
Demo 2 - When AI Can't Solve It
This is where it gets interesting. The AI tried. It searched the Knowledge Base, scored below threshold, and now it needs to get out of the way.
The customer doesn't fill out another form. They don't start a new conversation. The system simply escalates - the AI Agent calls createTicket(), writes the issue to the DistributedTable, and the Realtime layer fires a ticket.created event over WebSocket.
On the other side of the screen, a support agent is looking at their dashboard. The ticket appears live - no refresh, no polling. One moment the queue is empty, the next moment a new ticket slides in with the customer's question, the AI's draft response (for context), and a confidence score showing exactly why it didn't auto-resolve.

The flow:
- Customer submits their question
- AI Agent queries the Knowledge Base - confidence comes back below 70%
- The system doesn't guess. It calls createTicket() with the full context
- Ticket is stored in DynamoDB
- Realtime publishes ticket.created over WebSocket
- Agent's dashboard receives the event - ticket appears instantly
The customer sees their ticket status update to "open." The agent sees it land in their queue with everything they need to respond: the original question, what the AI found, and why it wasn't confident enough to answer on its own.
No dead ends. No "please try again later." Just a seamless handoff from machine to human, with full context preserved.
Demo 3 - Security in Action
It's easy to claim an app is secure. Let's prove it.
Open two browser windows side by side. In one, sign in as a customer. In the other, sign in as an agent. Now try something the UI doesn't offer - call an agent-only endpoint directly from the customer's session.

The customer tries to update a ticket's status. The backend responds: Access Denied. Not because the button was hidden in the UI - the customer's browser literally sent the request. The server rejected it.

Switch to the agent's window. Same request, same endpoint. Allowed.
This is the architecture at work:
- requireAuth - every request must carry a valid session token. No token, no access.
- requireRole(context, 'agents', 'admins') - status updates, ticket assignment, and KB management check group membership server-side. A customer token won't pass regardless of how the request is crafted.
- Customer ownership checks - customers can only view their own tickets. The backend verifies ticket.customerId === authenticatedUser before returning data. A customer can't enumerate or read another customer's tickets by guessing IDs.
- Protected FileBucket operations - upload and download URLs are gated behind role checks. You can't generate a presigned URL without being authenticated and authorized for that ticket.

The key message: authorization is enforced by the backend, not by hiding buttons in the UI. The frontend removes controls that don't apply to your role - that's a UX courtesy. But even if you bypass the frontend entirely and hit the API raw, the server says no.
Security isn't a feature you toggle on at the end. It's a trust boundary that every request passes through.
What Happens Behind the Scenes?

Left side - The 10-step flow:
- Customer Question → "My billing page shows a blank white screen"
- Authentication → AuthCognito verifies token + groups
- AI Agent → Resolution Agent receives subject + description
- KnowledgeBase Retrieval → RAG query returns ranked chunk from billing-faq.md with score
- Grounded Answer → Confidence check against 70% threshold (decision diamond)
- Escalation → If below threshold, createTicket() with AI draft attached
- DistributedTable → Ticket persisted with GSI indexes
- Realtime → WebSocket publishes ticket.created event
- Agent Dashboard → Ticket appears live, no refresh needed
- Resolution → Agent resolves, customer notified in real-time
Right side — How Blocks work together:
- Each Block's role and configuration explained
- Key insight panel showing the composition pattern: Auth → API → Service → KB → Agent → Table → Realtime → Metrics
- Framework summary: 10 Blocks, 1 backend file, type-safe, local-first
What I Learned :
Three things stuck with me after building this.
- AI is only one part of an AI application.
The Bedrock agent and the Knowledge Base get all the attention, but they're maybe 15% of the actual system. The rest is authentication, state management, error handling, rate limiting, file uploads, real-time delivery, role-based access, schema validation, and a frontend that ties it all together without falling apart. The model generates a response in milliseconds. Making that response trustworthy, delivering it reliably, and handling the case where it's wrong - that's where the real engineering lives.
- Realtime and durable state need to work together.
WebSocket events give you the experience - a ticket appearing live on the agent's screen without a refresh. But the DynamoDB table is the source of truth. If the WebSocket drops, the data is still there. If the user reloads, the state reconstructs from the database, not from cached events. Realtime is a delivery mechanism, not a storage layer. Building both and wiring them together (publish on write, subscribe on connect, reconcile on reconnect) is what makes the system feel instant without being fragile.
- Security has to exist at the API boundary.
Hiding a button in the UI is not access control. A customer can open dev tools, craft a request, and call any endpoint they want. If requireRole(context, 'agents') doesn't exist on the backend, the role distinction is theater. Every endpoint checks authentication. Every mutation checks authorization. Every query checks ownership. The frontend removes controls that don't apply to your role as a courtesy - but the server is the one that says no.
Series: Series: AWS User Group Madurai - Skill Sprint Challenge - DevTool Month - AWS Blocks (3 articles)
- 3From Question to Resolution: Building an AI Help Desk Using AWS Blocks This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article