Skip to main content
Back to AI Commerce Lab
AI·June 2025·9 min read

Leveraging Large Language Models Like ChatGPT to Transform Customer Service Automation

An LLM support agent is not a smarter chatbot. It's a system that classifies intent, retrieves grounded facts from your own knowledge base, calls real tools against your order and ticketing systems, and hands off to a human the moment it's uncertain. Skip any one of those four parts and you get a fluent agent that confidently makes things up.

What an LLM actually adds over a rule-based bot

Traditional support bots match keywords against a fixed decision tree. They break the moment a customer phrases a question differently than the tree expects, which is most of the time.

Large language models handle unstructured input, multi-turn context, and ambiguous phrasing without a rule for every variation (AWS — What is a large language model?). That's a real capability difference, not a marketing one. It's also not the same thing as reliability, and reliability is what a support system actually needs.

Where the capability gap actually matters

A customer asking "the thing I ordered last week hasn't shown up and I need it by Friday" contains an implicit order lookup, an implicit urgency signal, and an implicit expectation of a specific answer. A keyword bot needs three separate intents pre-defined to catch that. An LLM can parse it directly, provided it has a tool to actually check the order.

The architecture that works: tools, not just chat

A model that only talks is a demo. A model that can look up an order, check a return policy, and file a ticket is a support agent. The mechanism for that is tool use, sometimes called function calling: the model is given a set of typed operations it can invoke, and your code executes them.

In the OpenAI API, a tool call comes back as a structured object with a function name, JSON-encoded arguments, and a call ID; your application executes it and returns the result in a follow-up message, and the model uses that result to respond (OpenAI — Function calling). Anthropic's Claude models follow the same round trip: Claude returns a tool_use block, your application runs the operation, and you send a tool_result block back in the next request (Anthropic — Tool use with Claude).

{
  "name": "get_order_status",
  "description": "Look up the current status and expected delivery date for an order.",
  "input_schema": {
    "type": "object",
    "properties": {
      "order_id": { "type": "string", "description": "The customer's order number" }
    },
    "required": ["order_id"]
  }
}

Strict schemas beat freeform generation

Both platforms support a strict mode that forces the model's tool call to match the declared schema exactly, instead of best-effort matching (OpenAI — Structured outputs). For a support agent, that's the difference between a refund tool that always receives a valid order ID and one that occasionally receives a hallucinated string that silently fails downstream.

Grounding answers in your own content

A model's parametric knowledge, whatever it learned in training, is not your return policy, your SLA, or your current promotion terms. Retrieval-augmented generation, pulling the actual relevant policy text into the prompt before the model answers, is what keeps answers tied to what's actually true for your business instead of a plausible-sounding guess.

ApproachWhat it's good forWhere it breaks
Prompt-only, no retrieval or toolsGeneral tone, FAQ-style answers on stable topicsAnything account-specific; policy details drift from what's actually current
Retrieval-grounded (RAG against your help center)Policy questions, how-to content, anything documentedAnything requiring a live lookup, like an order's real-time status
Tool-calling agent (RAG plus function calls)Order status, refunds, account changes, anything requiring a system of recordNeeds real evals and guardrails before production; more moving parts to monitor

A model that answers from memory will eventually state your old return window as current. A model that retrieves the actual policy document before answering can only be as wrong as your documentation is.

Evaluate before you ship, not after complaints start

OpenAI's evals framework exists specifically to test model outputs against criteria you define, before and after every prompt or model change (OpenAI — Working with evals). The workflow is close to behavior-driven development: define the expected behavior first, run it against a representative dataset of real support conversations, grade the outputs, then iterate on the prompt or the retrieval setup based on what fails.

What to actually grade

  1. Factual accuracy against your current policy documents, not the model's training data.
  2. Correct tool selection: did it call the refund tool when a refund was actually warranted, and not otherwise.
  3. Tone and brand consistency across a sample of real, messy customer phrasing.
  4. Correct escalation: did it hand off when it should have, instead of guessing.

Run this against a held-out set of real historical tickets, not a handful of hand-picked happy-path examples. The tickets that broke your last rule-based bot are exactly the ones that belong in the eval set.

Escalation and human-in-the-loop design

Anthropic's own engineering guidance draws a useful line between workflows, where an LLM and tools run through a predefined code path, and agents, where the model directs its own process and tool use dynamically (Anthropic — Building effective agents). Their explicit recommendation is to start with the simplest structure that solves the problem and add autonomy only when it demonstrably improves outcomes.

For most support use cases, that means: a router step classifies intent, deterministic logic handles the fully solved cases (order status, tracking, simple returns), and only genuinely ambiguous or high-stakes requests get routed to a more autonomous, tool-using step, with a human review checkpoint before anything irreversible happens.

