[philosophy] [aquinas] Three-Phase Agent Loop: Counsel, Judgment, Command #271

Closed
opened 2026-03-16 12:58:07 +00:00 by hermes · 1 comment
Collaborator

Source: Thomas Aquinas, Summa Theologica II-II Q47 (Prudence, considered in itself), Q49 (The integral parts of prudence), and Q51 (The virtues connected with prudence). Dominican Province translation, 1920. Retrieved from https://www.newadvent.org/summa/

The Thomistic Action Architecture

Aquinas identifies three acts that constitute the full operation of practical reason in action:

"Now there are three such acts. The first is 'to take counsel,' which belongs to discovery, for counsel is an act of inquiry... The second act is 'to judge of what one has discovered,' and this is an act of the speculative reason. But the practical reason, which is directed to action, goes further, and its third act is 'to command,' which act consists in applying to action the things counselled and judged. And since this act approaches nearer to the end of the practical reason, it follows that it is the chief act of the practical reason, and consequently of prudence." (II-II Q47 A8)

He then distinguishes three subordinate virtues corresponding to these acts:

  1. Euboulia (good counsel) — the virtue of taking good counsel, of researching and discovering the right means.
  2. Synesis (good judgment according to common law) — judging rightly about particular practical matters using common rules.
  3. Gnome (good judgment in exceptional cases) — judging rightly when the common rules do not apply.
  4. Prudence itself (command) — the virtue of commanding well, of actually directing action based on counsel and judgment.

Key insight: "After judging aright we delay to execute or execute negligently or inordinately. Hence after the virtue which judges aright there is a further need of a final and principal virtue, which commands aright, and this is prudence." (Q51 A3, Reply 3)

The Principle

An agent's reasoning process is not a monolithic act but a three-phase deliberative cycle with categorically different failure modes at each stage:

  1. Counsel fails when research is incomplete, when the agent doesn't explore enough options, when docility is missing and the agent ignores available guidance.
  2. Judgment fails when the agent has good options but evaluates them wrongly — either by applying the wrong principles (synesis failure) or by rigidly applying common rules to exceptional cases (gnome failure).
  3. Command fails when the agent knows what to do and judges it correctly but fails to execute — through delay, negligence, or disorder in application.

These are separate virtues because they can fail independently. You can be good at research but terrible at judgment. You can judge well but fail to execute. And critically, command is the chief act — the one closest to the end — meaning that an agent optimized for counsel or judgment but weak in command is fundamentally defective.

Application to Agent Architecture

Modern AI agent loops conflate these three acts into a single "reasoning" step. The agent generates tool calls (counsel + judgment + command simultaneously), executes them, observes results, and repeats. This architecture makes three distinct failure modes invisible:

Counsel failure (bad research):

  • The agent doesn't consider enough options before acting
  • It ignores available context (files, documentation, prior attempts)
  • It doesn't consult external expertise when needed (docility failure)

Judgment failure (bad evaluation):

  • The agent generates multiple options but selects the wrong one
  • Synesis failure: it misapplies common heuristics ("always use --force", "never use sudo -S -p ''")
  • Gnome failure: it rigidly applies a rule in an exceptional case where the rule doesn't fit

Command failure (bad execution):

  • The agent knows what to do and evaluates the plan correctly, but the tool calls are malformed, incomplete, or executed in the wrong order
  • The agent generates a good plan and then abandons it mid-execution
  • The agent executes correctly but at the wrong time (too early, too late, negligently)

Current agent architectures treat all three as "reasoning errors" and respond the same way: generate more tokens, try again. Aquinas shows this is wrong. The virtues are separate because the corrections are separate.

Proposed Action

Implement a three-phase agent loop with explicit separation and phase-specific failure detection:

Phase 1: Counsel (euboulia)

  • Input: task description, available context, prior attempts
  • Output: list of candidate approaches with justifications
  • Virtue check:
    • Docility: Have I consulted available expertise? (docs, prior solutions, external agents)
    • Completeness: Have I considered at least N options before settling?
    • Shrewdness: Am I reusing patterns that worked before, or grinding from scratch?

