Skip to main content

02.14Framework

Logical levels in agent design

Gregory Bateson's logical levels as AR Labs applies them to AI agent instructions: nested frames that each govern the level below, records kept outside.

Nested picture frames from company to task, each limiting the next; records sit outside in a separate cabinet the frames cite.Four nested picture frames, company context, role, goal and approach, each with an inward violet chevron to show limits passing inward. Inside the innermost sit a campaign, a routine and a task. Outside the frames stands a heavy filing cabinet of evidence, decisions, learnings and procedures, which the frames cite by dashed lines.COMPANY CONTEXTROLE FRAME: MANDATE AND AUTHORITYGOAL + HYPOTHESISAPPROACH + HYPOTHESISCAMPAIGNROUTINETASKENDS, REVIEWEDA CADENCEDONE OR NOTEVIDENCEDECISIONSLEARNINGSPROCEDURESSTORESA DIFFERENT TYPE,KEPT OUTSIDE THE FRAMESCITESCITESEACH FRAME STATES THE CHOICES, THE ERRORS AND HOW THE LEVEL BELOW MAY CHANGEAR LABSCONCEPTSC-05NESTED FRAMESSCALE NTS
On this page
  1. The problem
  2. What Bateson meant
  3. The framework
  4. What goes wrong when levels mix
  5. What exists today

Logical levels is a framework AR Labs uses to keep an AI agent's instructions coherent as they grow (an AI agent is a language model run in a loop with tools, so it can act, not only reply). Borrowed from the anthropologist and systems thinker Gregory Bateson, it arranges instructions as nested frames, where each frame tells the level below what choices it may make, what counts as an error, and how that level may be changed. Knowledge the agent holds, such as evidence and decisions, is kept outside the nesting and cited by it. The aim is an agent that always knows which rules apply, and that has a sanctioned way to say when two of them conflict.

The problem

Instructions for a long-running agent accumulate. A rule is added here, a clarification there, a new file when the old one gets crowded. When we counted everything our autonomous marketing agent read before saying a word, the size was modest. The problem was copies. One rule appeared in five files, each worded differently; the limits on what the agent could do without approval appeared in four; and its working-state file stored many findings that also lived elsewhere. On every turn the model was quietly reconciling several versions of the same instruction, written at different times by different authors.

A shorter prompt would not have fixed this. What was needed was a structure in which each rule has one home and the agent can tell from where it is which rules apply.

What Bateson meant

Bateson took the idea from Bertrand Russell and Alfred North Whitehead's theory of logical types in Principia Mathematica: a class is of a different type from its members, and a statement about statements sits one level above them. He developed it in essays collected in Steps to an Ecology of Mind (1972). Two of his findings changed our design.

Levels are orders of change, not categories of content. In "The Logical Categories of Learning and Communication" (1964), Bateson's Learning I is correcting a choice within a fixed set of alternatives. Learning II is changing the set itself, learning about kinds of context. He compared the series to position, velocity and acceleration. A stack of boxes labelled company, department, goal and task is a hierarchy of content; containment alone does not make a logical level.

A frame is a message. In "A Theory of Play and Fantasy" (1955), Bateson described monkeys at play. A playful nip resembles a bite but does not mean what a bite means, and that works only because the animals exchange a message about the other messages: this is play. He called what such a message sets up a frame. A picture frame tells the viewer to attend to what is inside it and not to the wallpaper outside. A frame tells the receiver how to read its contents.

The framework

Combining the two gives a test. A frame becomes a logical level when it states three things for the level below: the choices that level picks from, what counts as an error there, and how that level may be changed. A frame that only contains things is a folder.

FIG. 01
flowchart TD
  CC["Company context: the company's goals"] --> MK["Role frame: mandate and authority"]
  MK --> G["Goal: with a hypothesis judged from above"]
  G --> A["Approach: with a hypothesis judged from above"]
  A --> CA["Campaign"]
  A --> RO["Routine"]
  A --> TA["Task"]
  ST[("Stores: evidence, decisions, learnings, procedures")]
  G -.->|"cites"| ST
  CA -.->|"cites"| ST

