It might depend on the type of ants. I have a similar situation that I was going to ask in one of my favorite nurseries about.
I have bricks that border my perennial bed and when I turned a few over I saw a bunch of itty bitty ants scrambling around. So I know they're not fire ants. Glad they're not fire ants! They act as if they're raspberry aka crazy ants. Interestingly, crazy ants eat fire ants. But they also eat electric wires. Don't know what they do in the garden or to people.
So anyway, different solutions for different ants.