Planning with HTN and Evolutionary Search

Symbolic planning handles the cases where the plan is provably correct. Evolutionary code search handles the cases where the fitness function is machine-checkable. ChatHTN (2025) and AlphaEvolve (2025) show what each unlocks when paired with an LLM.

Build 1.3 hr Python (stdlib)

Prerequisites: Phase 14 · 02 (ReWOO and Plan-and-Execute)

#Learning Objectives

  • Explain Hierarchical Task Networks: tasks, methods, operators, preconditions, effects.
  • Describe ChatHTN's hybrid loop — symbolic search with LLM fallback decomposition.
  • Explain AlphaEvolve's evolutionary loop and why it only works with a programmatic evaluator.
  • Implement a toy HTN planner plus a toy evolutionary search in stdlib.
Full Access lesson

Keep going. The rest of this lesson is one step away.

Unlock all 503 lessons, video, code, quizzes and every future update. Pay in your own currency with Paystack.

The text and code of this lesson are based on AI Engineering from Scratch by Rohit Ghumare, MIT licensed.