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.
Glossary
Task Schema

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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
A Task Schema is a core component of a Hierarchical Task Network (HTN). The following terms define the formal structures and processes that interact with task schemas to enable complex planning.
Hierarchical Task Network (HTN)
A planning formalism where the solution is generated by recursively decomposing high-level, abstract tasks into networks of subtasks using decomposition methods until a sequence of primitive, executable actions is found. Unlike classical planners that search for sequences of actions, HTN planners search for sequences of decompositions.
- Core Principle: Knowledge-based planning. The domain's 'how-to' knowledge is encoded in methods.
- Key Advantage: Efficiently solves complex problems by leveraging domain-specific decomposition strategies.
Method (HTN)
A schema that defines a possible way to decompose a specific compound task into a network of subtasks. A method is only applicable if its preconditions are satisfied by the current world state. It is the primary knowledge element that guides the HTN planner.
- Structure:
Method(Task, Preconditions, Subtask Network) - Example: A
Method(CookDinner, {haveIngredients=true}, [PrepareIngredients, CookMainCourse, SetTable]). - Role: Provides the 'recipes' for achieving abstract goals.
Primitive Task
A task in an HTN that corresponds directly to an executable action or operator in the planning domain. It is a leaf node in the decomposition tree and cannot be broken down further by the planner. Its execution has defined effects on the world state.
- Contrast with Compound Task: A primitive task is an action (e.g.,
PickUp(BlockA)), while a compound task is a goal (e.g.,BuildTower). - Representation: Often modeled as a STRIPS-like operator with preconditions and effects.
Compound Task
A high-level, abstract task in an HTN that must be decomposed into subtasks (which can be other compound tasks or primitive tasks) before it can be executed. It represents a goal or an activity requiring multiple steps.
- Role: Serves as an entry point for planning. The initial task network is composed of compound tasks.
- Decomposition: Each compound task has one or more associated methods that define how to achieve it under different conditions.
- Example:
AssembleFurniture,DiagnoseSystemFault,PlanMarketingCampaign.
Task Decomposition
The core algorithmic process in HTN planning where a compound task is recursively replaced by a network of subtasks using an applicable method. This process continues until the entire task network consists only of primitive tasks, resulting in an executable plan.
- Process: 1. Select a non-primitive task. 2. Choose an applicable method. 3. Replace the task with the method's subtask network. 4. Repeat.
- Output: Creates a decomposition tree that records the hierarchical breakdown.
Domain Description (HTN)
The formal specification of an HTN planning problem. It is the knowledge base that defines the planner's capabilities and the rules of the domain. A complete domain description includes:
- Task Schemas: Definitions for all compound and primitive tasks.
- Methods: All decomposition rules for compound tasks.
- Operators: The definitions (preconditions/effects) for all primitive tasks.
- Predicates: The vocabulary for describing world states.
This description, combined with an initial state and initial task network, defines a planning problem.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us