TnsAI

Tutorial: Customer Support Bot

A full code walkthrough for this tutorial is still being written. In the meantime this page describes the shape of the system and links to the framework pieces you'd compose to build it. If you start the implementation and hit something missing, open a discussion — concrete questions accelerate the write-up.

Goal

A support agent that:

  1. Answers product questions from a knowledge base via RAG.
  2. Creates tickets through a webhook when it can't find a confident answer.
  3. Escalates to a human reviewer when the user is frustrated.

Architecture

User message ──▶ SupportRole

                    ├──▶ @Retrieval(knowledge="support_kb")   ◀── KnowledgeBase (RAG)

                    ├──▶ @Tool create_ticket(...)             ◀── HTTP webhook

                    └──▶ @Tool escalate(...)                  ◀── HumanReviewSink
                                                                  (sentiment-aware)

Building blocks you'd compose

  • Knowledge base — ingest your support docs as a KnowledgeBase and consume it from the role with @KnowledgeSource + @Retrieval. See RAG guide.
  • Tools — define create_ticket and escalate as @Tool-annotated methods on a POJO; register via AgentBuilder.toolPojos(...). See Tools guide.
  • Sentiment-aware escalation — wrap the inbound message in a guardrail (@InputGuardrail) or pre-step that runs a sentiment classifier and short-circuits to escalate when frustration is detected.
  • Observability — enable tracing with @Traced on action methods so each ticket / escalation lands in your trace exporter.

On this page