We are having the same problem in our home. First get rid of any food you think they are going after (fruit, nuts, grains, pasta).
Next try this, I found this natural remedy online and it works:
1) pour vinegar into a bowl with a few drops of dish washing soap.
2) cover with plastic wrap but be sure to add holes to allow the fruit flies to gain access. (once the fruit flies land in it, the soap is heavy so they can't get back out)
3) place these bowls where you notice the flies the most
4) then sit back and check the result, every day (you'll be delighted to see how many you can get rid of using this simple method)
I have used these bowls of vinegar in my kitchen and bathroom with great results.
Today I had a pest control company out and he said I am on the right track; removing any food the flies are getting into and using the vinegar bowls.
He thinks we are at the tail end of the invasion. But they will check back with me on Monday. If we still have a problem by then, I have to remove everything from the kitchen cabinet, so they can spray the cabinet. I will be able to put everything away after 4-5 hours.
I would also suggest that you recheck your food, 2-3 times a week. You may find evidence of the bugs in something else that you did not consider before. I've dumped fruit, grains and pasta.
Although what we have resembles fruit flies, in my home it appears we have 2 different types of flying bugs. One is black and smaller than normal fly, and the other is much smaller and brown.
The pest control rep said these bugs survive best in warm and moist environment.
I hope my input helps you. These flying bugs have been driving me crazy but think after enduring this for several days, we are about done with this invasion.