TURN Notation Specification
1. Introduction
1.1 The Problem
Agent systems represent a new computational paradigm with unique characteristics: discrete temporal structure, bounded cognitive resources, probabilistic outputs, learning dynamics, and multi-agent coordination.
Existing notations fail to capture these dynamics:
| Notation | Designed For | Missing for Agents |
|---|---|---|
| UML Sequence | Object messaging | Cognitive cost, context capacity |
| BPMN | Business processes | Turn structure, learning loops |
| Petri Nets | Concurrency | Semantic opacity, readability |
| System Dynamics | Continuous feedback | Discrete turns, resource bounds |
| Music Notation | Temporal performance | Knowledge atoms, triggers |
1.2 The Solution
TURN adapts musical notation concepts to agent orchestration—staves become agent lanes, measures become turns, notes become cognition events, clefs declare knowledge context, and key signatures enforce constraints.
1.3 Goals
- Framework-agnostic — Express patterns independent of implementation
- Human-readable — Visual notation that communicates at a glance
- Machine-executable — Precise semantics for runtime interpretation
- Analytically useful — Enable comparison, benchmarking, optimization
- Pedagogically effective — Teach agent orchestration concepts
2. Design Principles
2.1 Turns as the Atomic Unit
The turn is the fundamental unit of agent time—an atomic reasoning episode where an agent receives input, processes it, and produces output. All temporal relationships are expressed relative to turn boundaries.
│ Turn N │ Turn N+1 │ Turn N+2 │
2.2 Cognition as a Consumable Resource
Agent reasoning consumes resources: tokens, time, money. TURN makes resource consumption visible through explicit notation, not hidden in implementation details.
2.3 Knowledge as First-Class
Knowledge atoms (data, decisions, constraints, observations) are first-class entities that define context, constrain behavior, and accumulate learning.
2.4 Agents as Musicians
TURN adopts the metaphor of orchestral performance:
- Composer — Writes requirements, defines orchestration patterns
- Conductor — Interprets requirements, directs sessions, handles dynamics
- Musicians — Execute their parts, respond to direction, provide feedback
- Score — The shared notation between all three roles
2.5 The Graph Watches Itself
Agent systems should be self-aware. The knowledge graph can trigger actuators, launch agents, and orchestrate responses based on its own state changes.
3. Core Primitives
3.1 Cognition Symbols
| Symbol | Name | Meaning | Typical Cost |
|---|---|---|---|
◉ | Expensive Cognition | Main agent reasoning turn | $$$ (Opus/Sonnet) |
○ | Cheap Cognition | Helper agent action | $ (Haiku) |
𝄽 | Rest | Waiting / no action | Free |
◐ | Partial Turn | Interrupted or truncated | Variable |
Main Agent: │ ◉ ◉ ◉ │ ◉ ◉ · │
Scout: │ ○ ○ · │ · · · │
3.2 Data Flow Symbols
| Symbol | Name | Meaning | Direction |
|---|---|---|---|
▷ | Inject/Write | Push data to target | Outbound |
◁ | Observe/Read | Pull data from source | Inbound |
■ | Output | Completed artifact | Terminal |
□ | Input | Received artifact | Initial |
◇ | Transform | Data transformation | Bidirectional |
3.3 Temporal Symbols
| Symbol | Name | Meaning |
|---|---|---|
│ | Turn Boundary | Single bar line, turn synchronization |
║ | Session Boundary | Double bar line, session start/end |
⟳ | Flywheel | Learning cycle / feedback loop |
⤳ | Handoff | Session-to-session transfer |
|: | Repeat Start | Begin iterative pattern |
:| | Repeat End | End iterative pattern |
3.4 Resource Symbols
| Symbol | Name | Meaning |
|---|---|---|
🔋 | Token Cost | Energy consumption indicator |
[██░░] | Capacity Bar | Context window fullness |
💭 | Thinking | Extended thinking budget |
⚡ | Burst | High-cost operation |
Main ◉ 🔋25 # Turn consumed 25 tokens
Context [████████░░] 80% # Context 80% full
Main ◉💭 🔋100 # Extended thinking, high cost
4. Score Structure
4.1 Tracks (Staves)
Each agent type occupies a horizontal track, analogous to a staff in musical notation:
┌─────────────┬────────┬────────┬────────┬────────┐
│ Track Label │ Turn 1 │ Turn 2 │ Turn 3 │ Turn 4 │
├─────────────┼────────┼────────┼────────┼────────┤
│ Scouts │ ○ ○ │ · │ ○ ○ │ · │
│ Main Agent │ · │ ◉ ◉ │ · │ ◉ │
│ Scribes │ · │ ○ │ · │ ○ │
│ Validators │ · │ · │ ○ ○ │ · │
└─────────────┴────────┴────────┴────────┴────────┘
Standard track ordering (top to bottom): Scouts, Lookouts, Speculators, Main Agent (highlighted), Scribes, Validators, Librarians.
4.2 Measures (Turns)
Vertical bar lines delimit turns. All events within a measure occur during that turn. Events are ordered left-to-right (causal/temporal sequence). Multiple events on the same track indicate parallel actions.
4.3 Score Header
Every TURN score begins with a header declaring context:
𝄞 [ExecutionAtom, ObservationAtom, CodeAtom] # Clef: atoms in scope
♯ConstraintAtom:no_hardcoded_secrets # Key: active constraints
♯PolicyAtom:security_review_required
4/100 tokens # Time: budget per turn
║: ... :║ # Score body
5. Semantic Extensions
5.1 Clefs (Atom Context)
The clef declares which knowledge atoms are in scope for a passage. Clef changes indicate context shifts:
𝄞 [RequirementAtom, CodeAtom] # Working on implementation
│ ◉ ◉ │ ◉ │
𝄞 [ObservationAtom, ConstraintAtom] # Now learning and constraining
│ ◉ ◉ ◉ │ ◉ ◉ │
5.2 Key Signatures (Constraints)
Key signatures declare active constraints and policies:
♯ConstraintAtom:layered_architecture # Sharp = active/enforced
♯ConstraintAtom:no_circular_deps
♭PolicyAtom:allow_external_apis # Flat = relaxed/disabled
♮ # Natural = constraints cleared
5.3 Time Signatures (Resource Budgets)
4/100 # 4 turns, 100 tokens total
∞/50 # Unlimited turns, 50 tokens per turn
8/200💭 # 8 turns, 200 tokens, thinking enabled
5.4 Dynamics (Cost Indicators)
| Dynamic | Meaning | Token Range |
|---|---|---|
pp | pianissimo | 1–5 tokens |
p | piano | 5–15 tokens |
mp | mezzo-piano | 15–30 tokens |
mf | mezzo-forte | 30–50 tokens |
f | forte | 50–100 tokens |
ff | fortissimo | 100+ tokens |
6. Actuators & Triggers
Actuators are what cause knowledge transformations. The graph doesn't mutate itself—something must act.
| Actuator | Symbol | Meaning |
|---|---|---|
| Agent | @agent | Explicit agent reasoning |
| System | @system | Automatic rule evaluation |
| Human | @human | Manual approval required |
| Schedule | @schedule | Time-based trigger |
| Trigger | @trigger | Graph self-mutation |
Actuators can compose as chords (parallel) or sequences (chained):
@chord [@agent: scout, @agent: lookout, @system: policy_check] ON turn_start
@sequence [@agent: scribe → @system: threshold_check → @human: review IF flagged] ON execution_complete
See the full TURN Trigger Language (TTL) specification for syntax, built-in triggers, and the TriggerEngine implementation.
7. Pattern Library
7.1 Scout Enrichment
Scout ○──◁──AKG ──▷── Main ◉──▷── ■
7.2 Continuous Validation
Main: │ ◉ ◉ ◉ │ · │ ◉ ◉ │
Validator: │ · │ ○◁Main │ · │ ← feedback
7.3 Flywheel Learning
|:
│ Main ◉──▷ ExecutionAtom │ # Execute
│ Scribe ○◁Main ──▷ ObservationAtom│ # Observe
│ @trigger: confidence≥0.9 → Constraint │ # Constrain
│ @schedule: daily → RouterAtom │ # Route
:|
7.4 Speculative Branching
Main: │ ◉ "considering A or B" │ ◉ decides A │
Speculator: │ ○ compute A path │ · │
Speculator: │ ○ compute B path │ · (discard) │
See the Helper Archetypes page for all six executable patterns.
8. Platform Mapping
TURN maps to multiple agent frameworks with varying fidelity:
| Platform | Score → ? | Track → ? | Turn → ? | Missing |
|---|---|---|---|---|
| ADAMAS | Native | Agent | Step | Nothing (native support) |
| LangChain | Chain | Agent | Call | Flywheel, atom clefs, triggers |
| CrewAI | Crew | Agent | Task | Constraints, sub-turn granularity |
| AutoGen | Conversation | Agent | Message | Resources, knowledge atoms |
9. Visual Rendering
TURN supports two rendering modes:
- TURN Score (static) — Rendered visual representation, analogous to sheet music. For documentation and design.
- TURN Runtime (live) — Real-time dashboard with playhead, WebSocket updates, and click-to-inspect symbols. See the Dashboard specification.
Renderers must support: track layout, measure grid, symbol rendering, color coding, animation (playhead), and interaction (click for details).
Appendix A: Complete Symbol Reference
| Symbol | Unicode | Name | Category |
|---|---|---|---|
| ◉ | U+25C9 | Fisheye | Expensive cognition |
| ○ | U+25CB | White circle | Cheap cognition |
| 𝄽 | U+1D13D | Musical rest | Rest/waiting |
| ▷ | U+25B7 | White triangle right | Inject/write |
| ◁ | U+25C1 | White triangle left | Observe/read |
| ■ | U+25A0 | Black square | Output |
| □ | U+25A1 | White square | Input |
| ◇ | U+25C7 | White diamond | Transform |
| │ | U+2502 | Box vertical | Turn boundary |
| ║ | U+2551 | Double vertical | Session boundary |
| ⟳ | U+27F3 | Clockwise arrow | Flywheel |
| ⤳ | U+2933 | Wave arrow right | Handoff |
| 𝄞 | U+1D11E | G clef | Atom context |
| ♯ | U+266F | Sharp | Active constraint |
| ♭ | U+266D | Flat | Relaxed constraint |
| ♮ | U+266E | Natural | Clear constraints |
Appendix B: Example Scores
Simple Implementation Pattern
TURN Score: Simple Implementation
Composer: RequirementAtom#req_001
𝄞 [RequirementAtom, CodeAtom]
♯code_review_required
8/200
║: Scout ○◁AKG │ Main ◉◉◉ │ Validator ○ │ Main ◉ ▷■ :║
Context: [░░░░░░░░░░] → [████████░░]
Tokens: 23 + 89 + 12 + 34 = 158/200 ✓
Flywheel Learning Pattern
TURN Score: Flywheel Learning
Composer: System
𝄞 [ExecutionAtom, ObservationAtom, ConstraintAtom, RouterAtom]
∞/∞ # Continuous operation
|:
Execute: │ Main ◉──▷ ExecutionAtom │
Observe: │ Scribe ○◁Main ▷Observation │
Constrain: │ @trigger: confidence≥0.9 │ → ConstraintAtom
Route: │ @schedule: daily │ → RouterAtom
:|
Flywheel iterations: ∞
Learning rate: ~3 observations/session → ~0.5 constraints/day