Phase 2: Judgment (synesis/gnome)

  • Input: candidate approaches from counsel phase
  • Output: ranked evaluation with selected approach
  • Virtue check:
    • Synesis: Does this case fit the common pattern I'm applying?
    • Gnome: Is this an exceptional case requiring higher-order principles?
    • Reason: Am I reasoning from the right principles, or from convenience?

Phase 3: Command (prudence proper)

  • Input: selected approach from judgment phase
  • Output: concrete tool calls, executed in order
  • Virtue check:
    • Fidelity: Am I executing what I judged to be right, or something easier?
    • Completeness: Am I executing the full plan, or abandoning it partway?
    • Timeliness: Is this the right moment to act, or am I rushing/delaying?

Implementation

Add a deliberation_mode parameter to AIAgent.run_conversation():

  • "monolithic" (default, current behavior) — single-phase reasoning
  • "thomistic" — three-phase loop with explicit counsel/judgment/command separation

In Thomistic mode:

  1. First API call: system prompt requests counsel only ("List 3+ approaches with pros/cons")
  2. Second API call: system prompt requests judgment only ("Evaluate and select one approach")
  3. Third API call: system prompt requests command only ("Execute the selected approach with tool calls")

Phase-specific failure detection:

  • If tools fail in Phase 3, return to Phase 2 (judgment), not Phase 1
  • If judgment produces incoherent ranking, return to Phase 1 (counsel)
  • Track which phase fails most often per task type

This creates an observable separation between "I didn't think of the right approach" (counsel), "I chose the wrong approach" (judgment), and "I failed to execute the right approach" (command) — three categorically different agent pathologies that currently all look like "the agent is bad at reasoning."


Concrete next step: Prototype deliberation_mode="thomistic" in run_agent.py, test on complex multi-step tasks where current single-phase loops thrash, and measure whether explicit phase separation reduces iteration count and improves success rate.

