Python implementation of the Cartridge Agent