Shoppers in line at a Brooklyn Whole Foods. The grocery store of the future may not have checkout lines or cashiers. CreditNina Westervelt for The New York Times

Imagine this scene from the future: You walk into a store and are greeted by name, by a computer with facial recognition that directs you to the items you need. You peruse a small area — no chance of getting lost or wasting time searching for things — because the store stocks only sample items. You wave your phone in front of anything you want to buy, then walk out. In the back, robots retrieve your items from a warehouse and deliver them to your home via driverless car or drone.

Amazon’s $13.4 billion purchase of Whole Foods, announced Friday, could speed that vision along. Amazon has already made shopping for almost everything involve spending less time waiting, doing work or interacting with people, and now it could do the same for groceries. It’s already trying with a store in Seattle, Amazon Go, that has no salespeople or checkout lines.

Our mental image of job-killing automation is robots in factories or warehouses. But the next jobs to disappear are probably ones that are a much bigger part of most people’s daily lives: retail workers and cashiers in stores and restaurants.

For a long time, economists argued that routine jobs like factory and clerical work were vulnerable to automation but that jobs in both the service and knowledge sectors were safer. They require human skills that are hard for machines to imitate, like judgment and adaptability. These skills are useful when an executive makes strategic business decisions or when a chef fries one customer’s egg and scrambles another’s.But it has become increasingly clear that parts of every job will be automated — and that the service sector is next. Although certain service jobs like health aide or preschool teacher still seem safe, others, like those in retail and food service, are already being displaced. It’s not hard to teach a machine to do routine tasks like scanning bar codes, stocking shelves or dunking fries in oil.

Eight million people, 6 percent of American workers, are retail salespeople and cashiers, according to the Bureau of Labor Statistics. Cashier jobs are expected to grow 2 percent by 2024, significantly slower than 7 percent job growth over all, and technology is the main reason, according to the bureau.

Half the time worked by salespeople and cashiers is spent on tasks that can be automated by technology that’s currently in use, according to a recent McKinsey Global Institute report. Two-thirds of the time on tasks done by grocery store workers can be automated, it said. Another report, by Forrester, estimated that a quarter of the tasks salespeople do would be automated this year, and 58 percent by 2020.

Estimates like these are guesses at best, because imagining the future is an act of science fiction. And even when technologies exist, companies adopt them slowly. That’s one reason productivity isn’t increasing at the rate economists might expect, even though more work is able to be automated. But there is evidence that retail jobs are transforming rapidly.

Look no further than the Amazon Go store. It has no cashiers or checkout lines. People scan their phones to enter, and sensors with computer vision monitor what they put in their carts. When they leave, they are automatically charged for what they have bought. Amazon calls it “just walk out technology.”

Amazon Go is open only to Amazon employees for now, and has reportedly had problems during its testing phase, particularly when the store is crowded. But the technology will improve as Amazon and other retailers keep testing and developing it. Elsewhere, Amazon uses automatic payment technology, drones that deliver purchases, and robots that restock shelves and fill boxes.

Lowe’s stores in California have customer service robots that roam the aisles to answer customers’ questions and monitor inventory. The Eatsa chain of restaurants has no human workers in sight. Customers order on store iPads or on their phones, and pick up their meals from a cubby that shows their name. Several fast-food chains, including McDonald’s and Panera, also use digital kiosks for customers to order and pay by themselves.

Companies won’t invest in technology unless it’s less expensive than employing people, and most retail workers make near minimum wage. But in a case study of grocery stores, McKinsey found that the savings from automation were three times the cost, and 68 percent of the savings were from reduced labor costs.

Retailers say automating certain tasks doesn’t necessarily displace employees, but frees them to do other things that are more valuable to customers. Lowe’s, for instance, said its customer service robot answered simple questions so employees could provide more personalized expertise, like home project planning.

Whole Foods, before the Amazon acquisition, made a similar argument to Forrester. “We intentionally don’t over-automate our stores, at least not on the front end,” an executive told Forrester, which didn’t name the person in its report. “We want to have the personal touch of real people.”

But shoppers often prefer to save time by interacting with fewer people, especially when they just need coffee or paper towels — thus the convenience of online ordering for in-store pickup at places like Walmart and Starbucks.

If salespeople and cashiers lose their jobs in large numbers, as economists say seems likely, they could be in better shape in some ways than those who have lost jobs in industries like manufacturing. Sales jobs are not geographically confined, and high turnover means wider availability.

On the other hand, said David Autor, an M.I.T. economist, it would make the job market even more challenging for a group of workers who already struggle to find stable, well-paid employment and are unlikely to have the education to move into better jobs.

At this point, Amazon said, it had no plans to lay off Whole Foods workers or use Amazon Go technology to automate cashiers’ jobs.

Erik Brynjolfsson, director of the M.I.T. Initiative on the Digital Economy, said Amazon’s plans could be much bigger than simply automating stores.

“The bigger and more profound way that technology affects jobs is by completely reinventing the business model,” he said. “Amazon didn’t go put a robot into the bookstores and help you check out books faster. It completely reinvented bookstores. The idea of a cashier won’t be so much automated as just made irrelevant — you’ll just tell your Echo what you need, or perhaps it will anticipate what you need, and stuff will get delivered to you.”

Quintessential Education, a leading education provider, believes in automation and the human touch. Join our General Paper Tuition and Economics class and resources to learn more the issues regarding these!