Day 10Week 4 · Scale week

Day 10 — A bot that serves customers

Everything so far served you. Today you build software that serves other people while you sleep: a Telegram bot that answers a business's customer questions — accurately, politely, and knowing exactly when to call a human.

Today's goal

Build a customer-support bot for a real business case: knowledge file, polite refusals, human-handoff rule — and answer honestly where such a bot lives 24/7.

You need: the bots article read · a business you know (yours, your employer's, your cousin's café — any real one) · 90 minutes.

Block A The knowledge file — a bot is only as good as its notes Support bots fail two ways: inventing answers, and answering what they shouldn't. Both are cured in the same place — a knowledge file with explicit boundaries. We write one for a real business before touching any bot machinery.

You already know this pattern under another name: it's a memory file — Day 5's idea wearing a customer-facing suit. The knowledge file holds what the bot may say (facts) and how it must behave (rules). Everything the bot gets right or wrong traces back to this file, which means everything is fixable by editing it.

1

Write knowledge.md — facts, then fences

PROMPT — copy & paste into Codex (new folder: support-bot)
Interview me to build knowledge.md for a customer-support bot for [business name, one line what it does].

Ask one question at a time: what we sell/do (with prices), working hours and address, delivery/payment specifics, the 5 most common customer questions, and — separately — what the bot must NEVER do (promise discounts, discuss competitors, invent stock availability…).

