Facebook is working on a voice assistant to rival the likes of Amazon's Alexa, Apple's Siri and the Google Assistant, according to several people familiar with the matter.

The tech company has been working on this new initiative since early 2018. The effort is coming out of the company's augmented reality and virtual reality group, a division that works on hardware, including the company's virtual reality Oculus headsets.

A team based out of Redmond, Washington, has been spearheading the effort to build the new AI assistant, according to two former Facebook employees who left the company in recent months. The effort is being lead by Ira Snyder, director of AR/VR and Facebook Assistant. That team has been contacting vendors in the smart speaker supply chain, according to two people familiar.

It's unclear how exactly Facebook envisions people using the assistant, but it could potentially be used on the company's Portal video chat smart speakers, the Oculus headsets or other future projects.

The Facebook assistant faces stiff competition. Amazon and Google are far ahead in the smart speaker market with 67% and 30% shares in the U.S. in 2018, respectively, according to eMarketer.

In 2015, Facebook released an AI assistant for its Messenger app called M. It was supposed to help users with smart suggestions, but the project depended heavily on the help of humans and never gained traction. Facebook killed the project last year.

The company in November began selling its Portal video chat device, which lets users place video calls using Facebook Messenger. Users can say "Hey Portal" to initiative very simple commands, but the device also comes equipped with Amazon's Alexa assistant to handle more complex tasks.

--CNBC's Jordan Novet contributed to this report.

WATCH: Here's how to see which apps have access to your Facebook data — and cut them off