Skip to main contentThe 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 entire 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 message to the topic’s name, sample questions, and content — with higher weighting given to the name and sample questions.
- It returns the top few matching topics.
- The model selects one and generates a reply (and may trigger an action, function, or flow transition).
Types of knowledge base entries
Below are 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 and the offer.
actions: Trigger transfer_call (or another handoff function) only if the user accepts.
Example – Spa booking
Direct
Immediate transfer with no agent reply.
- Leave
content empty.
- Always run
transfer_call in actions.
Example – Billing handoff
Conditional
Transfer based on user clarification — for example, group size or request type.
content: Ask a disambiguating question.
actions: Map each answer to the correct destination.
Example – Room reservations
Outbound messaging
Used when you want to follow up with a link or information by text or chat (SMS or WhatsApp).
Offer
Offer to send a link via message.
content: Include a short message and ask for consent.
actions: If accepted, call start_sms_flow.
Example – Golf info
Conditional
Let the user choose which message to receive.
content: Ask a branching question.
actions: Map answers to different sms_ids.
Example – Tee time booking
Info only
Used for static 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, or Info.
Resources