It would be interesting to have an account from diverse places
Thanks to an offhand reference in the biblical Book of Proverbs, medieval Christian preachers just loved using ants as an exemplum for their audiences. Ants were models of industriousness, always persevering, never selfish. You can imagine how well this would go over with people returning home from sermon to find ants eating their bread or harvested grain.
The Geoponika is a fascinating miscellany of classical and early medieval agricultural texts compiled in 10th century Byzantium. The collected authorities offer various advice for keeping ants away from crops before and after harvest. We can think that people might have employed similar measures to protect the food in their own homes. Mostly, the remedies consist of various substances spread around or poured on anthills:
I imagine medieval people also utilized the well-worn traditions of kill it or put up with it--after all, people and animals sometimes lived in the same dwelling, a "mixed house," though there was usually some attempt at a partition. But I have no offhand citation for that. ;)