Skip to main content
This example builds a complete customer support agent that:
  • Receives inbound customer emails via webhook
  • Extracts structured data (intent, urgency, order number)
  • Generates a contextual reply using an LLM
  • Sends the reply in the same conversation thread
  • Triages threads with status and tags

Architecture

Full implementation

Setup steps

1

Create an inbox with extraction schema

2

Deploy your webhook server

Deploy the Express/Flask server above to a public URL (Railway, Vercel, Fly.io, etc.).
3

Test it

Send an email to support@yourdomain.com and watch the agent respond automatically.

What to build next

  • Knowledge base integration — query your docs before generating replies
  • Escalation rules — auto-assign high urgency threads to a human
  • Multi-turn context — read previous messages in the thread before replying
  • CRM integration — look up customer data using the extracted order number
  • Analytics dashboard — track response times, resolution rates, and sentiment trends

Structured Extraction

Configure JSON schemas to extract intent, urgency, and order numbers.

Webhooks

Full webhook payload reference and delivery guarantees.

Prompt Injection Detection

Handle the security context in your webhook handler.

Threads

Triage threads with status and tags as your agent processes emails.
Last modified on March 19, 2026