Researchers at the NanoRobotics Labratory at École Polytechnique de Montréal, in Canada have managed to control a swarm of bacteria using a computer to build a step pyramid structure. This particular type of microbe known as magnetotactic bacteria has an internal compass that can be influenced by a magnetic field. By manipulating a magnetic field around the bacteria they were able to create and direct the swarm. Best to check out the video which will make more sense.
Via IEEE Spectrum