A general framework for multi-agent systems. An agent-environment interface is abstracted with a free monad.