Second Edition · 2026
Book cover: a luminous crane rising on a glowing ribbon that descends through a recurrent loop, a network lattice, and a time-series waveform, with the title Building Temporal AI, From Forecasting to Sequential Decision Making

Building Temporal AI From Forecasting to Sequential Decision Making

A practitioner's guide to time series, temporal deep learning, foundation models, and sequential decision making.

Alexander Apartsin & Yehudit Aperstein

Time is one of the most fundamental dimensions of intelligence. This book is one connected journey through the theories, models, and engineering practices for systems that understand, predict, and act in dynamic environments. It starts with classical statistical forecasting, builds through temporal deep learning, state-space and continuous-time models, representation learning, and foundation models, then moves into reinforcement learning for sequential decision making, before closing with the trust and deployment concerns that govern real systems.

9 parts 36 chapters ~250 sections 7 appendices

The Nine-Part Arc

Each part stands on the one before it; together they span the full reach of Temporal AI, from a single forecast to an agent that plans and acts.

I

Foundations of Temporal AI

What makes intelligence temporal, the limits of predictability, and the data engineering and leakage discipline every later part depends on.

2 chapters
II

Classical Forecasting and Time Series Analysis

Statistical foundations, the frequency domain, univariate and multivariate models, state-space filtering, and anomaly and change-point detection.

6 chapters
III

Temporal Deep Learning

Sequence fundamentals, RNNs, TCNs, Transformers, structured state-space and continuous-time models, deep forecasting architectures, and temporal foundation models.

7 chapters
IV

Temporal Representation Learning

Self-supervised and contrastive representations, generative temporal models, and event, point-process, and temporal-graph modeling.

3 chapters
V

Uncertainty, Online, and Adaptive Learning

Probabilistic and conformal forecasting, online and continual learning under distribution shift, and adaptive systems that update themselves in production.

3 chapters
VI

Sequential Decision Making

MDPs, POMDPs, bandits and RL foundations, deep and advanced RL, optimal control and imitation, sequences as decisions, and world models and planning.

8 chapters
VII

Building Intelligent Temporal Systems

Temporal reasoning and causality, temporal AI agents with memory and tool use, and spatio-temporal intelligence across mobility, traffic, and video.

3 chapters
VIII

Trustworthy and Deployed Temporal AI

Interpretability, robustness, fairness, and privacy for temporal models, then serving, monitoring, drift alarms, and the MLOps of streaming systems.

2 chapters
IX

Applications and Future Directions

Industrial applications across finance, healthcare, manufacturing, energy, robotics, science, supply chain, and security, then the road toward general temporal intelligence.

2 chapters

How This Book Teaches

Four habits, kept in every chapter from the first forecast to the last policy.

A Chapter Scaffold

Every chapter follows one structure: learning objectives, a running example, core exposition, worked examples, a case study, pitfalls, exercises, and further reading. You always know where you are.

The Right Tool

After each from-scratch build, a library-shortcut callout shows the same task in a few lines of statsmodels, Nixtla, GluonTS, PyTorch Forecasting, or Stable-Baselines3, and names exactly what the library handles for you.

The Temporal Thread

Each classical idea returns in learned form. The Kalman filter becomes the RNN and the structured state-space model; the HMM becomes a neural latent-variable model and a belief-state agent; the MDP becomes a sequence model. One story, told twice.

Three Running Datasets

A financial returns series, an irregularly sampled clinical series, and an industrial sensor stream recur across the book, so methods are compared on the same data rather than on isolated toy examples.

The Hands-On AI Science Series

Building Temporal AI is one of nine connected books, each a deep, build-it-yourself guide to a major field of AI.

Hands-On AI Science is a series of in-depth guides to the major fields of artificial intelligence. Every book goes deep into the theory, models, and internals, covering the classical foundations and the most recent ideas, then shows you how to build each one in Python with the modern libraries and tools that get the job done. The writing stays plain and light (illustrations, analogies, mental models, worked examples, and a little fun) without trading away rigor or coverage. Each volume is self-contained and complete enough to anchor a full course on its subject.

Building Language AI

From Tokens to Agents.

Read online · Kindle

Building Vision AI

From Pixels to Generative Models.

Read online · Kindle

Building Temporal AI

From Forecasting to Sequential Decision Making.

You are here

Building Scalable AI

From Big Data Algorithms to Distributed Intelligence.

Read online · Kindle

Building Embodied AI

From Perception to Autonomous Action.

Read online

Building Agentic AI

From Goals to Autonomous Systems.

Read online

Building Discovery AI

From Vibe Coding to Autonomous Science.

Read online

Building Neuromorphic AI

From Spiking Neurons to Edge Intelligence.

Read online

Building Quantum AI

From Qubits to Quantum Machine Learning.

Read online

Read the full About the Hands-On AI Science Series note.