10 Exploring the cognitive agent that thinks, monitors, and adapts
The chapter introduces cognitive agents as a practical response to the limits of stacking reasoning patterns alone. It argues that agents can be skilled at reasoning yet still fail in predictable ways—such as giving confidently wrong answers, repeating the same unsuccessful approach, sticking to a rigid plan, overcommitting when they lack knowledge, or failing to compose multiple tools into a useful workflow. The key idea is to move from isolated reasoning tricks to an architecture that can decide what kind of thinking a task needs, monitor whether that thinking is working, and adapt when it is not.
To do that, the chapter defines cognition as the agent’s ability to build and revise an internal task model, and metacognition as the ability to assess its own thinking in real time. It maps these ideas to a modular architecture inspired by Society of Mind, Global Workspace Theory, and System 1/System 2 thinking. A shared workspace holds task state, confidence, intermediate results, and signals, while specialized modules handle perception, planning, execution, evaluation, attention, and memory. The result is an agent that can classify tasks, choose among strategies like direct answering, decomposition, exploration, or hypothesis testing, and use memory to inform future decisions.
The chapter then shows how this architecture becomes production-ready through monitoring and control mechanisms. The evaluation module checks evidence quality, detects contradictions, and watches for stagnation; the attention module routes control based on those signals; the confidence gate prevents unsupported answers; and the memory module records both successes and failures in a structured knowledge graph. Together, these components create emergent behaviors such as curiosity, adaptive persistence, selective depth, and graceful degradation. The overall message is that more capable agents come not from bigger models alone, but from modular systems that can reason, monitor, remember, and adapt in concert.
The five production agent failure modes mapped to cognitive and metacognitive deficits.
Cognitive primitives versus cognitive architecture, where the reasoning primitives become a selection within the process.
Three theoretical foundations of the mind mapped to agent architecture components
The Cognitive Agent Architecture shows the flow from user/initial query to the cognitive loop, which iterates and processes through the modules.
Planning Module strategy selection.
Attention routing decision tree.
The Memory Module’s three behaviors layered on the MCP memory server.
The cognitive loop layered on the agentic loop.
Summary
- Individual reasoning patterns (CoT, ReAct, ToT, Reflexion) are cognitive primitives. Composing them into a unified architecture produces qualitatively different behavior that starts to look general rather than narrow.
- Cognition in agent terms means the quality of the agent’s internal model of the task: can it decompose novel problems, reason about dependencies, compose tools in new ways, and update its understanding as new information arrives?
- Metacognition means the agent’s ability to monitor its own reasoning: does it know when it is confident vs. guessing? Does it detect when it is stuck? Does it recognize the boundaries of its own knowledge?
- The Cognitive Agent Architecture draws on three theoretical foundations: Minsky’s Society of Mind (intelligence as interaction between specialized modules), Baars’ Global Workspace (shared state that modules compete to influence), and Kahneman’s System 1/System 2 (routing queries to appropriate depth of processing).
- The architecture has six core components: a Cognitive Workspace (shared state), and five modules – Perception (understanding the problem), Planning (selecting strategy), Execution (acting on the plan), Evaluation (metacognitive monitoring), and Attention (dynamic routing between modules). A seventh component, the Memory Module, provides persistent long-term memory via the official @modelcontextprotocol/server-memory knowledge graph.
- The MCP memory server’s knowledge graph stores problem types as entities, successful strategies as observations, and structural relationships between related problems as relations. The memory module wraps these primitives with proactive retrieval (checking past experience before planning) and experience recording (logging outcomes after evaluation), creating a persistent learning loop.
- Emergent behaviors arise without being explicitly programmed: curiosity, adaptive persistence, selective depth, and graceful degradation. The knowledge graph amplifies these behaviors over time as the agent accumulates experience.
- Metacognitive monitoring – specifically confidence-gated execution, stagnation detection, and knowledge boundary awareness – is the most valuable production capability because it prevents confidently wrong answers.
- The cognitive architecture extends the agentic loop by enriching what happens inside each iteration. The memory knowledge graph persists learning across sessions, turning individual problem-solving into cumulative institutional knowledge.
- The path to more general agents is architectural, not just parametric. Modular cognitive architectures where reasoning, monitoring, memory, and adaptation are separate concerns provide a framework for incremental improvement that pure prompting and model scaling do not.
AI Agents in Action, Second Edition ebook for free