Inferensys

Glossary

Compound Task

A compound task is a high-level, abstract objective in Hierarchical Task Network (HTN) planning that must be decomposed into subtasks before it can be executed.
Product manager reviewing autonomous task execution dashboard on laptop, completed tasks visible, casual work session.
HIERARCHICAL TASK NETWORKS

What is a Compound Task?

In Hierarchical Task Network (HTN) planning, a compound task is a high-level, abstract objective that cannot be executed directly and must be decomposed into a network of simpler subtasks.

A compound task is a non-primitive task within an HTN that represents a complex goal requiring further breakdown. It is defined by a task schema and is resolved through task decomposition, where a method (HTN) is selected to replace it with a network of subtasks. These subtasks can themselves be compound or primitive tasks, which are directly executable actions. The process continues recursively until only primitive tasks remain, forming an executable plan.

Compound tasks are the core abstraction for managing complexity in agentic cognitive architectures. They enable systems to reason about high-level objectives, like 'Assemble Product,' by systematically applying domain-specific decomposition knowledge. This contrasts with primitive tasks, which have direct preconditions and effects on the world state. The choice of decomposition method often depends on dynamic planning problem conditions, allowing for flexible, context-aware behavior in autonomous agents.

HIERARCHICAL TASK NETWORKS

Key Characteristics of a Compound Task

A compound task is a high-level, abstract objective within a Hierarchical Task Network (HTN) that cannot be executed directly. It must be recursively decomposed into simpler subtasks until only primitive, executable actions remain.

01

Abstract and Non-Executable

A compound task represents a goal or intention, not a concrete action. It serves as a placeholder that must be resolved through task decomposition. For example, the task DeliverPackage is compound; it cannot be performed until it is broken down into subtasks like NavigateToAddress, ConfirmRecipient, and HandOverPackage. This abstraction allows planners to reason at multiple levels of detail.

02

Defined by Decomposition Methods

The meaning of a compound task is defined entirely by the methods associated with it. A method is a schema that provides one possible way to decompose the task into a network of smaller subtasks (which can be compound or primitive).

  • A single compound task often has multiple methods, representing different strategies.
  • The planner selects a method based on preconditions that must hold in the current world state.
  • For instance, the compound task Travel(Paris, London) could have methods for ByTrain, ByPlane, or ByCar, each with different preconditions (e.g., hasTrainTicket, hasValidPassport).
03

Hierarchical Structure

Compound tasks create the hierarchy in HTNs. A high-level compound task decomposes into a network that may contain other compound tasks, forming a decomposition tree. This mirrors how humans solve complex problems: we break a large goal (OrganizeConference) into sub-goals (SecureVenue, ArrangeSpeakers, ManageRegistrations), which are further decomposed until we reach actionable steps (SendEmail, SignContract). This structure makes planning more efficient by constraining the search space.

04

Context-Dependent Resolution

The specific decomposition of a compound task is not fixed; it is dynamically determined by the planning context. This includes:

  • Current World State: What facts are true right now?
  • Available Resources: What tools, budget, or agents are available?
  • Ordering Constraints: Do some subtasks need to precede others?

This allows an HTN planner to generate highly situational plans. The compound task RespondToIncident might decompose into CallFireDepartment if fire == true, or into ApplyFirstAid if injury == true.

05

Enables Skeletal Planning

Early in the planning process, a solution may consist largely of compound tasks—this is called a skeletal plan. It outlines the major phases or components of the solution without specifying all low-level details. For example, a skeletal plan for BuildHouse might be: [ObtainPermits, ConstructFoundation, ErectStructure, InstallUtilities, FinishInterior]. Each of these is a compound task requiring further plan refinement. This top-down approach is a key advantage of HTN over classical planning.

06

Contrast with Primitive Tasks

Understanding compound tasks requires contrasting them with primitive tasks (or operators).

CharacteristicCompound TaskPrimitive Task
ExecutabilityNot directly executableDirectly executable (an action)
DefinitionDefined by decomposition methodsDefined by preconditions and effects
Role in PlanAbstract step requiring refinementConcrete step causing state change
ExampleDiagnoseSystemFaultRunDiagnosticTool(port=8080)

A plan is complete only when all compound tasks have been decomposed away, leaving a sequence of primitive tasks.

HIERARCHICAL TASK NETWORKS

Frequently Asked Questions

Common questions about Compound Tasks, the abstract, high-level objectives in Hierarchical Task Networks (HTNs) that must be decomposed into executable subtasks.

A Compound Task is a high-level, abstract objective within a Hierarchical Task Network (HTN) that cannot be executed directly and must be recursively decomposed into a network of simpler subtasks or Primitive Tasks.

  • Core Function: It represents a complex goal, like DeliverPackage or DiagnoseSystemFault, that requires a multi-step plan.
  • Decomposition Requirement: It is defined not by direct actions but by one or more Methods, which are rules specifying how to break it down given certain Preconditions.
  • Contrast with Primitive Tasks: Unlike a Primitive Task, which maps to a single executable action (e.g., PickUp(object)), a Compound Task's meaning is defined entirely by its possible decompositions.

This abstraction is fundamental to HTN planning, allowing planners to reason about complex problems at multiple levels of detail.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.