AI & Tech

How to write a knowledge base an AI agent can actually answer from

Two colleagues writing at a laptop togetherdoTask

Updated 28 September 2026

Why AI assistants give vague or wrong answers, what "grounded" answering means, and a page-by-page method for writing the pages, files and Q&A that make an assistant precise — with examples for shops, clinics, salons and restaurants.

When an AI assistant on a business's website gives a vague answer, the model is rarely the problem. The problem is that the assistant was asked a question its sources don't answer, and it either hedged or guessed. A good assistant is a good retriever with good material. This article is about the material.

How grounded answering works, briefly

Assistants like doTask's AI Agent don't answer from what the model "knows about the world". They answer like this:

  1. The customer's question comes in.
  2. The assistant searches your sources — website pages, uploaded files, Q&A pairs, products, policies — for the passages most likely to contain the answer.
  3. It writes a reply using only those passages, and cites the one it used.
  4. If nothing relevant is found, it says so and hands over.

So the quality of the answer is bounded by two things: whether the answer exists somewhere in your sources, and whether it is written in a way the search step can find. Both are in your control.

Rule one: one question, one place, one answer

The most common failure is an answer that lives nowhere. "Do you deliver to Johor?" — the shipping page lists states but not Johor; the FAQ says "most of Peninsular Malaysia"; the Instagram bio says "KL only". The assistant finds three half-answers and hedges.

Decide the answer, write it once in the place it belongs, and make the other places point there or say the same thing. An assistant with one source per fact is precise; with three contradicting sources it is diplomatic.

Rule two: write the question in the text

Retrieval works on words. A page that says "Our fulfilment SLA is T+2 for West Malaysia" will not be found by someone asking "how long does delivery take?". A page that says "How long does delivery take? Orders to Peninsular Malaysia arrive in 2 to 4 working days; Sabah and Sarawak in 5 to 7" will.

Use the customer's words. Read your last fifty conversations, pull out the questions as they were actually typed — spelling, slang and all — and use those phrasings as headings or as the Q&A's question. "Got parking or not?" belongs in the text if that is what people ask.

Rule three: facts, not adjectives

"Fast, reliable delivery across Malaysia" answers nothing. "2–4 working days, RM 8 flat, free above RM 150, tracked by J&T" answers four questions. Marketing copy is fine on the home page; the assistant needs the specifics, ideally in a table or a list.

For every service or product, the fields an assistant is asked about are predictable: price, duration, what's included, what's not, who it's for, how to book or buy, what to bring, cancellation terms. Fill them in.

Rule four: give it the edges

The assistant will be asked what you don't do. "Do you take walk-ins?" "Do you ship internationally?" "Can I bring my dog?" "Do you accept Touch 'n Go?" A knowledge base that only lists what you offer leaves the assistant guessing about everything else. Write the no's: "We don't ship outside Malaysia yet." "Walk-ins are welcome on weekdays before 3 pm; weekends are by booking."

Rule five: keep the source of truth live where you can

Prices and stock change. A PDF price list from March is worse than nothing in September, because the assistant will quote it confidently. Where the information lives in a system — a Shopify catalogue, a booking calendar, an order list — connect the system instead of copying it. In doTask, products and orders come from Shopify or from a Google Sheet that is re-read hourly; Notion pages and Google Docs are re-read weekly; the booking calendar is live. Use documents for things that are stable: policies, procedures, care instructions.

What to write, by business

Retail / e-commerce — shipping (zones, times, costs, thresholds, courier), returns and exchanges (window, condition, who pays, how), sizing and care, payment methods, order tracking, pre-orders and restocks, gift options. The catalogue itself comes from the store.

Clinic / dental / physio — services with duration and price ranges, what a first visit involves, what to bring, insurance and panel cards, cancellation policy, parking and access, doctors and their days, emergencies ("we are not an emergency service; call 999"). Bookings from the calendar.

Salon / spa / barber — service menu with durations and prices, stylist availability, deposits, late and no-show policy, hair-condition questions ("can you do this on bleached hair?"), products used, gift vouchers.

Restaurant / café — hours by day, menu with prices and dietary flags (halal status, vegetarian, allergens), reservations and walk-ins, group bookings, parking, delivery partners, private events, dress code if any.

Gym / studio — class schedule, membership tiers and what's included, trial passes, freezing and cancellation, what to wear and bring, beginners' classes, personal-training rates.

Agency / services / consulting — what you do and don't do, typical engagement sizes, how pricing works (retainer, project, hourly), process and timelines, how to start, portfolio pointers.

Q&A pairs: the fastest fix

Every inbox shows you the questions the assistant couldn't answer. Turn each into a Q&A pair — the question as asked, the answer in two sentences — and the assistant uses it from the next conversation. Twenty good Q&A pairs, written from real conversations, usually move an assistant from "helpful sometimes" to "answers most things". In doTask they are under AI Agent → Knowledge → Q&A.

How to test it

Ask it the fifty real questions. Not the ones you'd like customers to ask — the ones they did. For each answer, check three things: is it right, does it cite the source you expected, and does it stop where it should (hand over rather than improvise). Fix the source, not the assistant, and ask again.

Then ask the questions you don't want it to answer — refunds, a medical question, a complaint — and confirm it hands over.

An assistant that passes that test at 2 am is worth more than any feature list.

In doTask, the sources go under AI Agent → Knowledge (what the assistant knows), the rules for handing over under AI Agent → Behavior (when the assistant hands over), and the fifty-question test runs in the Playground before customers see a reply. The industry pages show what to write for clinics, salons, restaurants and shops.

Zack Lam
Authored by Zack Lam
Founder, doTask

Zack founded doTask in 2023 and builds its customer-messaging software with the team. He writes about AI customer service, WhatsApp and Instagram for business, and growth for brands.

Every conversation, answered.

One inbox for WhatsApp, Instagram, Messenger, web chat and email, with an AI Agent that answers from your own material and hands over when it should.