Knowledge Base Guide

Build Your WhatsApp AI Knowledge Base

Everything you need to teach Agent Dilu about your business — tags, examples, catalogs, flows, and best practices. Use the Text editor or Visual Builder in the admin panel.

Getting Started

The knowledge base is a structured document the AI reads before every conversation. It defines who your agent is, what it knows, and what it sends — text, images, product catalogs, and interactive flows.

Text editor — write tags directly in the textarea. Visual Builder — click "Add Block" and choose a tag type; tags are generated automatically.

Set supported languages on the KB form (e.g. Sinhala, English, Tamil). When you connect WhatsApp, a starter KB is created with persona, greeting, fallback, and sample Q&A.

Recommended build order:

  1. Persona & greeting — who the agent is and the first message
  2. Fallback — what to say when the AI doesn't know
  3. Q&A pairs — exact answers for hours, location, returns
  4. Campaigns — topic triggers for promotions and services
  5. Sections — always-available info (contact, policies)
  6. Assets & catalogs — images, PDFs, product cards
  7. Flows — multi-step questionnaires for bookings
Test every change by messaging your WhatsApp number. Include trigger keywords in Sinhala, English, and Tamil.

STRUCTURE Persona, Greeting & Fallback

[PERSONA] — always loaded. Define name, role, tone, and language rules.

