A Task Library is a curated, domain-specific collection of task schemas, decomposition methods, and planning operators that formally defines the capabilities and procedural knowledge available to a Hierarchical Task Network (HTN) planner. It serves as the planner's core knowledge base, encoding how abstract, high-level goals (compound tasks) can be recursively broken down into networks of simpler subtasks until directly executable primitive actions are reached. This library essentially provides the "recipes" or blueprints the AI agent uses to understand and accomplish complex work.
Glossary
Task Library

What is a Task Library?
A Task Library is the foundational knowledge base for a Hierarchical Task Network (HTN) planner, containing the formal schemas that define an agent's capabilities and procedural knowledge within a specific operational domain.
In practice, a well-engineered Task Library enables deterministic and interpretable plan generation. Each entry—a task schema—specifies parameters, preconditions for applicability, and the effects of execution. For an autonomous software agent, the library might contain schemas for FetchData(API), ParseJSON(response), and GenerateReport(insights). The planner selects and sequences these schemas to fulfill a top-level objective like AnalyzeQuarterlySales(), ensuring every generated action is grounded in a known, verifiable capability.
Core Components of a Task Library
A Task Library is the foundational knowledge base for a Hierarchical Task Network (HTN) planner, containing the formal schemas that define how complex goals can be broken down into executable actions.
Task Schemas
A Task Schema is a template that defines a class of tasks within the library. It specifies the task's name, parameters (variables), and its type—either Primitive Task (directly executable) or Compound Task (requires decomposition). For example, a DeliverPackage(package, location) schema defines the structure for all delivery tasks. Schemas provide the standardized building blocks from which specific planning problems are constructed.
Methods (Decomposition Rules)
A Method is a rule that defines a possible way to decompose a compound task into a network of subtasks. Each method is associated with a specific compound task schema and contains:
- Preconditions: Logical conditions that must be true in the current world state for this decomposition to be valid.
- Subtasks: The ordered network of (compound or primitive) tasks that implement the parent task.
A library contains multiple methods for key compound tasks, enabling the planner to choose context-appropriate strategies. For instance, the
AssembleProducttask might have different methods for 'rush order' versus 'standard assembly'.
Operators (Primitive Actions)
An Operator is the formal, executable representation of a Primitive Task. It defines the lowest-level action the system can perform. Each operator is grounded by:
- Preconditions: State conditions required for the action to be legally applied.
- Effects: The precise changes the action makes to the world state (e.g.,
robot_location = warehouse). Operators are the leaves of the Decomposition Tree. A robust library includes operators for all fundamental capabilities, such asNavigate(robot, from, to),Grasp(robot, object), orCallAPI(endpoint, payload).
Precondition & Effect Logic
This component defines the formal language used to express the Preconditions for methods and operators and the Effects of operators. It typically uses a predicate logic (e.g., first-order logic) to represent facts about the world state. For example, a precondition might be At(Robot1, LoadingDock) AND Has(PackageA). An effect might be NOT(At(Robot1, LoadingDock)) AND At(Robot1, StorageRoom). The library's logic framework determines the planner's reasoning power and the complexity of real-world constraints it can model.
Domain-Specific Constraints
Beyond basic preconditions, a task library encodes domain-specific constraints that govern valid task decomposition and ordering. These include:
- Ordering Constraints: Temporal relations (e.g.,
Task A before Task B). - Resource Constraints: Limitations on consumables (e.g.,
battery_level > 20%) or reusable assets (e.g.,uses(forklift)). - Causal Links: Dependencies between tasks where one task produces a state that another requires. These constraints ensure the planner generates feasible, efficient plans that respect real-world operational limits.
Library Curation & Versioning
A task library is a living codebase requiring systematic curation. This involves:
- Schema Validation: Ensuring new task schemas and methods are consistent and non-contradictory.
- Performance Profiling: Annotating tasks with estimated cost, duration, or reliability metrics to guide the planner.
- Version Control: Managing different library versions for various operational contexts (e.g.,
warehouse_v1.2,emergency_protocols). - Modular Design: Organizing the library into reusable, domain-specific modules (e.g.,
navigation.tlib,manipulation.tlib) that can be composed for complex agents.
How a Task Library Works in HTN Planning
A Task Library is the foundational knowledge base for a Hierarchical Task Network (HTN) planner, containing the formal schemas that define how abstract goals can be decomposed into executable actions.
A Task Library is a curated, domain-specific collection of task schemas, decomposition methods, and planning operators that formally encodes an agent's capabilities and procedural knowledge. It serves as the planner's rulebook, defining all legal ways to break down high-level compound tasks into networks of subtasks until primitive tasks (executable actions) are reached. Without this library, an HTN planner lacks the necessary instructions to reason about achieving complex objectives.
During planning, the solver queries this library. For a given compound task, it retrieves all applicable methods whose preconditions match the current world state. Each method provides a valid decomposition into a new subtask network. This process recurses until the plan consists solely of primitive operators. The library's design—its granularity, constraints, and coverage—directly determines the planner's efficiency, flexibility, and the semantic correctness of the plans it generates.
Frequently Asked Questions
A Task Library is the foundational knowledge base for a Hierarchical Task Network (HTN) planner, defining the capabilities and operational logic of an autonomous agent within a specific domain.
A Task Library is a curated, domain-specific collection of task schemas, methods, and operators that formally defines the capabilities and decomposition logic for a Hierarchical Task Network (HTN) planner. It works by providing the planner with a structured vocabulary of actions and the rules for breaking down complex goals. When the planner receives a high-level objective (e.g., 'Diagnose Server Failure'), it consults the library's methods to recursively decompose it into a network of subtasks (e.g., 'Check Logs', 'Run Diagnostics') until it reaches primitive, executable actions (e.g., 'Execute API Call: fetch_logs'). The library acts as the agent's procedural knowledge, dictating what it can do and how it can reason about doing it.
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 Library is a core component of an HTN planner. These related concepts define its structure, function, and the environment in which it operates.
Domain Description (HTN)
The formal specification that defines the universe of a planning problem. It is the complete rulebook for an HTN planner, containing:
- The Task Library: All available task schemas.
- Methods: Rules for decomposing compound tasks.
- Operators: Definitions of primitive actions (preconditions & effects).
- Predicates: The vocabulary for describing world states. The Domain Description provides the static knowledge; the planner uses it to solve dynamic Planning Problems.
Task Schema
A template that defines a class of tasks within the Task Library. It specifies:
- Task Name & Parameters (e.g.,
Transport(?item, ?from, ?to)). - Whether it is a Primitive Task (executable) or a Compound Task (requires decomposition).
- For compound tasks, it links to the Methods that define possible decompositions. Schemas provide the standardized interface for the planner to reason about and manipulate tasks.
Method (HTN)
A decomposition rule stored in the Task Library. It defines one possible way to achieve a compound task. A method consists of:
- Preconditions: Logical conditions that must be true for this method to be applicable.
- Subtasks: The network of (compound or primitive) tasks that implement the parent task.
- Ordering Constraints: Temporal relations between the subtasks. The planner selects an applicable method to break an abstract goal into concrete steps.
Operator
The definition of a primitive, executable action within the planning domain. It is the atomic unit of change and is characterized by:
- Parameters: Variables for the action (e.g.,
?block). - Preconditions: Facts that must be true in the world for the action to be legally executed.
- Effects: Additions and deletions to the world state that result from the action's execution. Operators are the leaves of the decomposition tree, directly interfacing with the execution environment.
Planning Problem (HTN)
A specific instance to be solved, combining the static Domain Description with dynamic elements:
- Initial State: A complete snapshot of the world at the start (e.g.,
(On A Table), (Clear B)). - Initial Task Network: The high-level goal task(s) to be accomplished (e.g.,
[BuildTower(A, B, C)]). The planner uses the Task Library from the Domain Description to decompose the Initial Task Network into a sequence of Operators that transforms the Initial State into a goal-satisfying state.
SHOP (Simple Hierarchical Ordered Planner)
A seminal, forward-chaining HTN planning algorithm. SHOP is significant because it interleaves planning with state progression:
- It decomposes tasks in the order they would be executed.
- After decomposing a task to primitive operators, it immediately applies the operator's effects to a simulated world state.
- This allows it to evaluate preconditions of subsequent tasks against the current, projected state, making it highly efficient. The Task Library provides the methods SHOP uses for its depth-first, ordered decomposition.

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