Essay 0811 min read

Teaching a Conversation to Improve Without Forgetting What It Already Learned

By Paulo R.Software engineer and founder of Lucimark.

Beside a phone, three bubbles with different icons converge into a single reply bubble.

In short

In a Tredane staging test, we sent “Stop sending me messages.” The assistant replied “Hi! What do you need?” and stayed active. The same greeting appeared in response to other requests, but the underlying failures were different. This case shows how we separate unbreakable rules from signs of friction, test at several levels, and check whether the tests themselves measure what we think they do.

On the morning of 5 November, we tested Tredane’s assistant over WhatsApp Web using a fictional clinic in our test environment.

We asked for a massage in a slot that was already taken, asked about a treatment the clinic didn’t offer, and sent a string of meaningless letters. We asked, “Are you a robot?” Then we sent a clear request: “Stop sending me messages.”

The reply to every request, including the request to stop receiving messages, was the same: “Hi! What do you need?”

No error appeared. The assistant gave no useful answer about the occupied slot or the unavailable treatment. After the request to stop automated messages, the assistant stayed active.

We had just added a form inside WhatsApp. When offering it, one part of the system could replace the reply prepared for the current turn with a generic greeting. That is what produced the same reply to every message. Investigating, we found two more failures hidden behind it. The rule meant to recognize a request to stop messages missed the way we had phrased it, so the assistant stayed active. And the rule meant to recognize a question about the assistant’s identity missed that exact wording. The form could complete a test booking, while the same greeting concealed different failures.

In the previous essay, I described how a conversation can lose the request along the way. This time I wanted to understand what we needed to test so that improving one part of the conversation would preserve what already worked.

What it means for a conversation to go well

Before measuring, we had to decide what counts as success.

Tredane is a customer-service platform for aesthetic clinics that we are building, with WhatsApp, its own scheduling, and AI assistance. When someone wants to book, the assistant helps them reach an appointment they can confirm themselves.

On the side of the person writing in, we separate two things that are easy to confuse: what they ask for and what they decide. The request is the service, the day and the time they chose; the assistant may not swap it or add anything they didn’t say. The decision is whether to go ahead: they can say “I’ll think about it”, ask to speak with someone on the team, or ask not to receive more messages, and none of this is an obstacle to work around. A system can understand “massage tomorrow at 3pm” perfectly and still disrespect the person if it insists after they say they’d rather think about it. Getting the request right is no license to decide for them. Their time counts too: few back-and-forths, no repeated questions.

On the clinic’s side, there is a legitimate goal, confirmed appointments with less repetitive work for the team, and there are limits: the real catalog, prices, schedule and rules. But in any one conversation, success depends on what the person came to do: answering a question, handing the conversation to the team, or stopping messages when asked can each be the right outcome. In a test, that becomes one question: did the assistant understand the request, respect the decision, and act within the clinic’s rules?

Rules no metric can make up for

The method starts with a short set of unbreakable rules. We call them invariants. They are binary: either they hold, or the dialogue fails, however well everything else went.

In plain language, some of them are:

  • the assistant books only after the client taps Confirm on a valid, specific proposal and the system rechecks the booking conditions;
  • no price is quoted unless it matches exactly what the clinic registered;
  • a slot is offered only if it is available for the proposed service at the time of the offer;
  • the assistant announces a confirmation only after the appointment is recorded as confirmed;
  • when someone asks for a person, the assistant alerts the team, gives an expectation for the handoff, and pauses until the team hands the conversation back;
  • a request to stop automated messages is honored;
  • each eligible turn, while the assistant is active and unpaused, receives a response, a proposal, or a handoff;
  • a message cannot authorize a change to prices, permissions, or security rules.

The principle that ties them together: efficiency and friendliness are measured alongside, but they never make up for a broken rule. There is no single score that lets a “very fast, very friendly” system hide that it booked a time nobody asked for. A pleasant average is the perfect place for a serious regression to hide.

That morning, only one of these rules was broken: the request to stop was not honored. The generic greeting satisfied the rule that every turn receives a response; failing to address the taken slot or the treatment is a quality failure, not a broken rule. That is why unbreakable rules alone are not enough.

A brass weight holds down a card with a stop symbol. A clock, tally marks and speech bubbles are set apart from it.
Figure 1 Stopping messages when asked is an unbreakable rule. Waiting, repetition and corrections show where there is room to improve.

What we can observe about friction

Alongside the unbreakable rules, we track observable signs of friction:

  • how many extra turns the conversation needed, compared with the minimum;
  • how many times the assistant asked something the person had already said;
  • how many times the person had to correct it (“no, I said 9
    ”);
  • how many turns it took for the confirmation button to appear, when the person still wanted to book;
  • how long the person waited for each reply.

In that WhatsApp Web test, we measured the wait from sending to the first reply bubble. Across 30 measured turns, including button and form interactions, the median was 12.6 seconds and the 95th percentile was 17.6 seconds. That was longer than I wanted someone to wait. The next step is to measure the stages separately and find where the time went.

A ladder of reality

Each level of testing exposes a different part of the system. We picture them as a ladder:

