We just lived through a huge ant-swarm at our house, so I’m full of useful suggestions!
First off, it will be useful to know what kind of ants you’re dealing with, as different ants are tempted by different types of bait (as well as looking for different items in your pantry or on your floors).
Here is an informative article from the departments of etymology of UNM. It suggests all kinds of unpronounceable, toxic solutions to getting rid of ants, but if you scroll down you’ll find a guide to Common Household Ants. There you can see pictures of ants and read about their eating, nesting, and swarming habits.
Take comfort in the knowledge that a seasonal ant infestation is not usually your fault. Ants swarm at certain times of the year, and if they are nesting somewhere under your house or in your walls, they’ll inevitably wander into your living space.
If you can, try to attack at nest-level by pouring boiling water into the nest to kill the queen. If you live in a rental like me and don’t want to go drilling into the walls or crawling under the house, then just do what you can to keep them out of your space until their time of passion is over.
Here’s what worked for me:
Sweep, mop, and sweep again! - Keeping your floors clean makes them boring to ants - they’re usually running around your house looking for those crumbs your kids dropped on the floor at breakfast. I swept after every meal and mopped pretty often too. Since they leave pheromone trails wherever they go, mopping with a little vinegar is like destroying all the little ant sign posts along the way.
Cinnamon powder - Ants apparently hate cinnamon; they usually won’t cross a barrier of cinnamon. I got cheap cinnamon in bulk and sprinkled it liberally wherever I saw ants emerging, as well as where I did not want them to go. Actually, the floor of my pantry is still covered with a thick layer of cinnamon, but it smells nice so I don’t care.
Cinnamon oil - In places that it wasn’t convenient to have dusty cinnamon powder (high traffic areas where it would get scuffed out of the way too quickly), I mixed a little soapy water with vinegar and added about 20 drops of cinnamon essential oil and sprayed it liberally (and frequently) along the baseboards, and along the entrance of my pantry.
Orange oil - I added some orange extract to my cinnamon oil/vinegar mix but I imagine something like this d-Limonene (orange peel) spray would be much more effective. The orange extract did make my ant spray smell amazing, though! It’s so nice to have people walk into your home and say, “Oh, your house smells great! What are you cooking?” when you’re feeling really insecure about the pest infestation in your kitchen!
Corn meal - supposedly the ants eat it and it swells up in their tummies and they die. I certainly saw them toting it away, but never discovered any exploded ant remains, so I can’t verify the validity of that assertion. :)
Sweet Borax solution - There are all kinds of theories on what ratios of boric acid and sugar to use, but I just did a 2:1 ratio of 20 Mule Team Borax to sugar, added enough water to make a slurry, and then put it in an old jam jar lid. It evaporated into crystals in the lid and didn’t seem to attract any ants. So once it was dry, I sprinkled the crystals along the baseboards wherever I saw ants tugging along bits of old cereal. Apparently they take the borax back to their nest to feed to the queen, and it kills everyone who eats it.
The borax thing actually seemed to do the trick; I stopped seeing ants after a couple days of that treatment. You shouldn’t put borax anywhere that kids or pets might get to it, because it is toxic (although only mildly so - some freaky people actually ingest the stuff as some sort of weird cure-all).
Now, it could be that the borax did nothing and it just coincided with the end of the ant swarm. That’s the thing with ant swarms - they end. So mostly what you need to do is keep the ants out of your food while they’re swarming, and be tolerant of the little critters running around elsewhere.
I’m pleased to say that my combination of natural repellents definitely kept the ants out of my pantry (and most importantly, out of the huge vat of kombucha brewing on the pantry floor!). I’m confident that they’ll work for you!