Inferensys

Glossary

Task Schema

A task schema is a formal template that defines a class of tasks, specifying its parameters, preconditions, and the constraints governing its decomposition or execution within hierarchical planning systems.
Product manager reviewing autonomous task execution dashboard on laptop, completed tasks visible, casual work session.
HIERARCHICAL TASK NETWORKS

What is a Task Schema?

A formal template that defines a class of tasks within a planning system, specifying its parameters, expected outcomes, and the constraints governing its decomposition or execution.

A task schema is a reusable template that formally defines a class of tasks within a hierarchical task network (HTN) or other automated planning system. It specifies the task's name, input parameters, expected outputs (or effects), and any preconditions that must be true for the task to be applicable. This schema acts as a blueprint, enabling an AI planner or autonomous agent to reason about and manipulate the task as an abstract unit before determining how to achieve it through task decomposition or direct execution.

In practice, a task schema is instantiated with concrete arguments to create a specific task instance. For compound tasks, the schema is linked to one or more decomposition methods that define possible ways to break it down into subtasks. For primitive tasks, the schema maps directly to an executable action or operator. This structured representation is foundational for building agentic cognitive architectures that can reliably plan and execute complex, multi-step workflows by reasoning over well-defined capabilities.

HIERARCHICAL TASK NETWORKS

Core Components of a Task Schema

A task schema is a formal template that defines a class of tasks, specifying its parameters, expected outcomes, and the constraints on how it can be decomposed or executed within a Hierarchical Task Network (HTN).

01

Task Name and Parameters

The task name is a unique identifier for the class of task (e.g., deliver-package). Parameters are typed variables that define the task's specific instance (e.g., ?package, ?destination). These parameters are bound to concrete objects during planning and execution, allowing the same schema to be reused for different scenarios.

02

Preconditions

Preconditions are logical predicates that must be true in the current world state for the task to be applicable. They define the contextual requirements for execution or decomposition.

  • For a primitive task drive-to(?location), a precondition might be (vehicle-fuel-level > 0).
  • For a compound task, preconditions on a method determine if that decomposition path is valid.
03

Effects

Effects describe the changes to the world state that result from successfully executing a primitive task. They are the formal specification of the task's outcome.

  • Add Effects: Facts that become true (e.g., (package-at ?package ?destination)).
  • Delete Effects: Facts that become false (e.g., (package-at ?package ?origin)). Compound tasks have no direct effects; their impact is defined by the effects of their decomposed primitive subtasks.
04

Decomposition Specification

This core component defines how a compound task is broken down. It is not a single step but a set of methods, each providing a possible decomposition recipe.

  • A method contains a subtask network: an ordered or partially-ordered set of child tasks.
  • The schema specifies the task's type (primitive or compound), which dictates whether it requires decomposition or maps directly to an executable action.
05

Constraints

Constraints impose logical and temporal restrictions on task execution and decomposition. They ensure the generated plan is feasible and correct.

  • Ordering Constraints: Specify that subtask A must precede subtask B.
  • Resource Constraints: Limit the use of consumables (e.g., (battery-capacity >= 15%)).
  • Binding Constraints: Enforce variable equality or inequality between parameters of different subtasks.
06

Task Library Integration

A task schema does not exist in isolation. It is part of a domain-specific task library, a curated collection of schemas, methods, and operators. The schema's parameters and effects must be consistent with the ontology of this library. This integration allows the HTN planner to reason about interactions between different tasks and reuse modular components across complex plans.

HIERARCHICAL TASK NETWORKS

How Task Schemas Work in HTN Planning

A task schema is the fundamental building block of a Hierarchical Task Network (HTN), acting as a template that defines a class of tasks by specifying its parameters and the constraints governing its decomposition or execution.

A task schema formally defines a class of tasks within an HTN domain description. It specifies the task's name, its typed parameters (variables), and whether it is a primitive task (directly executable) or a compound task (requiring decomposition). For compound tasks, the schema does not define how to decompose it; that logic is contained within separate method schemas. This separation allows multiple decomposition strategies for the same high-level objective, providing flexibility in planning.

During HTN planning, the planner matches task schemas from the initial task network against available methods. A method's preconditions must hold in the current state for its associated decomposition to be applied, recursively refining the plan. This schema-based approach enables the concise representation of complex, reusable procedures, forming a task library that encodes domain expertise for autonomous agents to solve intricate, multi-step problems through systematic task decomposition.

TASK SCHEMA

Frequently Asked Questions

A Task Schema is the foundational template that defines a class of tasks within a Hierarchical Task Network (HTN). It specifies the task's parameters, its type (primitive or compound), and the constraints governing its decomposition or execution.

A Task Schema is a formal template that defines a class of tasks within a Hierarchical Task Network (HTN) planning system. It works by specifying the task's name, parameters (variables that define a specific task instance), and its type—either primitive (directly executable) or compound (requiring decomposition). For a compound task, the schema is linked to one or more methods, which are rules dictating how it can be broken down into subtasks. For a primitive task, it is linked to an operator that defines its preconditions and effects on the world state. This schema-based approach allows planners to reason abstractly about high-level goals before recursively refining them into executable action sequences.

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.