ReactLines
Overview
ReactLines is a specification that defines a formal model for expressing, scoping, retrieving, and composing atomic behavioral policies for cognitive agents. Each ReactLine is a structured instruction with 11 fields encoding who should do what, when, why, and under what constraints.
The 11-Field Schema
| # | Field | Required | Description |
|---|---|---|---|
| 1 | id | Auto | Short unique identifier |
| 2 | name_token | Yes | Kebab-case reference token |
| 3 | scope | Yes | Hierarchical visibility level |
| 4 | priority | Yes | Conflict resolution weight (1–1000) |
| 5 | environment | No | Operational environment descriptor |
| 6 | context | No | Situational activation context |
| 7 | condition | Yes | Trigger condition (natural language) |
| 8 | action | Yes | Prescribed action (imperative) |
| 9 | outcome | No | Desired result from beneficiary's perspective |
| 10 | constraints | No | Structured limitations |
| 11 | actors | Yes | Participants (executor + beneficiary required) |
Six Scopes
| Scope | Lifetime | Example |
|---|---|---|
| TURN | Single message | Greeting, farewell |
| SESSION | Entire conversation | Tone maintenance |
| FLOW | Multi-step process | Onboarding steps |
| AGENT | All sessions for an agent | Persona, capabilities |
| ORG | All agents in org | Brand voice, compliance |
| GLOBAL | Universal | Safety, legal, ethics |
Scopes are totally ordered: TURN < SESSION < FLOW < AGENT < ORG < GLOBAL.
Abstract
LLM agents in production rely on monolithic system prompts for behavioral control — static, context-blind, non-composable, and tightly coupled to specific frameworks. This yields instruction bloat, attention dilution, and unpredictable behavior as rule sets grow.
ReactLines defines atomic procedural behavioral policies with an eleven-field typed schema and a six-level hierarchical scoping system with priority-based conflict resolution. Rules are retrieved at runtime via embedding similarity, applying the RAG paradigm to procedural memory rather than factual knowledge.
Contributions: (C1) formal specification with eleven-field typed schema; (C2) first hierarchical scoping system for agent behavioral rules; (C3) semantic retrieval protocol applying RAG to behavioral specifications; (C4) open-source reference implementation with empirical validation.
Citation
@software{pymut2026reactlines,
title={ReactLines: Atomic Procedural Memory Units for Cognitive Agents},
author={Timana, Joel and Munoz, Diana and Munoz, Alvaro},
year={2026},
url={https://github.com/Pymut/reactlines}
}
