guessing gnats, lil black fuckers with wings, going crazy in the soil.
I'm guessing you have potting soil for fruits or vegetables cause they go crazy for the stuff, also this is from overwatering, or too often. If you let the soil dry out between waterings they won't be able to survive there.
After you kill them off by letting the soil dry out, put 1 inch of sand over the soil. Keeping them away from the food supply as far as i know they don't eat the plant, but there larvae eat the roots.