Google is one of the most valuable companies in the world, but its future, like that of all tech giants, is clouded by a looming threat. The search company makes virtually all of its money from ads placed on the World Wide Web. But what happens to the cash machine if web search eventually becomes outmoded?

That worry isn’t far-fetched. More of the world’s computing time keeps shifting to smartphones, where apps have supplanted the web. And internet-connected devices that may dominate the next era in tech — smartwatches, home-assistant devices like Amazon’s Echo, or virtual reality machines like Oculus Rift — are likely to be free of the web, and may even lack screens.

But if Google is worried, it isn’t showing it. The company has long been working on a not-so-secret weapon to avert its potential irrelevance. Google has shoveled vast financial and engineering resources into a collection of data mining and artificial intelligence systems, from speech recognition to machine translation to computer vision.

Now Google is melding these advances into a new product, a technology whose ultimate aim is something like the talking computer on “Star Trek.” It is a high-stakes bet: If this new tech fails, it could signal the beginning of the end of Google’s reign over our lives. But if it succeeds, Google could achieve a centrality in human experience unrivaled by any tech product so far.

The company calls its version of this all-powerful machine the Google Assistant. Today, it resembles other digital helpers you’ve likely used — things like Apple’s Siri, Amazon’s Alexa and Microsoft’s Cortana. It currently lives in Google’s new messaging app, Allo, and will also be featured in a few new gadgets the company plans to unveil next week, including a new smartphone and an Amazon Echo-like talking computer called Google Home.

Google's grand plan

But Google has much grander aims for the Assistant. People at the company say that Sundar Pichai, who took over as Google’s chief executive last year after Google was split into a conglomerate called Alphabet, has bet the company on the new tech. Pichai declined an interview request for this column, but at Google’s developer conference in May, he called the development of the Assistant “a seminal moment” for the company.

If the Assistant or something like it does not take off, Google’s status as the chief navigator of our digital lives could be superseded by a half-dozen other assistants. You might interact with Alexa in your house, with Siri on your phone, and with Facebook Messenger’s chatbot when you’re out and about. Google’s search engine (not to mention its Android operating system, Chrome, Gmail, Maps and other properties) would remain popular and lucrative, but possibly far less so than they are today.

That’s the threat. But the Assistant also presents Google with a delicious opportunity. The “Star Trek” computer is no metaphor. The company believes that machine learning has advanced to the point that it is now possible to build a predictive, all-knowing, super helpful and conversational assistant of the sort that Captain Kirk relied on to navigate the stars.

Ubiquitous and super helpful

The Assistant, in Google’s most far-out vision, would always be around, wherever you are, on whatever device you use, to handle just about any informational task.

Consider this common situation: Today, to book a trip, you usually have to load up several travel sites, consult your calendar and coordinate with your family and your colleagues. If the Assistant works as well as Google hopes, all you might have to do is say, “O.K., Google, I need to go to Hong Kong next week. Take care of it.”

Based on your interactions with it over the years, Google would know your habits, your preferences and your budget. It would know your friends, family and your colleagues. With access to so much data, and with the computational power to interpret all of it, the Assistant most likely could handle the entire task; if it couldn’t, it would simply ask you to fill in the gaps, the way a human assistant might.

Computers have made a lot of everyday tasks far easier to accomplish, yet they still require a sometimes annoying level of human involvement to get the most out of them. The Assistant’s long-term aim is to eliminate all this busywork.

If it succeeds, it would be the ultimate expression of what Larry Page, Google’s co-founder, once described as the perfect search engine: a machine that “understands exactly what you mean and gives you back exactly what you want.”

At this point, a few readers may be recoiling at the potential invasion of autonomy and privacy that such a machine would necessitate.

Giving ourselves over to machines

The Assistant would involve giving ourselves over to machines more fully. We would trust them not just with our information but increasingly with our decisions. Many people are already freaked out by what Google, Facebook and other tech companies know about us. Would we be willing to hand over even more power to computers?

Those are important questions, but they are also well down the road. For now, the more pressing question for the Assistant is: Will it even work?

Google has technological advantages that suggest it could build a more capable digital assistant than others have accomplished. Many of the innovations that it has built into its search engine — including its knowledge graph database of more than a billion people, places and things, and the 17 years it has spent trying to understand the meaning of web queries — will form the Assistant’s brain.

Machine learning

Google has also been one of the leaders in machine learning, the process that allows computers to discover facts about the world without being explicitly programmed. Machine learning is at the heart of a number of recent advances, including Google Photos’ uncanny capacity to search through your images for arbitrary terms (photos of people hugging, for instance).

“We are in the process of transforming into a machine-learning company,” Jeff Dean, who is in charge of Google Brain, the company’s artificial intelligence project, told me this year. For each problem Google solves this way, it gets better at solving other problems. “It’s a boulder going downhill gathering more momentum as it goes,” Dean said.

If you use the Assistant today, you’ll see some of these advances. As my colleague Brian X. Chen explained last week, if your friend sends you a picture of his dog on Allo, Google Assistant will not only recognize that it’s a dog, but it will also tell you the breed.

That’s an amazing technological feat. But as Brian pointed out, it’s also pretty useless. Why does your friend care if you know his dog’s a Shih Tzu?

What about charm?

This gets to a deeper difficulty. The search company might have the technical capacity to create the smartest assistant around, but it’s not at all clear that it has the prowess to create the friendliest, most charming or most useful assistant. Google needs to nail not just Assistant’s smarts, but also its personality — a new skill for Google, and one that its past forays into social software (Google Plus, anyone?) have not been known for.

Then there is the mismatch between Google’s ambitions and Assistant’s current reality. Danny Sullivan, the founding editor of Search Engine Land, told me that so far, he hadn’t noticed the Assistant helping him in any major way.

“When I was trying to book a movie, it didn’t really narrow things down for me,” he said. “And there were some times it was wrong. I asked it to show me my upcoming trip, and it didn’t get that.”

Of course, it’s still early. Sullivan has high hopes for the Assistant. It would be premature to look at the technology today and get discouraged about its future, especially since Google sees this as a multiyear, perhaps even decade-long project. And especially if Google’s future depends on getting this right.