to2d

A space for ideas, notes, and ongoing work.

State as Memory

Treating sessions and environments as controllable state spaces

Before modern agent systems existed, one idea kept appearing across every domain I worked in: systems behave predictably only when their "memory" is modeled as state, not history. This became a foundational shift — treating everything from browser sessions to physical environments as structured state spaces that can be navigated, controlled, and rewritten.

The difference between history and state

Most systems record their past: logs, screenshots, transcripts, event streams, timelines. But history is descriptive, not operational. It cannot drive control.

State is different.

State is the minimal representation needed to produce the next valid action. If you preserve only state and discard history, you get a system that is:

  • controllable
  • composable
  • predictable
  • reproducible

This insight — separating operational memory from historical noise — was the precursor to zero-context architecture and state-space LLM operators.

Early intuition: physical systems don't care how they got here

In control systems, a fundamental law is:

The system only depends on its current state, not its history.

Position, velocity, orientation — these are sufficient to determine behavior.

This idea transferred cleanly into software:

  • A browser session is just a state: DOM + cookies + storage + environment.
  • An onboarding workflow is a state: which steps are done, which remain.
  • A document extraction pipeline is a state: which fields are parsed, which are pending.
  • A compliance engine is a state: jurisdiction, employee data, rule applicability.

Once a system is represented as state, it becomes navigable.

Once it is navigable, it becomes controllable.

Modeling sessions as dynamic state spaces

Long before BrowserState existed, the early prototypes treated browser sessions as evolving state spaces — not as flat histories or APIs.

Core ideas:

  • a session is a phase point in a larger environment,
  • DOM + cookies define the current manifold the agent operates on,
  • navigation is a state transition, not a command,
  • automation becomes a graph traversal, not a script.

This view was extremely non-standard at the time, but it made automation stable in scenarios where traditional scripting collapsed.

Why state-space models outperformed procedural logic

Procedural automation asks:

"Given everything we've done so far, what should we do next?"

State-space automation asks:

"What is the current state, and what transition is valid?"

The second model avoids:

  • drift,
  • inconsistent actions,
  • history leakage,
  • brittle conditional logic,
  • multi-step collapse.

It also allows:

  • verification,
  • replayability,
  • deterministic control,
  • failure isolation.

This is why modern agentic architecture naturally fits state-space representation — the foundation was already laid.

State extraction as the real mechanism of control

A key piece of the early work was figuring out how to extract a canonical state from an environment that didn't provide one:

  • Sensors → normalized measurement frames
  • Browser DOM → actionable slice + interaction graph
  • Documents → structural regions
  • Workflows → dependency graphs
  • User intent → goal-state templates

This wasn't just data cleaning.
This was memory definition.

State had to be:

  • minimal
  • invariant
  • canonical
  • representation-stable
  • domain-pure

These constraints later resurfaced as zero-context: state without residue.

The conceptual jump: state as an operator boundary

Once a system is modeled as state:

  • operators become state transformers,
  • verification becomes checking state validity,
  • planning becomes state graph traversal,
  • correction loops become state rewrites.

This approach made it possible to build systems where:

  • failures are localized,
  • retries are meaningful,
  • transitions are finite and testable,
  • behavior is explainable.

This was the early articulation of the operator–verifier loop that defines modern agent design.

Why this matters today

Current agent frameworks still struggle with:

  • unstable context accumulation,
  • reliance on free-form history,
  • mixed-domain prompts,
  • drift across steps,
  • hidden internal memory.

State-as-memory eliminates these issues by making every step a pure function of the current state.

This is why:

  • BrowserState works,
  • zero-context planning works,
  • domain extraction works,
  • state-space operators work,
  • verifiable automation works.

The idea wasn't born with LLMs — it was present long before in the structure of how systems actually behave.

The principle in one sentence

History describes a system.
State controls it.

← Back to Research Before AI