Remember last Thanksgiving, when your Uncle George insisted on deep-frying the turkey—and then had to ask Alexa to call the Butterball Turkey Talk-Line for help? If the trouble was complicated, and especially if George sounded panicky, he probably reached a real person, like knowledgeable longtime Butterball employee Marge Klindera. On the other hand, with a quick and easy problem, a complex system of algorithms might have connected him instead to a recording of Marge's voice, programmed to recognize and respond to hundreds of common turkey-related phrases. Chances are, George didn't know (or care) which was speaking to him, as long as he got exactly what he was after, fast and hassle-free. That's what customers want, too. "There's no part of business where virtual agents and humans can work together better than in helping customers," writes P.V. Kannan in a fascinating new book, The Age of Intent: Using Artificial Intelligence to Deliver a Superior Customer Experience (with Josh Bernoff). "Bots are fast and accurate. People are empathetic and have judgment. Together they've got what it takes to deliver the best customer service possible," he writes.In these pages, Kannan, who is CEO of San Jose-based consulting and software firm 7.ai, delves into how dozens of companies, from Avis to Xantera, are using artificial intelligence to delight new customers and keep old ones coming back. Letting bots or other virtual customer service representatives (CSRs) handle routine queries, while directing trickier challenges to humans, can cut costs. Dish Network says that for every minute, on average, it can shave off customer phone calls with humans, the company can save $2 million per year. Customers initiate about 6 million chats per year, and the virtual CSRs slash "tens of millions of dollars" annually from Dish's CRM budget. But the far larger point is that companies that deploy A.I. to make sales and service quicker, more accurate, and more fun will soon lay claim to the same kind of huge competitive advantage that early adopters of the Internet enjoyed 20-odd years ago, according to Kannan.At the same time, smart machines will "change the work of non-machines—also known as 'human beings,'" writes The World Is Flat author Thomas Friedman in this book's foreword. "They will need more empathy and more granular knowledge... [and] their job will be to tweak the virtual agents to make them smarter."The Age of Intent is fun to read, sprinkled with cautionary tales of A.I. experiments gone awry. A hilarious verbatim transcript of a long, fruitless online dialogue between co-author Josh Bernoff and a chatbot on Expedia ends with an exasperated Bernoff typing, "You're pretty stupid." The bot responds by repeating the same inane question it had already asked twice.Most of the The Age of Intent, though, focuses on what's working well so far, and why. To go back to Dish Network for a moment, consider how the company's DiVA system, which culls routine queries from thornier ones, helps human customer service agents do their jobs better and faster. "Even after DiVA kicks a chat out to an agent, it continues running in the background," Kannan writes, "where it shares with the agent what already happened, what it believes the customer's problem is, and what might be the best way to help her." The collaboration makes the human reps happier, he adds, because it takes the drudgery out of the job and lets them put their skills to work on the tasks that "require a bit more care and empathy." DiVA is similar to systems at other companies around the world where A.I. is collaborating with human CSRs. At KLM Royal Dutch Airlines, for instance, algorithms have been programmed to recognize words and phrases from about 60,000 customer chats. Constantly learning from those interactions in real time, while also sifting through oceans of internal data, the system then offers suggestions to the human agent, who can quickly apply the relevant knowledge to the customer's question.That kind of teamwork "demands a system smart enough to connect to all the company's databases, one that answers questions on weekends and holidays, scales up to meet demand, and supports human agents," Kannan notes. As you'd expect, building that capability is no day at the beach. The Age of Intent takes a thoughtful look at the complexities involved — not only the technical nuts and bolts, like putting the right digital infrastructure in place, but doing what it takes to get the human side humming along too.How, for example, do you persuade your human CSRs to start taking, and even welcoming, advice from machines? Thanks to all the recent hype about automation taking people's jobs (mostly exaggerated, but that's another story), it's essential to stress from the outset that smart systems are intended to assist human agents, not replace them. Meanwhile, Kannan suggests, "Navigate politics carefully." It's pretty obvious that a company's CIO and customer-service (and sometimes sales) leaders will have to be on board. But don't overlook the head of product development, the CMO, the COO, and the chief of human resources, all of whose turfs will be trod upon in one way or another. With so many cooks in the kitchen, "there are many potential people who can say no," Kannan writes. But "unless they're all allied behind the decision, it's unlikely to get off the ground." Businesses ready to forge ahead might bear in mind three insights from restaurant chain TGI Fridays' experience. Aiming to appeal to millennials, who are less inclined to linger in casual-dining eateries than their parents were, the company developed an A.I.-assisted system, starring social-media-friendly chatbots, that doubled its off-premises orders in a single year, to about $150 million annually. Fridays did this by, first, starting with a relatively small part of its business—people looking to save time by ordering in advance—and working out any bugs before expanding the system. Second, Kannan quotes Sherif Mityas, the Fridays executive who spearheaded the effort: "Measure the hell out of everything" along the way, to see whether your system is producing the results you and your customers want.And third, go in with a clear idea of what those results would look like. A big reason why TGI Fridays' A.I. push has paid off is that the company "didn't lose track of what they were trying to accomplish," Kannan writes. "Once you've chosen the right problem to solve, you'll be in a position to start succeeding."More must-read stories from Fortune:—Fortune’s 2019 Global 500: See the full list—How automation is cutting into workers’ share of economic output—How the maker of the world’s bestselling drug keeps prices sky-high—Want to buy a Spanish village? This real estate agent has 400 to sell—One of Warren Buffet’s favorite metrics is flashing red. Corporate profits are due for a hitSubscribe to Fortune’s CEO Daily newsletter for the latest business news and analysis.