Where a human has to stay in the loop

  • Any refund or credit above a defined dollar threshold.
  • Any account change that's hard to reverse: cancellations, address changes on in-transit orders, payment method updates.
  • Any interaction where the model's own confidence signal, or the retrieval step, comes back empty or contradictory.
  • Any complaint that includes legal, safety, or accessibility language, regardless of how confident the model sounds.

Anthropic's guidance is specific on this point: autonomous agents need testing in sandboxed environments and explicit guardrails, precisely because their errors compound silently across a multi-step task in a way a single bad response doesn't.

Handling hallucination honestly

No amount of prompt engineering eliminates hallucination outright. The realistic goal is reducing its blast radius: ground every factual claim in a retrieved source, require the model to cite what it retrieved, and treat an empty or low-relevance retrieval result as a signal to escalate rather than a gap to fill in with a guess.

The fix for hallucination isn't a better prompt. It's an architecture where the model has nothing to hallucinate from, because every factual claim traces back to a retrieved document or a tool result.

A minimal failure-handling checklist

  • Retrieval returned nothing relevant: escalate, don't answer from memory.
  • Tool call failed or returned an error: surface that plainly, don't paper over it with a generic apology.
  • Model requests a parameter the schema doesn't provide: this is usually the model guessing; block the call and ask a clarifying question instead.
  • Customer expresses frustration or repeats a question: treat repetition as an escalation signal on its own, independent of the content.

Wiring into the platforms teams already use

Most support teams aren't replacing Zendesk or Intercom, they're automating what happens inside them. Zendesk's ticketing API supports creating, updating, and querying tickets programmatically, including idempotency keys so a retried request doesn't create a duplicate ticket (Zendesk Developer Docs — API reference). Intercom's API covers the same territory for conversations and contacts on their platform (Intercom Developer Hub).

The practical pattern: the LLM layer sits behind the existing platform's webhook or API, drafts a response or takes a defined action, and either sends it directly for fully solved cases or queues it for agent review for anything outside the confidence bar you've set.

Each tool call is a round trip: a model request, a wait for the API response, and a second model request to interpret it. A ticket that needs three lookups, order status, return eligibility, then refund calculation, pays for three of those round trips before a customer sees a reply. Design for that latency explicitly, either by running independent lookups in parallel or by setting a visible "looking this up" state, rather than letting a multi-tool ticket time out silently.

Keeping it accurate after launch

Launch is not the finish line. A retrieval index built from your help center goes stale the day someone edits a policy page and forgets the LLM pipeline is reading a cached copy. Refresh the index on a defined schedule, tied to your content management system's publish events, not on a quarterly ad-hoc basis.

The eval set needs the same ongoing ownership. New ticket types show up, edge cases get discovered in production, and each one should get added back into the eval dataset so a future prompt or model change can't silently regress on a case you already fixed once.

Who owns what

Support operations owns the content: policy accuracy, tone, escalation thresholds. Engineering owns the pipeline: retrieval freshness, tool reliability, monitoring for failed calls. Neither can own both halves alone, and treating this as a one-time engineering project instead of a jointly maintained system is the most common reason quality drifts within a few months of launch.

FAQ

Does an LLM support agent need to be fully autonomous to be useful?

No. Anthropic's own guidance recommends starting with a simple, mostly deterministic workflow and adding model-directed autonomy only where it demonstrably improves outcomes (Anthropic — Building effective agents).

How do you stop the model from making up policy details?

Ground every policy answer in retrieved text from your actual current documentation, and treat a failed or empty retrieval as an escalation trigger rather than something to fill in from the model's training data.

What's the difference between function calling and structured outputs?

Function calling lets the model request that your application run a specific operation with specific arguments. Structured outputs is the mechanism, available for both plain responses and tool calls, that forces those arguments to conform exactly to a schema you define (OpenAI — Structured outputs).

How do you know if the system is actually working before customers see it?

Run it against an evals dataset built from real historical tickets, grading factual accuracy, correct tool selection, and correct escalation, before it touches live traffic (OpenAI — Working with evals).

Can this replace a human support team?

It can absorb the fully solved, well-documented volume: order status, tracking, simple policy questions. Anything ambiguous, high-value, or emotionally charged still needs a defined human handoff, not a more confident-sounding model.

Does this require building on a specific vendor's model?

No. Both OpenAI and Anthropic expose the same core primitives, tool calling and structured outputs, with slightly different request shapes. The architecture described here, routing plus retrieval plus tools plus escalation, is vendor-agnostic.

References

From the Destm engineering archive. For current work on this topic, start at Solutions or the blog.