Skip to main content

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

Replace index.ts:

Knowledge base implementation

Several options for searchKnowledgeBase:

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 delete searchKnowledgeBase. To confirm an answer was actually grounded in your documents, read knowledgeChunksUsed on the execution:
A zero there on an agent that has documents attached means the reply was not grounded in them.
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)

Set the secrets:

Option C: Static FAQ (good for small KBs)

For < 50 FAQs, embedded text search is fine:
Bumps to vector search later are a few lines of change.

Deploy

Sample conversation

Improvements you can layer

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.
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.
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.