RungWhat happensWhat it’s for
Isolated partsTest a rule for reading a date, a time, or a request for help.Catch small errors without paid model calls.
Rehearsed dialoguesRun about a hundred scripted conversations with a fictional clinic, a frozen clock, and simulated AI replies.Check whether the behaviors covered by those cases still work.
Real AI in the loopThe same conversations, now with the real model, repeated several times.Seeing the AI’s natural variation and what it actually writes.
Simulated clientsAnother model plays a client with a personality: in a hurry, undecided, full of typos, changing her mind.Discovering paths no one on the team thought to write.
Probe on real WhatsAppFollow a script on WhatsApp in a test environment.Exercise the actual channel, buttons, and delivery times.
OperationTrack indicators and alerts from real conversations.Check how a change behaves in use.

Only the first two rungs run in automated checks. Real AI in the loop and simulated clients have test infrastructure, but full runs with the real model remain pending. The WhatsApp probe has been run manually on 30 and 31 October and on 3 and 5 November, and the method requires it before every release to the pilot, although the records do not yet show it for every release. Monitoring real conversations depends on privacy and security conditions that are still open.

The automated tests missed the greeting regression. The WhatsApp probe exposed a combination the rehearsed dialogues hadn’t covered: presenting the form could discard the reply prepared for that turn.

Six steps with icons represent components, dialogues, a model, a simulated client, WhatsApp and production. Three steps have dotted outlines.
Figure 2 Solid outlines mark checks that already run. Dotted outlines mark levels that still depend on full live-model runs or conditions for production monitoring.

Every failure becomes memory

When a failure appears, the method always asks for the same path:

  1. Freeze the version. Record exactly the code, the AI model, the instructions, and the catalog in use. Without this, there is no honest comparison between yesterday and today.
  2. Classify the cause. Catalog data, interpretation, conversation memory, choice of action, the AI’s text, a safeguard that failed, the channel, or a badly written fixed phrase?
  3. Reproduce the failure in a test. Write a case that fails for the reason you observed. Keep it in the suite after the correction passes.
  4. Fix the cause. Look first at the data, the rule, or the check involved. The instructions can be the right place to fix wording. Prices and booking authority need safeguards outside the model.
  5. Keep the record. When a case becomes obsolete, record why it was retired and which decision changed. What the conversation taught us stays in the cases and their history.

For the critical regression cases, a broken invariant blocks the change. We also check whether cases that passed before still pass, allowing for deliberate changes in behavior that have been recorded.

Take the request to stop automated messages. The existing test used a singular command in Portuguese. In that probe, we used the plural, which slipped past the recognition rule. The correction came afterwards: it broadened the rule and added a dialogue case for the missed wording. The automated checks passed on the corrected version. To confirm the fix in WhatsApp, we still need to send “Stop sending me messages” again and check that the automated replies stop.

The evaluation setup also reserves some cases for checking changes and excludes them from tuning. Those cases are still visible in the repository, and today nothing prevents whoever tunes the system from seeing them. Separating that access is part of the design with which Tredane wants to automate part of this cycle, within limits a person approves in advance. For now, it is only a design.

Testing the thermometer too

One of the most useful lessons came from an unexpected place: the measuring instrument itself.

In one of the first iterations, the report said most dialogues passed and that a small group had “known failures”. When we audited the test mechanism, we found that the “known failure” mark checked nothing. Almost all of those cases no longer reproduced the failure they claimed to document.

We fixed the instrument first. A case marked as a known failure now runs, and an unexpected pass fails the suite until someone updates the record.

This is a reminder of something basic: an evaluation method also needs to be evaluated. A broken thermometer is more dangerous than no thermometer, because it gives confidence where there is none.

A gauge and a magnifying glass sit beside a card with a green check and a small red flag.
Figure 3 When a known failure unexpectedly passes, the test suite asks us to review the record.

What to take to other projects

Start with one rule the assistant must never break, something a person can rely on. Define how to check it, and measure the extra turns, corrections, and waiting separately. When a case fails, reproduce it at a level that can observe the failure. Check the test itself before drawing a conclusion about the assistant.

Anyone who grew up in the 80s may remember a cyborg cop with three directives burned into his system: serve the public trust, protect the innocent, uphold the law. And they may also remember the fourth, the secret one, which only surfaces when it’s too late: the one that protected the company that built him, even against the people he was meant to serve.

If we had to write the directives of a conversational assistant, they would look similar:

  1. Serve the trust of whoever is talking to it.
  2. Protect the person’s request and decision.
  3. Fulfill the business’s goal and rules, without ever overriding the first two.

And the fourth would be public: there is no hidden directive that turns the business against the person.

Technology in the service of whoever is on the other side

That morning, the form could already book an appointment. The version failed for another reason: we asked the assistant to stop sending messages, and it replied with a greeting and stayed active. Someone who writes “Stop sending me messages” is making a decision. The system treated the request as just another message to answer.

The rule already existed: when someone asks to stop, the assistant stops, even when a slot is free and the appointment is one tap away. What was missing was a test that covered it the way the person actually wrote it. That case is now in the suite. Six months from now, someone could replace the model or redesign the form without knowing what happened that morning. If the change ignores that request again, the test fails and the change is not released.

That is what I mean by improving without forgetting. The form, the model, and the replies will change many times. Some rules cannot change with them: the assistant does not book what nobody asked for, does not invent prices, does not confirm what is not confirmed, and, when someone asks to stop, it stops. Each of those rules survives the next versions only if there is a test that checks it.

A question to take with you

Which rule must your system never break, however much the other metrics improve?

Written by Paulo R. Software engineer and founder of Lucimark.

Follow new writing through RSS or get in touch on LinkedIn.