Amazon is adding 2,000 jobs to its Boston tech hub in fields including cloud computing and speech science, the company announced Tuesday.

Boston is one of the tech giant's largest footholds and is a finalist to win the company's second headquarters. Amazon has been paying visits to each of the 20 North American finalists.

Amazon said Tuesday it's invested more than $400 million in Massachusetts since 2011, adding corporate offices and fulfillment centers.

"In just a few years, we've grown from a handful of software developers and scientists to a team of more than 1,200, inventing new capabilities and products on behalf of millions of customers around the world," Rohit Prasad, Amazon's Boston-based head scientist for Alexa, said in a statement.

The Amazon Alexa smart assistant faces growing competition from Google's and Apple's versions. Smart assistants are increasingly taking on new and complex tasks, with Amazon announcing last week that Alexa would soon gain memory and hold contextual conversations.

The Boston jobs news follows a similar announcement on Monday in which Canadian Prime Minister Justin Trudeau said Amazon would be adding 3,000 jobs in Vancouver, British Columbia.