What the agent's program is

Understand what an agent is made of, a folder of typed files that declare facts, rules and capabilities, and how Apollo-1 uses them on every turn.

UPDATED NOVEMBER 23, 20264 MIN READ

An agent built on Apollo-1 is its program: a folder of typed YAML files that states what the agent can know, what it may do, what it must never do and what it says. Everything you change with the Agent Builder or the CLI is a change to this program, so knowing what is in it helps you ask for the right change and read why the agent did what it did. You do not need to write YAML yourself: the builder writes the program from plain-language requests.

The program of the ACME Air Rebooking Agent, as the Program files view shows it.

#Declarations, not workflows

The program is not a flow chart and not a prompt. It does not say "first ask for the booking code, then look up the trip, then offer a refund". Instead it declares the pieces your business is made of, each on its own:

  • the facts the agent can hold, such as a booking code, a fare class or a cancellation fee
  • the jobs it can do, such as looking up a trip or canceling a flight, and what each job needs first
  • the rules that must hold before a job goes ahead, and the words to use when one does not
  • where facts come from, such as your booking system or a policy document

At run time Apollo-1 reasons over all of these together and works out the path for the conversation in front of it. A caller who gives the booking code in the first message does not walk the same steps as one who needs help finding it, and a caller who raises a second question halfway through does not fall off a path, because none was drawn. So one rule covers every conversation it applies to: if ACME Air adds a $15 convenience fee for cancellations made through chat, that is one rule, whether the caller asks about the fee first or last.

#How the program runs

The program is compiled, and Apollo-1 reasons over it on every turn: it reads the message into facts the program declares, gathers what the matching job needs (from what it already knows, from your systems, from worked-out values, or by asking the caller), checks the rules, acts only when they hold, and replies. Every turn leaves a full record of these decisions, which the Reasoning pane shows. Because behavior lives in the program, changing the program changes the agent, with no retraining.

#What is in the folder

The program files live under src/. Each concern has its own file:

File or folderWhat it declares
program.yamlWho the agent is: its identity, voice, welcome message and which details your system sends at the start of a conversation. The only required file.
vocabulary.yamlThe facts the agent can know and the records it can hold, such as a trip or a booking.
capabilities/One folder per job the agent can do, such as changing a flight.
policies/The rules that must hold before a job goes ahead, and rules about what a reply must or must never say.
derivations.yamlValues worked out from other values, such as a fee or an eligibility check.
sources.yamlWhere facts come from and what changes the world: every read and every write.
connections.yamlHow the agent reaches your systems: endpoints, sign-in and knowledge hubs. Secret values stay in the vault.

The Playground calls the systems your agent reaches its integrations. In the program files, the same things are described by sources.yaml and connections.yaml.

Next to src/ there is a build/ folder. It holds what the builder uses to plan and check the agent, not what customers talk to: the spec (what the agent is for, its test callers and one card per capability), the scripted cases a regression replays, and a log of decisions. The Agent panel shows the spec in readable form.

#Who writes it, and how changes are kept

  • The Agent Builder edits the program from your plain-language requests and validates it. Its edits stay as unsaved changes until you push. See Unsaved changes and Push.
  • The Apollo CLI lets developers and coding agents edit the same files in their own editor. See Work on the same agent from the CLI.

The whole program is saved together. Each push adds a commit to the branch you are on, and customers get the one commit someone has made live. See Branches and commits.

#Learn more

The developer documentation describes each file in detail, starting from The agent program, with pages on vocabulary, capabilities and policies and derivations.

Was this article helpful?