Change your agent's behavior

Describe a new rule to the Agent Builder in plain words, check its test, answer its questions, test the change yourself and push it as a new commit.

UPDATED NOVEMBER 24, 20267 MIN READINCLUDES VIDEO

When your agent does something your business wants done differently, you tell the Agent Builder the new rule in plain words. The builder finds the parts of the agent's program that need to change, edits them, tests the result, and holds the edits as unsaved changes until you push them. You do not need to know how the program is written.

This page follows one change from start to finish. ACME Air decides that canceling a trip through the agent costs an extra $15 convenience fee, even when the ticket itself is free to cancel, and that the agent should tell travelers they can avoid the fee by canceling on the website or app.

Change your agent's behavior (85 seconds)
Transcript

Here, a customer asks what happens if they cancel a trip. The agent says there is no cancellation fee. Open the reasoning for that reply. Under Data, you can see why: the fee the agent worked out is zero. Suppose the business adds a $15 convenience fee for canceling through the agent. In Build mode, describe the new rule in plain words. The builder finds the parts of the program that need to change, edits them, and holds the edits as unsaved changes. Then it tests its own work with a live conversation, and tells you what it saw. The edits are not committed yet, but your next message already runs against them. So ask the same question again. The same question now gets the new answer: the fee, and how to avoid it. The reasoning confirms it. Under Data, the fee the agent worked out is now 15. Now say yes to the cancellation. In the trace, the fee is still 15, and Actions shows the agent updated a record: the rule was applied, not just quoted. When you are happy, click Push. That saves the change as a new commit. Nothing goes live until you make it live.

#Before you start

#Spot the behavior

  1. In the Apollo-1 Runtime pane, talk to the agent as a customer would, or open a thread from All threads. In the example, test caller Alex Morgan, a Gold member with booking ABC123 on flight AC1842 from Atlanta to Boston, asks: "What happens if I cancel my Boston trip?"
  2. Read the reply. The agent says there is no cancellation fee, which was right under the old rule.
  3. Click Reasoning under the reply to see what the agent looked up and decided, so you can describe the change precisely. See The Reasoning pane.
The current behavior: no fee for canceling this ticket.

#Describe the new rule in Build mode

  1. In the Agent Builder pane, click the mode button in the composer and choose Build. If you are in the middle of an unrelated session, click New session (+) first; a new session starts in Build.

  2. Describe the rule. Say what applies and when, give an example with numbers, say how the customer should hear it, and say what must not change:

    text
    Canceling a trip through this chat always adds a $15 convenience fee, even
    when the ticket itself is free to cancel. If the ticket's cancellation fee is
    $99, the total through the agent is $114. When you quote a cancellation, show
    the ticket fee, the $15 convenience fee and the total, and tell the traveler
    that canceling on the website or app avoids the $15. Flight changes keep
    their current pricing.
  3. Press ↵ or click the send button.

The builder also sees the conversation open in the middle pane, so you can refer to "this conversation" or "the last reply". To point at one specific reply, click Reasoning under it before you write: the builder then knows which turn you mean.

Describe the rule and what the customer should be told.

#Watch the builder work

The builder first restates what it is going to do, for example: "I'll make agent-assisted cancellations include the $15 convenience fee, show the full total, and explain that travelers can save $15 by canceling on the website or app." If that is not what you meant, send a correction straight away.

It then works through steps shown as rows, such as "Read 9 files", "Edited 7 files", a validation step that checks the program still holds together, and Live conversation while it tests. Click the arrow at the end of a row to see which files it read, what it changed, or the test conversation played back. As soon as it edits anything, an Unsaved changes chip appears beside the AGENT BUILDER heading, and the session takes a name from the builder, such as "Disclose cancellation convenience fees".

Each builder session runs in its own virtual machine on AUI's side, so the builder keeps working if you refresh, close the tab or lose your connection. A question for you, a live test conversation and a re-run of a turn pause until you reopen the session. To redirect the builder while it works, type a message: it reads it at its next step. To stop it, click the square stop button or press ⌘ .; edits already made are kept.

If a turn ends with a block headed Gates rejected the result, the builder's final checks found problems its edits introduced, and it is waiting for you; see If a turn ends with Gates rejected the result.

The builder reads, edits and tests the agent while you wait.

#Review its test conversation

A live test conversation opens in the Apollo-1 Runtime pane as a new thread started by the Agent Builder, running against your unsaved changes. When it finishes, the row reads "Ran a test conversation" and the builder reports what it saw. In the example, the agent quoted the $15 total, explained that the website or app avoids it, and recorded the fee separately from the refund once the traveler confirmed.

Read the replies yourself and open Reasoning on the important ones, looking for anything the builder did not mention. Here, the agent recorded the $15 as a separate payment rather than deducting it from the refund. If your business wants it deducted, say so in your answer to the builder's question or in your next message.

The builder's test conversation plays in the middle pane.

#Answer the builder's question

The builder may stop to ask you something on a card above the composer. Here it asks whether to rerun your original conversation from turn 2, where cancellation fees first came up.

  • Click Rerun from turn 2 to replay your conversation against the unsaved changes. The builder runs a copy of the thread from that turn and opens it in the middle pane; your original thread stays as it was.
  • Or type an instruction in Type your own answer..., for example "Deduct the $15 from the refund instead of recording a separate payment", and press ↵. The builder takes it as your answer.
  • Choose Not now if you would rather test it yourself.

See Answer the builder's questions.

Pick an option, type your own answer, or skip.

#Test it yourself

While the changes are unsaved, every conversation you have in the Playground runs against them. Customers keep getting the live commit.

  1. Click + at the top of the Apollo-1 Runtime pane to start a new thread.
  2. Pick a test caller, such as Alex Morgan, from Pick a test caller….
  3. Try the cases that matter to you, not only the one the builder tested. For this rule: a refundable trip, a ticket with a $99 cancellation fee (the total should be $114), a flight change (no convenience fee), and a traveler who says they will cancel on the website instead.
  4. Click Reasoning under each reply to confirm the fee comes from the new rule.

To replay an existing conversation instead, hover one of your messages and click Regenerate, or edit it and re-run it. See Edit and re-run a message.

For wider coverage, ask the builder, for example "Run the regression to check nothing else broke" or "Generate 10 conversations that target the cancellation fee in different variations". After a change to an existing agent, the builder runs these broader checks only when you ask. See Run a regression or an evaluation.

The conversation after the change; test your own cases before you push.

#Is a test conversation safe?

#Push the change

When the builder has finished and you are happy with the result:

  1. Look above the builder's composer for the Commit message field. The builder's suggested message is shown under it in quotes; hover it to read it all.
  2. Leave the field empty to use the suggestion, or type your own message, for example Add $15 convenience fee to cancellations made through the agent.
  3. Click Push, or press ↵ in the field.

Push is unavailable while the builder is still working. When the push succeeds, the bar turns green and reads Pushed with the new commit's tag, with a note that it is on its branch and not live. The session stays open, so you can keep refining and push again. For locked branches, conflicts with a teammate's push and other cases, see Unsaved changes and Push.

Use the suggested commit message or write your own.
Push saves the change as a new commit. Nothing goes live.

#Make it live

Pushing does not change what customers get. When the change is ready, open the Branches window from the branch pill, find the new commit and choose Make live. Customers then get exactly that commit until someone makes another one live. See Make a commit live, lock a branch, and roll back.

Was this article helpful?