  Quantum information processing devices need to be robust and stable against
external noise and internal imperfections to ensure correct operation. In a
setting of measurement-based quantum computation, we explore how an intelligent
agent endowed with a projective simulator can act as controller to adapt
measurement directions to an external stray field of unknown magnitude in a
fixed direction. We assess the agent's learning behavior in static and
time-varying fields and explore composition strategies in the projective
simulator to improve the agent's performance. We demonstrate the applicability
by correcting for stray fields in a measurement-based algorithm for Grover's
search. Thereby, we lay out a path for adaptive controllers based on
intelligent agents for quantum information tasks.
