I don't think you need AI for that.
- First, anticipating what groceries are low: Simplest implementation would be a list where the user manually enters additions and removals.
- Secondly searching every flier and website in the city. Okay that one will be a bit trickier. First you'd need to gather a list of all stores in the city, and then look for any deal. The big challenge here is that they don't just have a common API where you check. You either need to program a bot to scrape all their web presences, or convince them to provide the information in a common format.
- The last step seems like it could be related to the traveling salesman problem.