A Customizable, Offline-First AI Agent for Raspberry Pi
This project turns a Raspberry Pi into a fully functional, conversational AI agent. Unlike cloud-based assistants, this agent runs 100% locally on your device. It listens for a wake word, processes speech, "thinks" using a local Large Language Model (LLM), and speaks back with a low-latency neural voiceβall while displaying reactive face animations.
It is designed as a blank canvas: You can easily swap the face images and sound effects to create your own character!
- 100% Local Intelligence: Powered by Ollama (LLM) and Whisper.cpp (Speech-to-Text). No API fees, no cloud data usage.
- Open Source Wake Word: Wakes up to your custom model using OpenWakeWord (Offline & Free). No access keys required.
- Hardware-Aware Audio: Automatically detects your microphone's sample rate and resamples audio on the fly to prevent ALSA errors.
- Smart Web Search: Uses DuckDuckGo to find real-time news and information when the LLM doesn't know the answer.
- Reactive Faces: The GUI updates the character's face based on its state (Listening, Thinking, Speaking, Idle).
- Fast Text-to-Speech: Uses Piper TTS for low-latency, high-quality voice generation on the Pi.
- Vision Capable: Can "see" and describe the world using a connected camera and the Moondream vision model.
- Raspberry Pi 5 (Recommended) or Pi 4 (4GB RAM minimum)
- USB Microphone & Speaker
- LCD Screen (DSI or HDMI)
- Raspberry Pi Camera Module
be-more-agent/
βββ agent.py # The main brain script
βββ setup.sh # Auto-installer script
βββ wakeword.onnx # OpenWakeWord model (The "Ear")
βββ config.json # User settings (Models, Prompt, Hardware)
βββ memory.json # Conversation history (created at runtime)
βββ requirements.txt # Python dependencies
βββ whisper.cpp/ # Speech-to-Text engine
βββ piper/ # Piper TTS engine & voice models
βββ sounds/ # Sound effects folder
β βββ greeting_sounds/ # Startup .wav files
β βββ thinking_sounds/ # Looping .wav files
β βββ ack_sounds/ # "I heard you" .wav files
β βββ error_sounds/ # Error/Confusion .wav files
βββ faces/ # Face images folder
βββ idle/ # .png sequence for idle state
βββ listening/ # .png sequence for listening
βββ thinking/ # .png sequence for thinking
βββ speaking/ # .png sequence for speaking
βββ error/ # .png sequence for errors
βββ warmup/ # .png sequence for startup
Ensure your Raspberry Pi OS is up to date.
sudo apt update && sudo apt upgrade -y
sudo apt install git -yThis agent relies on Ollama to run the brain.
curl -fsSL https://ollama.com/install.sh| shPull the required models:
ollama pull gemma3:1b
ollama pull moondreamgit clone https://github.com/brenpoly/be-more-agent.git
cd be-more-agent
chmod +x setup.sh
./setup.shThe setup script will install system libraries, create necessary folders, build Whisper.cpp (speech-to-text), download Piper TTS and the BMO voice, and set up the Python virtual environment. Building Whisper takes a few minutes on a Pi.
The repo includes a "Hey BMO" wake word model (wakeword.onnx). If that file is missing, the setup script downloads OpenWakeWord's "Hey Jarvis" model instead. To use your own:
- Train a model at OpenWakeWord.
- Place the
.onnxfile in the root folder. - Rename it to
wakeword.onnx.
source venv/bin/activate
python agent.pyYou can modify the hardware behavior and personality in config.json. If it's missing, agent.py uses built-in defaults. A minimal example:
{
"text_model": "gemma3:1b",
"vision_model": "moondream",
"voice_model": "voices/bmo.onnx",
"chat_memory": true,
"camera_rotation": 0,
"system_prompt_extras": "You are a helpful robot assistant. Keep responses short and cute."
}system_prompt(optional) replaces the built-in personality and tool instructions;system_prompt_extrasis added to the end of whichever prompt is used. Changes take effect on the next start.chat_memory: set tofalseto stop saving the conversation tomemory.jsonbetween runs.voice_model: if the file is missing, the default Piper voice (piper/en_GB-semaine-medium.onnx) is used.
This software is a generic framework. You can give it a new personality by replacing the assets:
- Faces: The script looks for PNG sequences in
faces/[state]/. It will loop through all images found in the folder. - Sounds: Put multiple
.wavfiles in thesounds/[category]/folders. The robot will pick one at random each time (e.g., different "thinking" hums or "error" buzzes).
This project features a custom, locally fine-tuned text-to-speech model to make the agent sound authentic!
When you run the setup.sh script, it will automatically download the compiled .onnx model and its .json configuration file from the Releases page and place them into a local voices/ directory.
Manual Installation (if you are not using setup.sh):
- Download
bmo.onnxandbmo.onnx.jsonfrom the voice release (v1.0-voice). - Create a folder named
voices/in the root directory of this repository. - Place both downloaded files inside the
voices/folder. - Ensure your
config.jsonfile points to the new model:"voice_model": "voices/bmo.onnx"
- "No search library found": If web search fails, ensure you are in the virtual environment and
duckduckgo-searchis installed via pip. - Shutdown Errors: When you exit the script (Ctrl+C), you might see
Expression 'alsa_snd_pcm_mmap_begin' failed. This is normal. It just means the audio stream was cut off mid-sample. It does not affect the functionality. - Audio Glitches: If the voice sounds fast or slow, the script attempts to auto-detect sample rates. Ensure your
config.jsonpoints to a valid.onnxvoice model in thepiper/folder. If your custom BMO voice sounds incredibly deep, slow, or "demonic," don't panic! This is not an issue with the Piper installation or the setup script. It is almost always caused by a Sample Rate (Hz) mismatch between the model and the audio player.
Here is how to fix it:
Fix 1: Check the Sample Rate file
agent.py reads the voice's sample rate from the .onnx.json file next to the model (e.g., voices/bmo.onnx.json) and plays audio at that rate. If the .json file is missing or unreadable, it falls back to 22050 Hz, which makes 16000 Hz or 48000 Hz voices sound too slow or too fast.
- Make sure
voices/bmo.onnx.json(or your model's.json) sits next to the.onnxfile with the same name plus.json. - Open it and check that
"audio": {"sample_rate": ...}matches the rate the model was trained at. - Restart the agent; it prints
[VOICE] ... not foundif it fell back to the default voice.
Fix 2: Check the Length Scale If the sample rates match perfectly, the issue might be the model's internal pacing setting.
- Open your
voices/bmo.onnx.jsonfile. - Look inside the
"inference"block for a setting called"length_scale". - Piper uses this to determine the speed of the voice. If this value is set significantly higher than
1.0, it will stretch the audio and make BMO sound like a zombie. Lower it closer to1.0to speed the voice back up to normal.
This project is dual-licensed:
- Software / Code: All source code is licensed under the MIT License.
- Hardware / 3D Models: The
.obj,.stl, and other 3D modeling files associated with the physical case are licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
Disclaimer: Fan Project This repository and the associated voice model are a non-commercial, open-source fan project. "BMO" and Adventure Time are registered trademarks and copyrights of Cartoon Network and Warner Bros. Discovery. This project is not affiliated with, endorsed by, or sponsored by Cartoon Network or its parent companies.
Voice Model Attribution The text-to-speech capabilities of this project are powered by Piper. The custom voice model was fine-tuned locally using Piper's base "Amy" model (en_US-amy-medium). The original Piper engine and base models are developed by the Rhasspy project and distributed under the MIT License.