Amazon and Microsoft are teaming up to get their virtual assistants to talk to each other.

The surprising partnership will mean Alexa and Cortana, the two voice-activated AI assistants from the respective companies, will be able to communicate with one another to access their respective features.

When the feature becomes available later in 2017, users will access one virtual assistant via the other (at least at first) by saying "Alexa, open Cortana," or "Cortana, open Alexa," then give their command.

In a statement, Microsoft CEO Satya Nadella said: "Ensuring Cortana is available for our customers everywhere and across any device is a key priority for us. Bringing Cortana's knowledge, Office 365 integration, commitments, and reminders to Alexa is a great step toward that goal."

Jeff Bezos, CEO of Amazon, said: "The world is big and so multifaceted. There are going to be multiple successful intelligent agents, each with access to different sets of data and with different specialized skill areas. Together, their strengths will complement each other and provide customers with a richer and even more helpful experience. It's great for Echo owners to get easy access to Cortana."

The two chief executives also discussed the partnership with The New York Times. Bezos said that he expected in the future, people would use different AI assistants for different things, saying: "I want [customers] to have access to as many of theses AIs as possible."

The pair said they hadn't talked to Apple or Google, who have Siri and Google Assistant, about joining forces — though Amazon and Microsoft would be open to it.

The virtual assistant space is intensely competitive right now. All the major players have one, and they're battling for dominance, attempting to bake theirs into as many devices as possible, from cars to fridges. Once you're locked into an ecosystem you're unlikely to change down the line, the logic goes.

This deal boosts both Amazon and Microsoft's offerings, giving them access to new functionality — particularly important as unlike Apple and Google, neither company has managed to make much headway in the mobile space.