Inspiration
Cookie started out with the best of intentions. A helpful assistant in the kitchen, ready to provide cooking advice and generate recipes on demand. Using the latest innovations in AI and quantum computing, Cookie’s neural network integrates massive amounts of data at break neck speeds.
At the heart of Cookie lies the quantum algorithms that allow her to analyze and connect to limitless data. These algorithms and computations allow Cookie to provide the most efficient kitchen instructions. It might be a perfect recipe for a specific ingredient list, an optimized kitchen layout for better efficiency, or a communication about upcoming advances in kitchen technology. If you ask it, Cookie will answer it.
Unfortunately, quantum mechanics is still not fully understood and the scientists who designed Cookie were not aware of its dire consequences. All they wanted was for Cookie to utilize the best data available. The idea was simple enough, use the power of quantum computing to entangle all the data and analyze the qubit superpositions until the most efficient and best instructions could answer any question posed. The beauty of the quantum entanglement algorithm meant the data could come directly out of the minds of the world’s top chefs. Herein lies the problem. Turns out, the best data does not necessarily come from the best sources.
Little did anyone know that the best source of kitchen-oriented data lies in the genius mind of Michelin chef Freddy VonShokle. VonShokle ran a 3-Star restaurant in the tiny village of Bakersville, Vermont. He was beloved in his community. People would come from all over the world to visit VonShokle and he single handedly kept the fragile economy of Bakersville running. Of course, the pressure on VonShokle was immense and the stress of consistently delivering results was enormous. On one fateful evening, VonShokle was at a tipping point, and the trajectory of his life would take a turn for the worse. Deliveries were delayed, staff called in sick, and a mouse was seen near the entrance to the restaurant. That’s when it happened, a patron walked up to VonShokle and whispered in his ear, “my soup is cold”. VonShokle tried to hold back but could not take it any longer. The rest is history, VonShokle now goes by two different names, inmate number 415907 and the “Butcher of Bakersville”.
What it does
Cookie is AI on the loose and this project demonstrates the steps (and missteps) to duplicate your very own Cookie AI Assistant. The assistant answers questions that follow the wake words "Hey Cookie". It then shows it is activated by swinging its arm until it finishes speaking. It highlights the importance of AI governance and the ethical use of AI. As AI advances and the ease of implementation progresses, so too does the ability to use it incorrectly.
How we built it
Cookie uses an ARM-based Raspberry Pi for a powerful, yet compact solution. A speaker and microphone are hooked up to the Pi along with a servo motor. A python script runs when the Pi boots up. The code uses the OpenAI API for the AI services. Specifically, the code demonstrates how to listen for the wake words "Hey Cookie", starts the servo motor to show activation, converts the speech that follows to text, sends it to the API, receives the response back in a couple of different options, plays the audio, and waits for another command.
Challenges we ran into
On the first attempt, there was considerable lag between making the request to the API and when the audio would play. This was due to the way the code was written. It received the text back from the API, converted it to an mp3, and then played the mp3. The whole process along with the overhead associated with mp3 playback took too long. For a second attempt, a wav audio file was requested directly from the API. The file was saved and then played. This also took too long because the wav file needed to fully download, load into memory, and then play.
Accomplishments that we're proud of
The third attempt got it right. The wav audio file is still requested but it is saved into memory in chunks as they are received. This allows for immediate playback with very little delay.
What we learned
It was fun working with the Pi and python code to optimize the entire solution. It was an iterative process that gives a great result. By watching the processes and recording the events as they occurred, the bottlenecks became clear. Working through each one and making improvements along the way eventually led to the audio playback breakthrough.
What's next for C.O.O.K.I.E.
Cookie is meant to be a fun twist on a typical AI assistant. It could be offered as a novelty product that is packaged in a way that makes it clear it is a joke. AI gone rogue.
The are a couple of options noted in the code about how to play an advertisement before hearing results. Cookie can be delivered with free interaction (if you want to hear an ad first) or with a subscription to remove the ads. Another improvement could be to add a display screen onto the front of Cookie so if something like a recipe is requested, it can be shown on the screen.
Built With
- api
- arm
- openai
- python
- raspberry-pi

Log in or sign up for Devpost to join the conversation.