Tutorial12 min read2026-02-10

How to build a customer support agent with OpenClaw

Walk through building a support agent that handles tickets, searches your docs, and knows when to escalate. Includes the full SOUL.md config.

Customer support is repetitive. The same questions come in over and over: How do I reset my password? What are your pricing tiers? Do you offer refunds? Can I export my data?

If you have a knowledge base with the answers, an OpenClaw agent can handle a big chunk of this. Not all of it. Some tickets need a human. But the routine ones, the ones that have clear answers in your documentation, those can be automated.

Here is how to build a support agent that actually works.

What you are building

A support agent that:

  1. Receives incoming support tickets (via email, webhook, or a form)
  2. Searches your docs and knowledge base for relevant answers
  3. Drafts a reply
  4. Sends the reply for easy tickets, or flags a human for complex ones
  5. Logs everything so you can review later

Prerequisites

  • OpenClaw installed and running (deployment guide)
  • An Anthropic or OpenAI API key configured
  • A knowledge base (can be markdown files, a Notion export, or a help center)

Step 1: Install the skills

You need three skills:

openclaw install email-responder
openclaw install knowledge-base
openclaw install ticket-triage

email-responder handles drafting and sending replies. knowledge-base indexes your docs so the agent can search them. ticket-triage classifies tickets by urgency and decides whether the agent can handle it or a human should step in.

Step 2: Index your knowledge base

Put your docs in a folder and point the skill at it:

openclaw kb index ./docs

This reads your markdown, HTML, or text files and creates a searchable index. If your docs live in Notion, export them as markdown first.

The index rebuilds automatically when files change. No need to rerun the command.

Step 3: Write your SOUL.md

This is where you define how the agent behaves. Create a SOUL.md file in your OpenClaw config directory:

# Support Agent

## Personality
You are a support agent for [Your Company]. You are helpful,
direct, and honest. If you do not know the answer, say so.
Do not make things up.

## Rules
- Always search the knowledge base before responding
- If the answer is not in the docs, escalate to a human
- Never share internal information, pricing exceptions, or account details
- Keep responses under 200 words
- Use the customer's name if available
- Do not apologize more than once per reply

## Escalation triggers
Escalate to a human when:
- The customer is angry or frustrated
- The question involves billing, refunds, or account changes
- You cannot find the answer in the knowledge base
- The customer explicitly asks to speak with a person

## Tone
Professional but not robotic. Write like a knowledgeable
coworker, not a chatbot. No exclamation marks. No "I'd be
happy to help!"

The SOUL.md matters more than you might expect. A vague persona produces vague replies.

Step 4: Set up the email integration

Configure the email responder to watch your support inbox:

openclaw config set email-responder.imap_host imap.gmail.com
openclaw config set email-responder.imap_user support@yourcompany.com
openclaw config set email-responder.imap_password YOUR_APP_PASSWORD
openclaw config set email-responder.check_interval 60

The agent checks for new emails every 60 seconds. When one arrives, it runs through the triage, search, and response pipeline.

Step 5: Configure the triage rules

The ticket triage skill needs to know your escalation thresholds:

openclaw config set ticket-triage.auto_respond true
openclaw config set ticket-triage.confidence_threshold 0.85
openclaw config set ticket-triage.escalation_email you@yourcompany.com

confidence_threshold controls how sure the agent needs to be before sending a reply automatically. At 0.85, it only auto-responds when it is quite confident. Lower the number to auto-respond more often. Raise it to escalate more.

Start high and lower it as you gain trust in the responses.

Step 6: Test it

Send a test email to your support address:

Subject: How do I export my data? Body: Hi, I need to export all my project data to CSV. How do I do that?

Watch the logs:

openclaw logs --follow

You should see the agent:

  1. Receive the email
  2. Classify it (routine question, low urgency)
  3. Search the knowledge base
  4. Find the relevant doc
  5. Draft a reply
  6. Send it (or flag it for review, depending on confidence)

How to handle the first week

Do not set this up and walk away. For the first week:

  • Set confidence_threshold to 0.95 so almost everything gets escalated
  • Review every auto-response before it goes out
  • Note which questions the agent handles well and which it botches
  • Update your SOUL.md and knowledge base based on what you see

After a week, you will have a good sense of what the agent can handle. Lower the confidence threshold gradually. Add more docs for the questions it struggled with.

What this costs

The main cost is LLM API usage. Each ticket involves:

  • One triage call (short, cheap)
  • One knowledge base search (local, free)
  • One response generation call (medium)

At roughly $0.01-0.05 per ticket with Claude Sonnet, handling 50 tickets a day costs $15-75/month. Cheaper than a part-time support person, and it works at 3 AM.

Limitations

Be honest with yourself about what this can and cannot do.

It can handle: FAQ-style questions, how-to requests, feature explanations, documentation lookups, status inquiries.

It cannot handle: Angry customers who need empathy, complex billing disputes, bugs that require investigation, anything that needs access to your internal admin tools.

The goal is not to replace human support. The goal is to handle the 40-60% of tickets that have clear, documented answers, so you can spend your time on the ones that actually need a person.

Next steps