Cognitive units · Where open judgment lives in the stack
The cognitive unit in the system
In a Thoughtware system, cognitive units are where open judgments live, composed by agents, packaged in libraries, bounded by deterministic code, not ad hoc invoked from every feature.
9 min read
Cover for The cognitive unit in the systemReaders who followed the Shift and Decisions tracks know what judgment is and how to sort it. The next question is architectural: where does delegated judgment live in a running system?
Not in the model. Not in the chat transcript. Not scattered across middleware. It lives in cognitive units, callable contracts that agents invoke, libraries publish, and evaluation measures. This page is the system picture for readers who want the map before the formal definition, or who arrived from Thoughtware at a glance and need the cognitive unit track to land.
Helpful context: Thoughtware at a glance names the major parts. What is a cognitive unit is the formal definition. Defer there for contract fields and rings. This page is the Intro chapter bridge.
The stack
An agent owns a goal and a loop, deciding what work to undertake next. cognitive units own individual open judgments, the assess, interpret, critique, and recommend steps inside that loop. Deterministic code enforces closed decisions, validates schemas, applies patches, and records audit trails. Memory supplies context, endorsed knowledge, experience, and working state with write policy. Evaluation binds behaviour evidence to named cognitive units identity. Libraries publish cognitive units so teams share judgment without copying prompts. None of these parts replaces the others. Collapsing them is how demos become unmaintainable systems.
In the Weekly Meal Companion, the outcome is helping a household create an accepted weekly dinner plan. The Meal Planning Agent owns the goal and the loop. Deterministic code enforces allergies, portions, patches, and purchase gates. cognitive units own the open judgments in between.
| Library | cognitive units (examples) |
|---|---|
| Agent-private | InterpretWeek, ComposeWeek, CritiquePlan |
| Meal-planning domain | GenerateCandidates, AssessMealPracticality, RecommendMealSubstitution |
| Organisational | AskTargetedQuestion |
| Judge | JudgeWeeklyVariety, JudgeWeekdayPracticality, JudgeHouseholdFit, JudgeLocalRepairQuality |
The agent strategy decides when to call which cognitive unit. It does not absorb their judgments into one prompt. Libraries let teams share and substitute cognitive units without copying templates into every service.
How the loop uses cognitive units
Feature code that secretly calls a model for "just this one check" recreates the pre-architecture world: no suite, no locality, no substitution. cognitive units are deliberate edges, checked into repos, versioned, evaluated, and listed in specs. When a new judgment appears in a product meeting, the response is to name the cognitive unit and state the open decision, declare the contract (inputs, returns, abstention, purity), place it in a library (agent-private, domain, organisational, or judge), wire evaluation and connect through agent strategy or deterministic preprocessing, and keep closed checks in code rather than smuggling arithmetic into the template. Ad hoc calls are technical debt that compound silently because they never appear on architecture diagrams.
The Meal Companion loop runs plan, act, observe, review, revise, repeat. cognitive units cluster at interpretive and evaluative steps. Deterministic code clusters at enforcement and persistence. A household asks to plan dinners for four, Tuesday and Thursday are busy, use spinach before Wednesday. The agent calls InterpretWeek, then domain cognitive units for candidates and practicality, then ComposeWeek and CritiquePlan. Judges run when the loop needs calibration, not on every iteration. AskTargetedQuestion fires only when missing information would materially change the plan, not for every ambiguity.
Human approval sits before purchase. Medical diet interpretation returns to the household. Those are not missing cognitive units, they are human judgment that remains by design.
Domain libraries are how organisations stop rediscovering the same judgment in every product. When AssessMealPracticality improves in the meal-planning library, every agent that calls it inherits the upgrade behind a stable name, if encapsulation discipline holds. See libraries of cognition for packaging rules. Judge libraries separate calibration from generation. CritiquePlan names weaknesses. Judge cognitive units score whether the week meets variety, practicality, and household-fit standards, without rewriting the plan inside the judge.
cognitive units alongside agents and Skills
A Skill performs a known capability by composing cognitive units and code, and it does not merge several open decisions into one primitive. An agent owns the goal and may act on the world after deterministic gates. A cognitive unit answers one question and stops. Confusing the three is the most common category error in intelligent system design. This page places cognitive units in the stack. Decide, perform, pursue names the composition responsibilities above a single edge.
Invoice intake mirrors the same structure: interpret exception, assess explanation credibility, recommend disposition, each a named cognitive units in domain and judge libraries. Date arithmetic and threshold comparison live in code. Escalation to a clerk fires when preferential policy is unset. The vocabulary transfers, and the scenario is interchangeable for teaching placement, not for replacing the Meal Companion as the default grounding reference.
cognitive units read memory through declared grants, not by inheriting entire application state. Context for this run, endorsed knowledge, experience packets, and working-state fields appear as typed inputs or injection policy. That boundary is what keeps purity levels honest. AskTargetedQuestion at reading level needs working-state context to know what is missing. AssessMealPracticality at sealed level does not silently pull unaudited chat transcript into the instruction position. Memory discipline is architectural, not a prompt engineering trick. See six forms of memory for the vocabulary.
System-level reliability emerges when named cognitive units publish figures and agents consume those figures when choosing combinator wrappers. An agent that always retries three times on every edge has not read the library warranties. An agent that never retries on a payment hold has ignored consequence. Evaluation is not a QA phase after launch, it is how the system knows what it is running. Evaluation is part of architecture develops that claim, and this page shows where the hooks attach in the Meal Companion map.
Human steps and system boundaries
Not every open judgment becomes a cognitive unit immediately, or ever. Medical diet interpretation in the Meal Companion returns to the household or a professional. Purchase approval stays human until policy grants otherwise. Those are named human steps in the system diagram, not gaps to fill with prompts. Drawing the map forces honesty: which judgments are delegated to cognition, which stay human by design, which closed checks live in code.
Agent strategy is code or configuration that consumes the same artifact humans review: which cognitive units exist, which libraries publish them, which guards run first, which stop conditions apply. When specs list only "the agent" without naming cognitive unit edges, implementation reverts to ad hoc prompts inside the loop. Thoughtware specification describes executable system artifacts, and this page shows cognitive units as nodes in that graph.
Readers on the Start here path may reach this page before the formal cognitive unit chapter. Return to what is a cognitive unit for contract fields, rings, and purity when writing declarations. This page orients. That page defines.
The Meal Companion stops when the plan meets the minimum sufficient loop: useful outcome, exact checks pass, material assumptions visible, authority respected, further iteration low value. cognitive units supply judgments. The agent decides when the loop stops, not each cognitive unit independently.
Drawing the Meal Companion map once per program, covering agent, libraries, cognitive units, shell, and memory, and updating when names change, is how teams keep architecture visible. Diagrams without named cognitive units are feature cartoons. Marking human-only steps on the system map in a distinct colour, purchase approval, medical deferral, preferential policy, lets readers see at a glance where cognition ends and consent begins.
What to do next
The system map starts with agent goals, cognitive unit libraries, the deterministic shell, and memory forms. Every open judgment in the outcome gets either a cognitive unit home or a declared human step. Anonymous model calls in feature code give way to named invocations and contracts. The formal definition in what is a cognitive unit covers contract fields, rings, and purity for writing declarations.
See deterministic code beside cognition and decide, perform, pursue.
Read next: Deterministic code beside cognition.