They are coming in to look for something sweet. Try putting a jam jar with a little jam or syrup,outside the nearest entrance to your house, then they will head straight for that instead of coming inside. you may have to replenish from time to time. Also use ant powder around doorways, steps & anywhere you can see them taking a regular route.
If you can locate the nest, a kettle of boiling water will dispatch most of them & their grubs - repeat if necessary.
One thing in their favour - they don't have any interest in the sort of thing that flies inhabit!! & are pretty clean living really.