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.
On this page
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.
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"| STFive rules follow.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Referenced by 09
- ProjectsAI marketing manager agent: Night Shift, on the Hermes runtimelinks here in its text
- ProjectsCognitive Ecology (book)lists this as related
- ConceptsAn ecology of mind and machinelinks here in its text
- ConceptsCognitive ecology for people and AI agentslinks here in its text
- ConceptsContext engineering for AI agentslinks here in its text
- ConceptsThe harness paradoxlinks here in its text
- ConceptsThe intelligence is in the orderinglinks here in its text
- ConceptsThe agentic organisationlinks here in its text
- ResearchLogical levels and the theory of types applied to AI agent goalslinks here in its text