|
| 1 | +## Overview |
| 2 | + |
| 3 | +**Keryx** is a voice speaker for the [Hermes agent](https://github.com/NousResearch/hermes-agent). |
| 4 | +A [XIAO ESP32S3](https://wiki.seeedstudio.com/xiao_esp32s3_getting_started/) riding on a |
| 5 | +[Seeed reSpeaker Flex XVF3800](https://wiki.seeedstudio.com/respeaker_flex_introduction/) |
| 6 | +four-microphone array listens for "Hey Keryx" on the device itself; once it hears the wake |
| 7 | +word, the request goes over Wi-Fi to a small voice bridge running next to Hermes, and the |
| 8 | +answer comes back as speech out of the speaker. The first unit is built into an Edifier R1100, |
| 9 | +with an LED-ring clock behind the grille and a knob on the back. *Keryx* (κῆρυξ) is Greek for |
| 10 | +a herald, the one who speaks aloud for Hermes. |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +## Why it exists |
| 15 | + |
| 16 | +Hermes is a capable agent with its own tools, memory, and skills, reached through an |
| 17 | +OpenAI-compatible API. Keryx gives it a mouth and ears in the room: no phone, no laptop, no |
| 18 | +app. The design puts the wake word on the board rather than in the cloud, so nothing leaves |
| 19 | +the room until "Hey Keryx" is actually said, and it keeps the heavy speech models off the |
| 20 | +Raspberry Pi next to Hermes by calling cloud speech-to-text and text-to-speech instead. |
| 21 | +It is also a conversation rather than a command line: after the wake word a follow-up needs |
| 22 | +no wake word, talking over an answer stops it, and a few seconds of silence end the exchange. |
| 23 | +Hermes can also speak first, which is what makes reminders and timers work. |
| 24 | + |
| 25 | +## How it works |
| 26 | + |
| 27 | +The board handles audio and the wake word; the bridge handles speech and Hermes. |
| 28 | + |
| 29 | +- **On the board.** The XVF3800 does the acoustic work in hardware: it cancels Keryx's own |
| 30 | + playback from the microphones (its output line is the echo reference), beam-forms towards |
| 31 | + the talker, and suppresses noise. Its ASR channel is decimated from 48 to 16 kHz with the |
| 32 | + same filter the training audio went through, fed into the TFLite Micro micro_speech |
| 33 | + frontend and a streaming wake-word model written out as plain float C. Each 30 ms only the |
| 34 | + newest outputs of every layer are recomputed, which costs roughly 0.5 ms per 5 ms block of |
| 35 | + audio. The same firmware is also a USB Audio Class sound card, which is how the training |
| 36 | + recordings were captured. |
| 37 | +- **Over Wi-Fi.** The board holds a WebSocket to the bridge and streams the microphone there |
| 38 | + after a detection. |
| 39 | +- **On the bridge.** A Python service turns the stream into text with xAI's streaming |
| 40 | + speech-to-text, asks Hermes over its OpenAI-compatible API, reads the answer with xAI |
| 41 | + text-to-speech, and streams the audio back for playback. It also hands Hermes `say.sh` and |
| 42 | + `set_volume.sh`, so the agent can start a conversation of its own. |
| 43 | + |
| 44 | +End of sentence to first sound is about a second, plus Hermes' own thinking time. Speech runs |
| 45 | +around **$0.004 per exchange**. |
| 46 | + |
| 47 | +Installation is one script on the machine that will run the bridge, with the board on USB: |
| 48 | + |
| 49 | +```bash |
| 50 | +git clone https://github.com/Flopsstuff/keryx.git && cd keryx |
| 51 | +./setup.sh |
| 52 | +``` |
| 53 | + |
| 54 | +`setup.sh` installs the bridge as a systemd service, asks for the keys, flashes the board, and |
| 55 | +pairs it over Wi-Fi. After that the board runs off any USB power supply. The XVF3800 needs |
| 56 | +Seeed's I2S firmware flashed once before any of this. |
| 57 | + |
| 58 | +## Technical details |
| 59 | + |
| 60 | +| Aspect | Detail | |
| 61 | +| --- | --- | |
| 62 | +| Hardware | reSpeaker Flex XVF3800 + XIAO ESP32S3, U.FL Wi-Fi antenna; 3.5 mm output, or a 4 Ohm speaker on the JST amplifier output with 12 V in | |
| 63 | +| Firmware | ESP-IDF, C/C++ - wake word, USB Audio Class sound card, Wi-Fi link, OTA, LED panel, serial console | |
| 64 | +| Wake word | microWakeWord-style streaming model trained mostly on xAI-synthesized speech (28 voices, accents, speech tags) plus real takes through the board; exported to C weights | |
| 65 | +| Bridge | Python 3.10+, installed into its own venv as `keryx-bridge` with a systemd user service | |
| 66 | +| Speech | xAI streaming STT and WebSocket TTS - chosen on measured latency (STT ~0.9-1.2 s, TTS ~360 ms to first audio with the socket already open) and cost | |
| 67 | +| Agent | Hermes with its API server enabled, reached over its OpenAI-compatible API | |
| 68 | +| Enclosure | Built into an Edifier R1100; printed mic hat and encoder knob as parametric Onshape features with STLs | |
| 69 | +| License | Apache-2.0; vendored `micro_frontend` (Apache-2.0, with KISS FFT BSD-3-Clause) and `usb_device_uac` (Espressif, Apache-2.0) keep their own | |
| 70 | + |
| 71 | +Status: work in progress. |
| 72 | + |
| 73 | +## Links |
| 74 | + |
| 75 | +- [Repository](https://github.com/Flopsstuff/keryx) |
| 76 | +- [Documentation map](https://github.com/Flopsstuff/keryx/blob/main/docs/index.md) |
| 77 | +- [Assembly into the Edifier R1100](https://github.com/Flopsstuff/keryx/blob/main/docs/assembly.md) |
| 78 | +- [Speech providers: what was measured and why xAI](https://github.com/Flopsstuff/keryx/blob/main/docs/speech-providers.md) |
| 79 | +- [Hermes agent](https://github.com/NousResearch/hermes-agent) |
| 80 | +- [reSpeaker Flex XVF3800](https://wiki.seeedstudio.com/respeaker_flex_introduction/) |
0 commit comments