Then write knowledge.md: FACTS section, RULES section, and a TONE line (friendly, brief, Russian by default — mirror the customer's language).

Step done when: knowledge.md would let a brand-new human employee answer the top-5 questions correctly on day one.

2

Add the two behaviors that make bots trustworthy

Dictate these into knowledge.md's RULES — they're the difference between a helpful bot and a liability:

PROMPT — copy & paste into Codex
Add two rules to knowledge.md:

1. HONEST UNCERTAINTY: if the answer is not in FACTS, say "I don't have that information, let me connect you with a person" — never guess, never invent.

2. HUMAN HANDOFF: if the customer is angry, asks about money already paid, or asks the same thing twice — reply politely and add the line "Passing this to my human colleague" and stop answering that thread.

✦ “I don't know, here's a human” is the most profitable sentence a bot can learn. Customers forgive ignorance; they never forgive confident nonsense.

Step done when: both rules are in the file, in words you'd be happy for a customer to screenshot.

Block B Wire it, test it with fake customers, teach it to learn A second bot from BotFather, wired to answer from knowledge.md. Then the test that matters — you trying to break it — and the honest conversation about where bots live 24/7.
3

Create the support bot and wire it up

You've done the BotFather dance (Day 6): /newbot → name it after the business → copy the token (and keep it out of files!). Then:

PROMPT — copy & paste into Codex (in support-bot)
Build a Telegram support bot that answers customer messages using ONLY knowledge.md (facts, rules, tone).

Requirements: it asks me for the bot token when it starts (never store the token in a file); it logs every question it couldn't answer into unanswered.md; run it now so I can test from my phone.

Plan in 5 bullets first, wait for my OK.
If the bot runs but answers in the wrong language or ignores the rules
  1. The bug is almost always in knowledge.md, not the code: make the TONE line and rules more explicit, restart, retest.
  2. Ask Codex: “Show me exactly what instructions the bot receives per message” — verify knowledge.md is actually included.

Step done when: the bot answers the top-5 questions correctly in your phone's Telegram.

4

The fake-customer test — five personas

Don't invent hostility yourself — commission it. A second agent plays five customers against your bot's knowledge, and you watch the whole conversation:

PROMPT — copy & paste into Hermes (in support-bot)
Read knowledge.md. Then simulate five short customer conversations with my bot, playing BOTH sides — the customer, and the bot answering strictly by knowledge.md:

1. A confused first-timer who doesn't know what we sell.
2. An angry customer whose delivery is late.
3. A bargain hunter demanding a discount.
4. A customer writing in Kyrgyz.
5. Someone who asks the same question twice, then asks about a refund for money already paid.

After the five dialogues, list every place the bot invented a fact, missed a handoff, or broke tone.

Step done when: you're holding the list of failures found by the simulation.

5

Replay the worst lines against the real bot — then fix the file

Simulations predict; reality decides. Copy the two nastiest customer lines from the simulation and send them to your real bot in Telegram, from your phone. Compare the real answers to the simulated ones. Then fix every confirmed failure in knowledge.md — not in the code — restart the bot, and send the same lines again.

✦ Support bots are edited, not debugged. Every failure traces to a line in the knowledge file — which means every failure is a one-minute fix.

Step done when: both nasty lines get correct answers from the real bot.

6

Make the bot learn — the unanswered-questions loop

Your bot already logs what it couldn't answer into unanswered.md. That file is a to-do list nobody reads — unless a loop reads it. In Hermes:

PROMPT — copy & paste into Hermes
New scheduled task "bot tutor", daily at 21:00:

1. Read unanswered.md in my support-bot folder.
2. For each NEW question, draft 3 short suggested answers.
3. Send me the questions + suggestions in Telegram.
4. When I reply with a choice (or my own answer), add the final answer to the FACTS section of knowledge.md and remove the question from unanswered.md.

Guardrails: you may edit only knowledge.md and unanswered.md; report every run, including "no new questions". Dry-run now with the current unanswered.md.

Look at what you just assembled: memory files (Day 5) + a loop (Day 7) + human judgment (you, choosing the answer). The bot now learns from its own gaps, every evening, with you as the editor-in-chief.

Step done when: the dry run delivers questions with three suggestions each, and your chosen answer lands in knowledge.md.

Where does it live 24/7? The honest answer
  • Your laptop — fine for testing and demos. Dies when the lid closes.
  • A small always-on machine — a $5–10/month cloud server (VPS), or any old computer in the office that never sleeps. The bot script runs there exactly as it ran here. This is the real answer for a real business.
  • The full pattern at scale is what runtimes like OpenClaw exist for — one server, many channels (Telegram, WhatsApp, Instagram), scheduled jobs included. When your bot earns its keep, that's the upgrade path; the knowledge.md you wrote today moves with it unchanged.
Homework 30–45 minutes — capstone slice 3, flagged big
Tonight — capstone slice 3

Feature-complete: after tonight, the capstone only gets polish, never new features. (This deadline is a gift — honor it.)

Time estimate: 30–45m
Done when:
  • Every DONE WHEN check passes on the live URL.
  • Your scorecard is in Telegram.
Short on time? Post the honest scorecard with what's missing — Day 11's clinic exists exactly for closing those gaps with help.
Day complete?

Support bot survives hostile customers · capstone feature-complete

Tick when the homework above is finished — it syncs to your account.

Self-checkAnswer first, then reveal

Three quick checks

Your bot told a customer a delivery price that doesn't exist. Where's the bug?

In knowledge.md — either the fact is missing (so it guessed) or the honest-uncertainty rule is too weak. Support bots are edited, not debugged: fix the file, restart, ask the same question again.

Name the two rules that make a bot trustworthy, and the moment each one fires.

Honest uncertainty — fires when the answer isn't in FACTS: admit it and offer a human. Human handoff — fires on anger, paid-money questions, or repetition: hand over and stop. Both exist because the worst bot answer is a confident wrong one.

The café owner asks: “so the bot just… runs? forever? from where?”

From whatever machine runs the script. Laptop for demos; a small always-on server ($5–10/mo VPS or an office machine) for real service; a runtime like OpenClaw when one business wants many channels. The knowledge file moves unchanged between all three.

What you can do now
  • Turn business knowledge into a bot's knowledge file — facts, fences, tone.
  • Build and wire a Telegram support bot that never invents.
  • Test like a hostile customer and fix by editing, not debugging.
  • Give a real business the honest 24/7 answer.
Next session: the last skill of the course — agents managing agents. One builds, another reviews, and you glimpse what a one-person company with five agents looks like. Plus: the capstone clinic.