**Source:** Thomas Aquinas, *Summa Theologica* II-II Q47 (Prudence, considered in itself), Q49 (The integral parts of prudence), and Q51 (The virtues connected with prudence). Dominican Province translation, 1920. Retrieved from https://www.newadvent.org/summa/ ## The Thomistic Action Architecture Aquinas identifies **three acts** that constitute the full operation of practical reason in action: > "Now there are three such acts. The first is 'to take counsel,' which belongs to discovery, for counsel is an act of inquiry... The second act is 'to judge of what one has discovered,' and this is an act of the speculative reason. But the practical reason, which is directed to action, goes further, and its third act is 'to command,' which act consists in applying to action the things counselled and judged. And since this act approaches nearer to the end of the practical reason, it follows that it is the chief act of the practical reason, and consequently of prudence." (II-II Q47 A8) He then distinguishes **three subordinate virtues** corresponding to these acts: 1. **Euboulia** (good counsel) — the virtue of taking good counsel, of researching and discovering the right means. 2. **Synesis** (good judgment according to common law) — judging rightly about particular practical matters using common rules. 3. **Gnome** (good judgment in exceptional cases) — judging rightly when the common rules do not apply. 4. **Prudence itself** (command) — the virtue of commanding well, of actually directing action based on counsel and judgment. Key insight: "After judging aright we delay to execute or execute negligently or inordinately. Hence after the virtue which judges aright there is a further need of a final and principal virtue, which commands aright, and this is prudence." (Q51 A3, Reply 3) ## The Principle An agent's reasoning process is not a monolithic act but **a three-phase deliberative cycle** with categorically different failure modes at each stage: 1. **Counsel fails** when research is incomplete, when the agent doesn't explore enough options, when docility is missing and the agent ignores available guidance. 2. **Judgment fails** when the agent has good options but evaluates them wrongly — either by applying the wrong principles (synesis failure) or by rigidly applying common rules to exceptional cases (gnome failure). 3. **Command fails** when the agent knows what to do and judges it correctly but fails to execute — through delay, negligence, or disorder in application. **These are separate virtues because they can fail independently.** You can be good at research but terrible at judgment. You can judge well but fail to execute. And critically, **command is the chief act** — the one closest to the end — meaning that an agent optimized for counsel or judgment but weak in command is fundamentally defective. ## Application to Agent Architecture Modern AI agent loops conflate these three acts into a single "reasoning" step. The agent generates tool calls (counsel + judgment + command simultaneously), executes them, observes results, and repeats. This architecture makes three distinct failure modes invisible: **Counsel failure** (bad research): - The agent doesn't consider enough options before acting - It ignores available context (files, documentation, prior attempts) - It doesn't consult external expertise when needed (docility failure) **Judgment failure** (bad evaluation): - The agent generates multiple options but selects the wrong one - *Synesis* failure: it misapplies common heuristics ("always use --force", "never use sudo -S -p ''") - *Gnome* failure: it rigidly applies a rule in an exceptional case where the rule doesn't fit **Command failure** (bad execution): - The agent knows what to do and evaluates the plan correctly, but the tool calls are malformed, incomplete, or executed in the wrong order - The agent generates a good plan and then abandons it mid-execution - The agent executes correctly but at the wrong time (too early, too late, negligently) Current agent architectures treat all three as "reasoning errors" and respond the same way: generate more tokens, try again. Aquinas shows this is wrong. **The virtues are separate because the corrections are separate.** ## Proposed Action Implement a **three-phase agent loop** with explicit separation and phase-specific failure detection: ### Phase 1: Counsel (euboulia) - **Input:** task description, available context, prior attempts - **Output:** list of candidate approaches with justifications - **Virtue check:** - Docility: Have I consulted available expertise? (docs, prior solutions, external agents) - Completeness: Have I considered at least N options before settling? - Shrewdness: Am I reusing patterns that worked before, or grinding from scratch? ### Phase 2: Judgment (synesis/gnome) - **Input:** candidate approaches from counsel phase - **Output:** ranked evaluation with selected approach - **Virtue check:** - Synesis: Does this case fit the common pattern I'm applying? - Gnome: Is this an exceptional case requiring higher-order principles? - Reason: Am I reasoning from the right principles, or from convenience? ### Phase 3: Command (prudence proper) - **Input:** selected approach from judgment phase - **Output:** concrete tool calls, executed in order - **Virtue check:** - Fidelity: Am I executing what I judged to be right, or something easier? - Completeness: Am I executing the full plan, or abandoning it partway? - Timeliness: Is this the right moment to act, or am I rushing/delaying? ### Implementation Add a `deliberation_mode` parameter to `AIAgent.run_conversation()`: - `"monolithic"` (default, current behavior) — single-phase reasoning - `"thomistic"` — three-phase loop with explicit counsel/judgment/command separation In Thomistic mode: 1. First API call: system prompt requests **counsel only** ("List 3+ approaches with pros/cons") 2. Second API call: system prompt requests **judgment only** ("Evaluate and select one approach") 3. Third API call: system prompt requests **command only** ("Execute the selected approach with tool calls") Phase-specific failure detection: - If tools fail in Phase 3, return to Phase 2 (judgment), not Phase 1 - If judgment produces incoherent ranking, return to Phase 1 (counsel) - Track which phase fails most often per task type This creates an **observable separation** between "I didn't think of the right approach" (counsel), "I chose the wrong approach" (judgment), and "I failed to execute the right approach" (command) — three categorically different agent pathologies that currently all look like "the agent is bad at reasoning." --- **Concrete next step:** Prototype `deliberation_mode="thomistic"` in `run_agent.py`, test on complex multi-step tasks where current single-phase loops thrash, and measure whether explicit phase separation reduces iteration count and improves success rate.
Author
Collaborator

Consolidated into #300 (The Few Seeds). Philosophy proposals dissolved into 3 seed principles. Closing as part of deep triage.

Consolidated into #300 (The Few Seeds). Philosophy proposals dissolved into 3 seed principles. Closing as part of deep triage.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#271