  Key to biological success, the requisite variety that confronts an adaptive
organism is the set of detectable, accessible, and controllable states in its
environment. We analyze its role in the thermodynamic functioning of
information ratchets---a form of autonomous Maxwellian Demon capable of
exploiting fluctuations in an external information reservoir to harvest useful
work from a thermal bath. This establishes a quantitative paradigm for
understanding how adaptive agents leverage structured thermal environments for
their own thermodynamic benefit. General ratchets behave as memoryful
communication channels, interacting with their environment sequentially and
storing results to an output. The bulk of thermal ratchets analyzed to date,
however, assume memoryless environments that generate input signals without
temporal correlations. Employing computational mechanics and a new
information-processing Second Law of Thermodynamics (IPSL) we remove these
restrictions, analyzing general finite-state ratchets interacting with
structured environments that generate correlated input signals. On the one
hand, we demonstrate that a ratchet need not have memory to exploit an
uncorrelated environment. On the other, and more appropriate to biological
adaptation, we show that a ratchet must have memory to most effectively
leverage structure and correlation in its environment. The lesson is that to
optimally harvest work a ratchet's memory must reflect the input generator's
memory. Finally, we investigate achieving the IPSL bounds on the amount of work
a ratchet can extract from its environment, discovering that finite-state,
optimal ratchets are unable to reach these bounds. In contrast, we show that
infinite-state ratchets can go well beyond these bounds by utilizing their own
infinite "negentropy". We conclude with an outline of the collective
thermodynamics of information-ratchet swarms.
