Sorry for replying after 4 years, probably you have figured out the solution by now, but if anyone else stumble upon, here's the answer.
To achieve this, you have to ensure your microphone is always passively listening and when the listen codeword is triggered, here's the AI's name- then the system will actively listen to it. This is how it's usually built. You can keep on listening on a low powered mode, check any active package built using JavaScript and implement, you're good to go! Cheers.