How I stopped my n8n WhatsApp bot from inventing prices (the "LLM picks an ID" pattern)
Описание и применение
Бот WhatsApp на базе n8n теперь никогда не выдаёт вымышленные цены: LLM выбирает только ID FAQ, а ответы отправляются из заранее подготовленной таблицы.
Задача
An AI WhatsApp bot that directly outputs LLM responses can invent prices, warranties, or opening hours that do not exist, leading to misinformation for small businesses.
Результат
The bot now never invents prices; the worst case is a human answering, ensuring accurate information.
Рабочий процесс
- 1. Store FAQ in a table (Google Sheet or CSV) with columns id, question, keywords, answer.
- 2. On customer message, perform keyword scoring against FAQ; if a match is found, reply with the stored answer.
- 3. If no keyword match, send the question plus the list of FAQ ids and questions to the LLM and request only one id or null.
- 4. Validate the LLM response; if it is not an exact known id, treat as unknown.
- 5. If a valid id is returned, reply with the stored answer word‑for‑word.
- 6. If unknown, null, free text, or an API error occurs, hand off to a human: send a “staff member will reply” message to the customer, alert the owner via WhatsApp, and keep the bot silent until a human resumes the chat.
Доказательства
Most "AI WhatsApp bot" tutorials hand the customer's message to an LLM and send back whatever it writes. That works great in a demo and terribly for a real small business: the model will happily quote a price, a warranty, or an opening hour that does not exist.
I built a WhatsApp FAQ bot for small service businesses (the sample data is an aircon‑servicing company) and made one rule: the LLM never writes the reply.
Only when nothing matches, send the question plus the list of FAQ ids and questions to the LLM, and ask for one id or null, nothing else.
Validate: if the response is not exactly a known id, treat it as "unknown".
Send the stored answer for that id, word for word.
The result: the worst case is "a human answers", never "the bot made up a price".
- Дата записи: 2026-10-25T14:41:09.419Z