Overview
The knowledge base (KB) is the brain of your agent. Each topic defines a single intent, how users might phrase it, what the agent should say, and what it should do next.
Well-structured entries keep answers clear, safe, and meaningful.
How retrieval works
The agent does not see the whole knowledge base every time. Instead, it uses retrieval-augmented generation (RAG) to find the best match for the user’s message.
- The retriever compares the user’s message to the name, sample questions, and content.
- It returns the closest few topics.
- The model selects one and generates a reply (and may trigger an action).
Types of knowledge base entries
We will now go through the broad categories that most knowledge base entries tend to fall into:
Simple FAQ
Used when the agent just needs to answer a question with no follow-up or action required.
Single turn
One message in, one message out.
- Add a short, helpful reply in
content
. - Leave
actions
empty.
Example – Pet policy (single-turn)
Multi turn
Ask a clarifying question before giving the answer.
- Use branching inside
content
to structure the reply. - Leave
actions
empty.
Example – Pet policy (multi-turn)
Handoff
Used when the agent should offer to connect the user to a human agent.
Offer
Agent replies, then offers to transfer.
content
: Include the answer + offer.actions
: Triggertransfer_call
only if user accepts.
Example – Spa booking
Direct
Immediate transfer with no agent reply.
- Leave
content
empty. - Always run
transfer_call
inactions
.
Example – Billing handoff
Conditional
Transfer based on user clarification, for example, group size, request type.
content
: Ask a disambiguating question.actions
: Map each answer to the correct destination.
Example – Room reservations
SMS
Used when you want to follow up with a link or info through text.
Offer
Offer to send a link by SMS.
content
: Include a short message and ask for consent.actions
: If accepted, callstart_sms_flow
.
Example – Golf info
Conditional
Let the user choose which SMS to receive.
content
: Ask a branching question.actions
: Map answers to differentsms_id
s.
Example – Tee time booking
SMS + handoff combo
Used when you want to try sending a text, and if that fails, offer to transfer instead.
content
: Offer SMS, with a polite fallback.actions
: Include both SMS and optional transfer logic.
Example – Concierge activities
Info only
Used for reference material (like opening hours or prices). No interaction or action required.
- Fill
content
- Leave
actions
empty
Example – Opening hours
Best practices
Do this:
- Use specific topic names
- Add 5–10 realistic sample phrasings
- Keep replies short, helpful, and on-brand
- Use
actions
only when necessary - Split multi-part flows into separate turns or topics
Avoid this:
- Bundling multiple intents into one topic
- Running more than one action per turn
- Using vague topic names like
Misc
,Help
, orInfo