Five rules follow.

  1. An inner frame cannot loosen the limits of the frame around it. A campaign cannot decide to publish without approval if the role frame says publishing needs a person's sign-off. Arthur Koestler's holons, wholes that are also parts and follow fixed rules while choosing flexible strategies, describe the same relation.
  2. Records are a different type from frames. Frames are messages about how to read and act; evidence, decisions, learnings and procedures are what gets read. Records live once, in stores outside the nesting. When a frame cites a record, the citation says what that record counts as for that frame, so the same finding can be a warning for one campaign and irrelevant to another without being copied.
  3. Each goal and approach carries a hypothesis, a stated claim that achieving it moves the level above, judged from the level above. A frame does not validate itself, for the same reason a class cannot be a member of itself.
  4. Work items sit side by side, not in a ladder. Under an approach, a campaign has an end and a review, a routine is a cadence with no end date, and a task is done or not done. They are different kinds of work.
  5. Stepping in drops detail, never premises. Entering a frame narrows what the agent needs in context, which gives an agent with limited memory progressive disclosure from the structure itself. But for Bateson, content has no meaning without its context, so a summary of every enclosing frame always stays loaded. Herbert Simon's work on near-decomposable systems and Stafford Beer's Viable System Model, in which higher levels work from summaries, support the same arrangement.

What goes wrong when levels mix

Level theory is most useful as a catalogue of failures to design against. The figure gives each of the five below a panel, with what the design does instead marked in violet.

Five panels of level-mixing failures, from a task piercing its goal frame to an agent boxed in by two rules, with a door to report the conflict upward.Five small panels. One: a task's arrow pierces the goal frame above it and is crossed out. Two: an arrow swings away from the goal's target to a gauge, a metric taken for the goal. Three: a learning document wears a dashed evidence badge it was never given. Four: a goal frame grading itself is crossed out, beside the fix, a level above judging it. Five: an agent boxed in by two conflicting instructions, with a door in the box labelled report the conflict.WHAT GOES WRONG WHEN LEVELS MIXAND WHAT THE DESIGN DOES INSTEAD1A TASK REWRITES ITS GOALGOALAPPROACHTASKa lower level may raise acontradiction; only the levelabove may act on it2A METRIC BECOMES THE GOALTHE GOALTHE NUMBERevidence turns into the target:the map taken for the territory(Goodhart's law)3A RECORD CHANGES TYPELEARNINGEVIDENCEa learning cited as evidence,a procedure read as a mandate:authority nobody gave it4A FRAME GRADES ITSELFGOALLEVEL ABOVEGOALa class cannot be a member of itself:each hypothesis is judged from above5CONTRADICTION WITH NO WAY OUTBE BOLDASK BEFORE POSTINGREPORT ITUPWARDthe trap is the missing exit, not the clash:the design gives the agent a channel
Five ways levels mix: a task rewriting its goal, a metric becoming the goal, a record changing type, a frame grading itself, and a contradiction with no way out.
  • A task rewriting a goal. A lower level may raise a contradiction; only the level above may act on it.
  • A metric becoming the goal. A number gathered as evidence becomes the thing pursued. Bateson would call this the map taken for the territory; engineers know it as Goodhart's law.
  • A record silently changing type. A learning cited as if it were evidence, or a procedure treated as a mandate, gains authority nobody gave it.
  • A frame grading its own success, the class as a member of itself.
  • Contradiction with no way out. Bateson's double bind, from the 1956 paper "Toward a Theory of Schizophrenia" that he wrote with Don Jackson, Jay Haley and John Weakland, turns on three injunctions: two at different levels that conflict, and a third that stops the person escaping the situation, including by commenting on the contradiction. The contradiction alone is not the trap; the lack of any way out is. An agent told both to be bold and never to post without approval is caught unless it has a sanctioned route to report the conflict. The design gives it one: a channel to raise the contradiction to the level above, which resolves it.

What exists today

This is a design. It was worked out for our autonomous marketing agent; implementation is deferred and nothing here has been built into the running agent. Open questions remain, including how short an enclosing frame's summary can get before the agent misreads what is inside it.

The framework connects our agent design back to its cognitive-science roots. Bateson is the central figure in cognitive ecology, and the rule that inner frames cannot loosen outer ones is the harness paradox stated as structure.