[PERSONA]
name: Dilu
role: Customer Service Agent for Sunrise Bakery
tone: Friendly, enthusiastic, professional
languages: Sinhala, English, Tamil (auto-switch based on the user's language)
[/PERSONA]

[GREETING] — sent on first contact. Supports {{FirstName}} and other variables.

[GREETING]
Hi! Welcome to [[Sunrise Bakery]]. I'm Dilu, your AI assistant on WhatsApp.
[/GREETING]

[FALLBACK] — when no campaign or Q&A matches.

[FALLBACK]
I'm not sure about that yet. You can ask in another way, or message us during business hours.
[/FALLBACK]

TEXT Plain Text — Background Knowledge

Any text without tags is read as general instructions. Use for business info and tone when you don't need a structured block.

# No tag needed
You are Dilu, a friendly AI assistant for Dilexus Marketing Agency.
Always reply in the same language the user writes in.

[QAndA] Direct Question & Answer

When a customer asks something matching a [Question], the server delivers the exact [Answer] — faster than free-form AI.

[QAndA]
[Question]Where is your store?[/Question]
[Answer]
We are at 45 Galle Road, Colombo 3. Open daily 8 AM – 8 PM.
[SEND: store_map]
[/Answer]
[/QAndA]

[CAMPAIGN] Triggered Topics

Activated when a message contains trigger keywords. Great for promotions, pricing, and services.

[CAMPAIGN: ai_workshop]
Triggers: workshop, AI training, register, ai event
Description: Tell the user about our AI Workshop on 15 Aug 2025. Cost LKR 8,500.
[SEND: brochure_2025]
[/CAMPAIGN]
Campaign names must be one word with underscores. Triggers are comma-separated and case-insensitive.

[SECTION] Named Content

Sections organise content the AI can reference. Nest inside campaigns or use standalone.

[SECTION: business_hours]
Monday – Friday, 9:00 AM – 6:00 PM (Colombo time).
[/SECTION]

[ENGLISH] Protect Brand Names

Keep product and brand names untranslated in Sinhala/Tamil replies.

[ENGLISH]FlexiPay Pro[/ENGLISH]
[[Dilexus Marketing Agency]]  # shorthand alias

[SEND] Attach Assets

Send images, PDFs, audio, or links when a topic triggers. Asset IDs come from the Assets library in the admin panel.

[SEND: assetId1, assetId2]

[BUTTONS] Interactive Reply Buttons

Tell the AI when to show tappable WhatsApp buttons or list menus.

[BUTTONS: Web Design | SEO | Branding]
When the user asks about services, present these options.
OptionsWhatsApp format
2–3Reply buttons (tappable)
4–6List menu
Max 20 chars eachPipe-separated with |

[CATALOG] Product Catalog Cards

Attach catalogs from the admin panel. Customers receive product cards with images, prices, and Order Now.

[CATALOG: catalogRecordId]
[CATALOG: catalogId:item1,item2]  # specific items
[CATALOG_PAGE_SIZE: 8]  # 1–50, default 5

[FLOW] Interactive Flows

Multi-step Q&A trees built under Flows in the admin panel. Fires last in the send chain.

[FLOW: flowRecordId]
[FLOW: flowId:entryQuestionKey]
Flows support buttons, free-text, memory capture, auto-translation, and reply media.

[WEBSEARCH] External HTTP Lookups

Connect live data (order status, stock). Create blocks under WebSearch Blocks, then reference in your KB.

[WEBSEARCH: blockRecordId]

RICH Button Messages & Agent Templates

[BUTTON_MSG: id] — pre-built interactive messages from Button Messages.

[AGENT_TEMPLATE: id] — reusable AI prompts from Agent Templates for complex scripts.

FLAGS Advanced Section Behaviour

MarkerEffect
[SUPPRESS_INTRO_TEXT]First hit: attachments only, no AI text (needs at least one attachment)
[FORCE_ASSETS_ON_FOLLOWUP]Re-send assets on follow-up in same topic
[FORCE_CATALOG_ON_FOLLOWUP]Re-send catalog cards on follow-up
[GUESS_GENDER]Enable Sir/Madam for {{Title}}
[CONFIRM_SWITCH]Ask Yes/No before switching campaigns mid-chat

[OUTGOING_CALL] Outbound Voice Calls

[OUTGOING_CALL: callBlockId]
Call script and scheduling instructions.
[/OUTGOING_CALL]
Requires voice calls enabled on your phone number.

AI-ONLY Never Write These Tags

The AI emits these; the server strips them before WhatsApp. Do not paste them into your KB.

TagPurpose
[MEMORY: {...}]Stores user facts for future turns
[SECTION_USED: name] Pins section attachments to reply
[QA_USED: N] Pins Q&A attachments
[CATALOG_FILTER: ...] Narrows catalog by attributes
Never hand-write AI-only tags. They have no effect when pasted manually.

{{ }} Template Variables

VariableReplaced with
{{TimeGreeting}}Good Morning / Afternoon / Evening
{{FirstName}}Contact's first name (empty if unknown)
{{Title}}Sir or Madam (with [GUESS_GENDER])
{{Title | "Sir/Madam"}}Same with fallback default
Good {{TimeGreeting}} {{Title}} {{FirstName}}! How can I help?

Worked Examples

Example 1 — Marketing agency

[CAMPAIGN: pricing]
Triggers: price, cost, packages, plan
Description: Explain service packages and invite them to book a call.
[SECTION: starter_plan]
Starter Plan — LKR 15,000/month. 8 social posts + basic SEO.
[/SECTION]
[/CAMPAIGN]

Example 2 — Retail store

[CAMPAIGN: mens_wear]
Triggers: men, mens, shirt, gents, pirimi
[CATALOG: catalog_id]
[CATALOG_PAGE_SIZE: 6]
[/CAMPAIGN]

Example 3 — Booking with flow

[SECTION: book_consultation]
[BUTTONS: Haircut | Colour | Treatment]
[FLOW: salon_booking_flow_id]
[/SECTION]

Tips & Rules

RuleDetail
Names — no spacesUse ai_workshop, not "ai workshop"
Test in WhatsAppMessage your number after every edit
Multilingual triggersInclude Sinhala, Tamil, and English keywords
Asset IDs must existUpload assets before referencing in [SEND]
Start simplePersona + greeting + 5 Q&A + one campaign, then add catalogs and flows
Keep text conciseShorter KB text = better replies and lower token use

Ready to build your knowledge base?

Sign in to the admin panel to use the Visual Builder, upload assets, and connect your WhatsApp number.