I would guess(without much evidence) that you don't need much cognition in each individual ant. You can get very complex behaviours out of very simple rules in idealised systems like cellular automata.
My bias (for essentially aesthetic reasons) is to assume that each ant is basically pretty dumb, and the cool complex behaviors happen as an emergent property of how they respond to the stimuli they recieve (especially all the pheromone messages they get from other ants).
>each ant is basically pretty dumb, and the cool complex behaviors happen as an emergent property of how they respond to the stimuli they recieve (especially all the pheromone messages they get from other ants).
Not only do they farm aphids, they also farm fungus. Leafcutter ants bring the leaves to their fungus farm. Then they eat the fungus.
So ants farm both livestock and crops.
They also form super colonies.