There's certainly not enough space or technology inside most Echo speakers to hold a complex artificial intelligence, so how does Alexa answer questions?
As with many things these days, it's all thanks to the magic of the internet. What happens when you ask your Alexa-enabled device to do something is that it records what you're saying and sends it to Amazon's voice recognition service.
This service, known as Alexa Voice Service (AVS), figures out what you're asking for and quickly sends the correct information back to your device and plays it over the speakers.
There is a bit of voice recognition tech inside your Echo devices, but not much. Most of these devices are programmed to respond to one specific word at a time, and they're constantly listening out for it.
By default, this wake word is set to Alexa, but you can change it to other words, such as Echo, Amazon, or Computer. When you say this word, the small computer part of your Echo devices activates and starts recording your query to send to the AVS.
Where Does Alexa Get Information?
It's all well and good knowing that your questions are sent to the AVS, but how does it get the information that you've requested? That depends on your request. Any request that Amazon has thought of ahead of time will probably use an API or potentially built-in software to figure out your answer.
Information from here