Customer support agent
An agent that handles tier-1 support: answers FAQs from a knowledge base, creates support tickets when it can’t, and escalates urgent cases to a human.Architecture
Setup
index.ts:
Knowledge base implementation
Several options forsearchKnowledgeBase:
Option A: Zavu’s built-in agent knowledge base
If you already use AI Agents knowledge bases, you do not need this tool at all. Retrieval runs automatically on every inbound message: Zavu pulls the relevant chunks and puts them in the agent’s context before the model answers. Attach the knowledge base to the agent and deletesearchKnowledgeBase.
To confirm an answer was actually grounded in your documents, read
knowledgeChunksUsed on the execution:
There is no public endpoint to query a knowledge base directly. If you need
retrieval you can call yourself, from a tool or from your own backend, use your
own vector store as in Option B.
Option B: Your own vector store (Pinecone, Qdrant, pgvector)
Option C: Static FAQ (good for small KBs)
For < 50 FAQs, embedded text search is fine:Deploy
Sample conversation
Improvements you can layer
Sentiment-driven escalation
Sentiment-driven escalation
Detect frustration from message text without relying on the LLM’s judgment:Then
npx zavudev fn triggers add --events message.inbound. This runs IN
ADDITION to the agent — observer pattern.Business hours awareness
Business hours awareness
Customer language detection
Customer language detection
Don’t hard-code Spanish. Tell the agent:Tool descriptions can stay in English — the LLM translates the natural
responses. Tool return values (like ticket summaries) can be templates
you i18n yourself.
Daily metrics summary
Daily metrics summary
Add a scheduled trigger (when we support cron in Functions) or rely on a
nightly external cron that calls a function-only HTTP path:
Tuning
Next
Ecommerce example
Order tracking, recommendations, cart recovery.
Define agents in depth
Provider selection, prompts, advanced config.
