Skip to content

Goal & Planning

Goal decomposition, navigation, and orchestration -- the components that turn high-level objectives into executable plans with safety-bounded subtasks.

Overview

The goal engine is the strategic brain of G6. Given a GoalInput (a frozen Pydantic model with nested subtasks and resource bounds), GoalDecomposer builds a SearchTree of subgoals, each annotated with resource constraints inherited from the parent. The engine exposes 325 MCP tools across 13 sub-packages covering goal lifecycle, mental models, metacognition, orchestration, persistence, verification, and EML (Epistemic Meta-Learning).

Supporting the engine are five orchestration components. solver handles constraint satisfaction for resource allocation. navigator provides pathfinding through the goal search tree. guide offers heuristic advice for goal refinement. hat_orchestrator manages hierarchical agent teams, and recursive_architect handles recursive goal decomposition when subtasks themselves require decomposition.

The cluster enforces a strict resource budget: every subtask inherits a ResourceBoundsSchema from its parent, and the sum of child budgets must not exceed the parent's allocation. This prevents unbounded computation even in deep recursive decompositions.

Components

Component Description MCP Tools
goal_engine Goal decomposition, SearchTree construction 325
solver Constraint satisfaction for resource allocation --
navigator Search tree pathfinding and traversal --
guide Heuristic goal refinement advice --
hat_orchestrator Hierarchical agent team management --
recursive_architect Recursive goal decomposition --

Architecture

graph TD
    GE[goal_engine] --> SOLVER[solver]
    GE --> NAV[navigator]
    GE --> GUIDE[guide]
    GE --> HAT[hat_orchestrator]
    GE --> RA[recursive_architect]
    RA -->|deep subtasks| GE
    HAT --> AGENTS[Agents & LLM cluster]
    GE --> CTX[Context & Retrieval cluster]
    GE --> SAFE[Safety & Alignment cluster]

Key Patterns

Frozen Goal Inputs. GoalInput and ResourceBoundsSchema are frozen Pydantic models. Once a goal is submitted, its specification is immutable. This simplifies reasoning about concurrent goal execution and prevents mid-flight mutation.

MCP Sub-Package Organisation. The goal engine's 325 tools are split across 13 sub-packages (Round 1: goal_engine_mcp, mental_models_mcp, metacognition_mcp, orchestration_mcp; Round 2: persistence_mcp, verifier_mcp, eml_mcp; plus six more). Each sub-package has its own schema, server, and test suite, keeping individual modules under 300 lines.

Resource Inheritance. When GoalDecomposer splits a goal into subtasks, each child receives a ResourceBoundsSchema derived from the parent. The decomposer validates that child bounds sum to at most the parent's bounds, providing a compile-time-like check on resource consumption.