Cognition · Software component
HTN Planner
Software componentCognitionCognition & Memoryarc:HTNPlanner
A task planner that recursively replaces abstract tasks in a task network with subtask networks from applicable decomposition methods until only primitive, executable tasks with consistent constraints remain.
Responsibility. Decomposes a high-level goal through method-based hierarchical refinement into a primitive executable task network.
Also known as: Hierarchical Task Network planner, Hierarchical planner, Decomposition engine
Variant of Task Planner abstract
When to choose. Choose when the goal has naturally nested structure, reusable decomposition patterns exist, stakeholders need multiple abstraction views, or staged commitment under uncertainty is needed, and the world is stable during planning.
Relationships
is configured by structural
delegates to dependency
invokes dependency
is invoked by dependency
reads dependency
receives delegation from dependency
writes dependency
is constrained by control
alternative to variability
Design guidance
- SHOULD be used when tasks are naturally nested, decomposition patterns recur, several stakeholders need different abstraction levels, or high-level decisions must precede detailed commitment.
- SHOULD use 3-5 abstraction levels; deeper hierarchies add method-selection, propagation and state-projection overhead.
- SHOULD NOT be used for simple 3-10 step sequential workflows, highly dynamic domains, optimization-dominant problems, or domains lacking decomposition knowledge.
- SHOULD organise abstraction levels by decision relevance, not by time scale.
- MAY be augmented with local optimization within each abstraction level when optimality matters.
Quantitative guidance
As stated by the sources; verify before use.
- Planner reasons about 3-7 items per level instead of hundreds of primitive actions (Ch5.4 travel example).
- 5 abstract subtasks with 4 applicable methods each yields 4^5 = 1,024 search branches under systematic search (Ch5.4).
- Four-level hierarchies may need 10x more planning time than two-level hierarchies for simple problems; 3-5 levels suit most domains (Ch5.4).
- Final manufacturing primitive network may contain 50-100 concrete operations (Ch5.4).
Classification
- Patterns
- Hierarchical Task Network (HTN) planningDepth-first task selectionBreadth-first task selectionLeast-commitment task selectionGreedy method selectionSystematic backtracking searchInformed (A*) method searchStrategic/tactical/operational abstraction levelsLocal repair
- Technologies
- LangGraphAutoGenCrewAISemantic Kernel planner
- Quality attributes
- Performance efficiency (ISO/IEC 25010)Maintainability (ISO/IEC 25010)Explainability (NIST AI RMF: explainable and interpretable)Interaction capability (ISO/IEC 25010)
- Risks mitigated
- Combinatorial search-space explosion of flat planningPremature detailed commitmentOpaque unmaintainable flat plans
Sources
- Ch5.4: T. Nguyen, "Hierarchical Planning Fundamentals," in Mastering Agentic AI Systems: Guide for the NVIDIA NCP-AAI Exam, 1st ed. 2026, ch. 5.4. ISBN: 9798244538229.