The jobs in the cities weren't created by the new farming techniques though, those new farming techniques only removed jobs by the millions like you are saying AI might do.
There is no similar net creation of jobs for society if jobs are eliminated by AI, and it's even worse than that because many of the jobs are specialized, high-skill positions that can't be transferred to other careers easily. It goes without saying that it also includes millions of low-skill jobs like cashiers, stockers, data entry, CS reps, etc. Generally people who are already struggling to get enough hours and feed their families as it is.