XIII · Cognition & IntrospectionExperimental·

Subject-First Agent Architecture (ENA Stateful Core)

also known as ENA Stateful Core, State-First Agent, Inverted-LLM-Control

Invert the LLM-centric pipeline: the agent is a stateful subject whose decision logic chooses whether to invoke the LLM at all, treating the model as one tool among many.

This pattern helps complete certain larger patterns —

  • specialisesLLM as Periphery·Invert the typical LLM-in-the-middle architecture: a deterministic state machine and event store form the core; the LLM is restricted to edge tasks — input interpretation and output synthesis only.

Context

The dominant pattern: LLM at the center, state and tools as periphery — each request flows Context+Prompt → LLM → Action. The Russian Habr 2026 source proposes inverting this: agent state at the center, LLM as a tool the agent decides whether to call.

Problem

LLM-centric pipelines make every decision stochastic. The agent has no way to 'stay silent' on routine queries where its current state already answers the question. Every request goes through the LLM even when the agent could answer from state. Differs from existing llm-as-periphery by being more specific: the *agent state-first decision logic* is the load-bearing concept.

Forces

  • LLM-centric pipelines are the SDK default.
  • State-first design requires bespoke control logic — not just framework configuration.
  • Not invoking the LLM means giving up flexibility on edge cases.

Example

A long-running personal assistant has stateful subject design. User asks 'what's my next meeting?' — decision logic checks state, finds the schedule in memory, responds directly without LLM (free, fast). User asks 'help me draft a follow-up email' — decision logic checks state, finds insufficient context, invokes LLM to draft. The LLM is called only when state is insufficient.

Diagram

Solution

Therefore:

Implement the agent as a stateful process. Internal state includes goals, history, confidence, conflict signals. Decision logic at each request: (a) does state suffice to respond? if yes, respond from state; (b) is there internal conflict warranting reflection? if yes, run hidden reasoning trace; (c) does the query need external information or generation? if yes, invoke LLM or tool. The LLM is one tool among many, not the central decision-maker. Pair with llm-as-periphery, stateless-reducer-agent, reflexive-metacognitive-agent, awareness.

What this pattern forbids. The LLM is invoked only when state-first decision logic decides it is needed; LLM is not the default decision-maker.

And the patterns that stand alongside it, or against it —

  • complementsStateless Reducer AgentDesign the agent as a pure function (state, event) → newState; entire execution history is held in an external event log; enables pause / resume / replay / time-travel without bespoke checkpointing.
  • complementsReflexive Metacognitive Agent·Agent maintains an explicit self-model of its own capabilities, confidence and limitations, and reasons over that model when accepting / refusing / handing off tasks.
  • complementsAwarenessMaintain the agent's explicit knowledge of its own tools, capabilities, environment, and current context as queryable state.
  • complementsMeditation Mode·Switch the agent into a bounded runtime mode where external I/O pauses but internal inference accelerates, with the tool surface collapsed to inner-only operations and output written to a private journal.

Neighbourhood

Click any neighbour to follow the language. Scroll to zoom, drag to pan.