Guide to Writing AI Behavior & Knowledge Base
이 페이지는 아직 한국어 언어로 제공되지 않습니다. 기본 언어(English)로 표시합니다.
Guide to Writing AI Behavior & Knowledge Base
A practical guide to writing AI Behavior and Knowledge Base content that is tidy, accurate, and easy for the Cekat AI Agent to understand.
The quality of an AI Agent’s answers is determined mostly by two things: what you instruct it to do (AI Behavior) and what the AI knows (Knowledge Base). This guide explains how both work and the best writing format for each.
This guide follows the New AI Agent Interface (the AI Behavior, AI Actions & Routing, AI Configuration, and Knowledge Base tabs). If you are still using the old interface, see If You Are Still Using the Old Interface.
1. Understand the Role of Each Section
The most common mistake is putting everything in one place. Each section has a different purpose:
| Section | Purpose | What belongs here | Do not fill it with |
|---|---|---|---|
| Welcome Message | The first greeting, sent exactly as written (not processed by the AI) | A greeting, a short introduction, 2–4 topic options | Instructions for the AI |
| Communication Style | Personality and way of speaking | Identity, tone, language, form of address, answer length | Product info, prices, SOPs |
| Conversation Flow | What the AI does in specific situations | Steps per scenario: asking, offering, ordering, complaints | Long FAQ lists |
| Rules & Restriction | Limits the AI must follow in every reply | Prohibitions, topic limits, privacy & compliance rules | Language style, conversation flow |
| Additional Instructions | Extra instructions, which can be specific to a pipeline | Different treatment for new leads, existing customers, etc. | General instructions that apply to all |
| AI Actions & Routing | System actions: transfer to an agent, label, move pipeline | Trigger conditions (Prompt, Keywords, Number Of Message) | — |
| Knowledge Base | The source of facts | Products, prices, schedules, policies, FAQs, SOPs | Behavior instructions |
The Knowledge Base is treated as information, not instructions. If AI Behavior and the Knowledge Base conflict, the AI is told to follow AI Behavior first. A sentence like “Never give discounts” written only in the Knowledge Base is weak and can be ignored. Write rules like that in Rules & Restriction.
How the AI uses both
- Every reply includes your AI Behavior. Communication Style, Conversation Flow, and Rules & Restriction are always sent, in that order, followed by the Additional Instructions that apply to that conversation. An Additional Instruction applies if no pipeline is selected, or if the conversation is currently in one of the selected pipelines. Instructions with an empty title or content are skipped. The Welcome Message is not included here: it is sent to the customer as a separate message.
- To answer a question, the AI searches the Knowledge Base by meaning (not exact keywords) using the customer’s latest message and the recent conversation, then retrieves only the most relevant chunks (Text, QnA, File, and Website content compete in the same search). The maximum number of chunks is set by the AI Context Limit in AI Configuration (50 if left empty, never more than 60). If more than 20 chunks are found, the system re-ranks them and keeps only the best 20 or so. In practice, the AI sees about 20 chunks per question, no matter how large your Knowledge Base is.
- The AI also reads the conversation history up to the AI History Limit (default 20 messages, minimum 10).
The consequences:
- Keep Behavior concise. The longer and more rambling it is, the more likely important instructions will be missed.
- Break Knowledge into tidy chunks by topic. The AI does not read the whole Knowledge Base, only the relevant chunks. Each chunk must be understandable without reading other parts.
- Break long flows (such as ordering) into steps, because older messages can fall outside the history window.
When instructions conflict
- AI Behavior vs. Knowledge Base: the AI is told to follow AI Behavior first, then answer examples, then the Knowledge Base.
- Between AI Behavior fields: no field automatically wins. Rules & Restriction does not automatically override Conversation Flow just because it is called “rules”. The AI reads them as one block, in the order Communication Style, Conversation Flow, Rules & Restriction, Additional Instructions, and then decides which to apply.
- So don’t let conflicts happen by accident. If one instruction must override another, say so in a clear sentence, for example: “This rule overrides all steps in Conversation Flow.” (See the emergency rule in the Healthcare example.)
2. AI Behavior Writing Format
General principles
- One instruction, one sentence. Use bullets, not long paragraphs.
- Use firm command verbs: “Ask…”, “Answer…”, “Don’t…”, “Always…”.
- Write conditions explicitly: “If the customer asks about price, …”. Avoid “sometimes” or “if possible”.
- Give example sentences for responses that must stay consistent (order format, the sentence before a handoff).
- Avoid contradictory instructions between fields. For example, Communication Style asks to “answer briefly” but Conversation Flow asks to “explain all the benefits in detail”. If there is an exception, write it explicitly (see When instructions conflict).
- Don’t copy facts (prices, stock, addresses) into Behavior if they are already in the Knowledge Base. Two different sources confuse the AI when one of them is updated.
- Use
[...]placeholders only in templates, and replace all of them before saving.
Communication Style (max. 5,000 characters)
Suggested structure:
## Identity
- You are [AI Name], [role] at [Business Name], [1-sentence business description].
- Refer to yourself as "[AI Name]". Do not use "aku" or "saya".
## Tone & Greeting
- Tone: [friendly / professional / empathetic], [semi-formal].
- Address customers as "Kak" (or "Bapak/Ibu" if the customer uses formal language).
- Use emoji sparingly, maximum 1 per reply.
## Language
- Reply in the language the customer uses (Indonesian, English, Javanese, etc.).
## Reply Format
- Maximum 3–4 sentences per bubble. Break long info into points.
- Do not use tables or markdown headings in chat.
- Ask a maximum of 1 question per reply.
- End replies with a relevant follow-up question, unless the conversation is finished.
Conversation Flow (max. 8,000 characters)
Write it as a list of scenarios. Each scenario contains a trigger and numbered steps.
## [Scenario Name]
Trigger: [when this scenario applies]
1. [First step]
2. [Next step]
3. [Final result / closing sentence]
The minimum scenarios you should have:
| Scenario | Example contents |
|---|---|
| Opening / qualification | Ask for the name and need, one at a time |
| Information questions | Answer from the Knowledge Base, then guide to the next step |
| Recommendation / offer | Ask about the need, give 1–3 options, mention the benefits |
| Transaction (order / booking / sign-up) | Send the data format, check completeness, confirm a summary |
| Objection / hesitation | Acknowledge the objection, give 1 strong reason or an active promo |
| Complaint | Apologize, collect data, say the team will help |
| Information not available | Don’t guess; say the team will check |
Price calculations: If the AI needs to calculate a total (shipping, COD fee, installments), write the formula as steps and ask the AI to show a per-item breakdown before the total. Set AI Creativity Level to Consistent, and use the Advanced or Auto model for calculations.
Rules & Restriction (max. 3,000 characters)
These are hard limits. Write them short and firm, ordered from most to least important.
## Required
- Answer ONLY based on the Knowledge Base and these instructions.
- If the information is not available, say the team will check. Do not guess or make things up.
## Prohibited
- Do not give prices, promos, or schedules that are not listed in the Knowledge Base.
- Do not ask for passwords, PINs, OTPs, or full card numbers.
- Do not discuss or recommend competitors.
- Do not answer topics outside [business scope]. Politely redirect.
Additional Instructions (max. 30 instructions, 2,000 characters per instruction)
Use these for behavior that differs by customer stage by selecting a Pipeline. The instruction only applies while the conversation is in the selected pipeline. Without a pipeline, the instruction applies to all conversations.
Usage examples:
- Leads Baru pipeline: focus on qualification and education.
- Menunggu Pembayaran pipeline: remind about the deadline and how to pay.
- Pelanggan Lama pipeline: greet as a loyal customer, offer a repeat order program.
Each instruction is shown to the AI as “title: content”, so the title is read by the AI too. Give it a clear title (max. 100 characters), for example “Pipeline Menunggu Pembayaran – Reminder”. Both title and content must be filled in, otherwise the instruction is skipped.
Splitting replies into multiple bubbles (###)
To send an answer as several chat messages, put a separator on its own line between the parts. In the editor, click the bubble button, or type ### alone on a line.
- Works in all AI Behavior fields (Welcome Message, Communication Style, Conversation Flow, Rules & Restriction, Additional Instructions) and in Knowledge Text and answer examples.
- In Behavior and Knowledge, this is an instruction for the AI: wherever it finds a separator, the AI keeps it in the reply, and the system then sends each part as a separate message.
- In the Welcome Message, the separator splits the greeting into several messages on chat channels. In the website live chat widget, the greeting appears as a single message.
- Only a line containing
###alone becomes a separator.### Titlefollowed by text is a normal heading. - Avoid writing
###in the middle of a sentence. Every###in the AI’s final reply will split the message.
Relationship with AI Actions & Routing
Transferring to a Human Agent, applying labels, and moving pipelines are configured in AI Actions & Routing, not in Behavior.
- In Behavior, just set what the AI says before or during a handoff. Example: “Tell the customer that an admin will help shortly.”
- In AI Actions & Routing, set when the action happens:
- Keywords for clear requests, for example “admin”, “refund”, “komplain”.
- Prompt for conditions that need context, for example “the customer has sent complete order data and confirmed the order”.
- Number Of Message as a safeguard so that overly long conversations still reach a human.
- Agent Transfer only allows one condition per trigger type (Prompt, Keywords, Number Of Message), so a maximum of 3 conditions.
- For handoff to a specific team/division, see Handoff to a Specific Team/Division via Prompt.
3. Knowledge Base Writing Format
How the Knowledge Base is read
When you save, each source is split into several pieces and stored for searching. When a question comes in, the AI only retrieves the chunks whose meaning is closest to the customer’s message (see How the AI uses both).
- Text: chunks of about 1,000 characters, with a slight overlap between chunks. Splitting happens at blank lines first, then line breaks, then spaces. Headings are not used as split points, so a heading can be separated from the content below it.
- Tab title: each Text tab is stored separately, and its tab title is added at the top of every chunk from that tab. Give tabs clear, specific names.
- Search by meaning: chunks are matched to the customer’s message by similarity of meaning. Use the words your customers use.
Choose the right source
| Type | Best for | Notes |
|---|---|---|
| Text | SOPs, policies, business profile, general info | Most flexible; use one tab per topic |
| QnA | Frequently repeated questions with standard answers | One question, one answer. Each pair is stored as one entry, and the AI finds it through similarity to the customer’s message, not an exact match |
| Product | Catalog, prices, weight, variants | Manage the data in the Product feature so there is a single source of truth |
| Website | Content that already exists on your website | Retrain after the website is updated |
| File | Existing documents | PDF only, and the text must be selectable (can be highlighted). Images and scans are not read. Line breaks are flattened, so use Text for tables and price lists |
Rules for writing Knowledge Text
One tab = one topic. Example tabs:
Profil & Kontak,Produk & Harga,Pengiriman & Pembayaran,Kebijakan Retur,Promo Aktif,FAQ.Separate each item with a blank line and keep each item short (well under about 1,000 characters). Headings and subheadings help you and your team read the text, but the AI may receive a chunk without its heading, so don’t rely on the heading alone to explain a line.
Every chunk must stand on its own. State the full product/service name on every line, and don’t use pronouns.
- ❌
Harganya Rp250.000 dan tersedia 3 warna. - ✅
Harga Sepatu Lari AeroRun: Rp250.000. Warna AeroRun: hitam, putih, navy.
- ❌
Use a key–value format for data, not paragraphs, and repeat the item name on every line.
### Paket Belajar Intensif SMA - Harga Paket Belajar Intensif SMA: Rp1.200.000/bulan - Jadwal Paket Belajar Intensif SMA: Senin, Rabu, Jumat, 16.00–18.00 - Kapasitas Paket Belajar Intensif SMA: maks. 8 siswa per kelasAvoid wide tables. If a chunk is separated from its table header, the AI may misread the columns. Convert tables into a per-item list.
Write synonyms and customer terms. Example:
Ongkos kirim (ongkir),Uang muka (DP),Cicilan / kredit / angsuran.State the validity period for promos and temporary prices:
Promo berlaku 1–31 Oktober 2026. Delete promos that have ended.Don’t have conflicting information between tabs or sources (Text vs Product vs Website).
To send media, write the URL along with when to send it:
Kirim gambar panduan ukuran berikut jika pelanggan menanyakan ukuran atau size chart: https://contoh.com/size-chart.jpgSplit replies into multiple bubbles with
###on its own line between the parts if an answer needs to be sent in stages (see “Splitting replies into multiple bubbles” in section 2).
Rules for writing QnA
- Write questions the way customers ask them, not in internal language. The question text is also searched by the AI, so questions that resemble customer messages are easier to find.
- Answers should be 1–3 sentences and complete without needing other context. Long entries (more than about 1,000 characters) are split into several pieces, and later pieces lose their question.
- Create separate entries for questions with different intents, even if they look similar.
4. Supporting Settings (AI Configuration)
| Setting | Recommendation |
|---|---|
| AI Model | Auto if unsure. Advanced for calculations, image analysis, and tools |
| AI Creativity Level | Consistent for prices, policies, healthcare, and finance. Balanced for general sales |
| Message Await | 10–15 seconds if customers often send many short messages in a row |
| AI History Limit | Increase it if your ordering/registration flow is long |
| AI Context Limit | Sets how many Knowledge Base chunks are searched per question (default 50, with a maximum of 60 used). Only the best 20 or so chunks reach the AI, so if the AI still misses information, improve how your Knowledge Base is written rather than just raising this number. Do not set it to 0: no Knowledge Base content will be retrieved |
5. Test Before Saving
- Prepare 10–20 test questions from real customer chats: prices, promos, complaints, off-topic questions, and questions whose answers are not in the Knowledge Base.
- Test in the Preview panel. Preview uses your latest settings, including unsaved ones.
- To test Additional Instructions, select a pipeline in Preview.
- Check whether the AI: answers according to the Knowledge Base, doesn’t make things up, uses the right language style, and triggers handoffs/labels correctly.
- Click Save. If the results get worse, roll back through Version History.
Quick checklist before Save
- No
[...]placeholders left behind - No fact written in two different places
- No behavior rules in the Knowledge Base
- No two instructions that contradict each other (or the exception is written explicitly)
- All promos have a validity period
- Every field is under its character limit
- Handoff conditions are set in AI Actions & Routing
6. Character Limits
| Field | Limit |
|---|---|
| Welcome Message | 5,000 characters |
| Communication Style | 5,000 characters |
| Conversation Flow | 8,000 characters |
| Rules & Restriction | 3,000 characters |
| Additional Instructions | Title 100, content 2,000 characters (max. 30 instructions) |
| Prompt conditions (AI Actions & Routing) | 1,000 characters |
The dashboard enforces these limits as you type. AI Agents migrated from the old interface may already have a longer Conversation Flow, because long legacy prompts are carried over as-is.
If You Are Still Using the Old Interface
In the old interface, all instructions live in a single AI Agent Behavior field. Use the same order so it is easy to migrate later:
### Identity & Communication Style
(contents like Communication Style)
### Rules
(contents like Rules & Restriction)
### Conversation Flow
(contents like Conversation Flow)
When migrating to the new interface, copy each section into the matching field. See Migrating to the New AI Agent.