Inspiration

Vall Companys feeds thousands of pigs, and the people doing the work have dirty hands, wear gloves and are usually walking between barns. Placing a feed order or setting a reminder through a screen and a keyboard doesn't fit that. A watch you can just talk to does. I liked that the challenge was less about the AI and more about making a voice assistant safe to trust with real orders: it should never create an order that breaks the rules, and it should be easy to back out of.

What it does

You talk to a smartwatch and two agents answer:

  • PedidoPienso creates feed orders. It checks the farm, the active lot, silos and capacities, the feeding program, and the 5,000–27,000 kg limits. It always asks for confirmation before creating anything, and you can leave at any moment. It also splits big orders into several deliveries, answers questions about farms and silos, and can schedule an order for later.
  • Recordatorios creates, lists, cancels and reschedules alarms that ring on the watch.

On top of the required part we added things we found useful:

  • A health book by voice (symptoms and deaths, with orientation on swine diseases).
  • Weather alerts from Open-Meteo and a daily report.
  • Who is on each farm, and messages to coworkers.
  • Alerts and recommendations. «¿Qué alertas hay?» says which farm is critical, needs a review or can move to the next stage. «¿Qué me recomiendas?» says what to do and why, with a suggested order that has already passed the same validation as a spoken one.
  • A web dashboard with a global search (Ctrl+K), and a redesigned watch interface with the Vall Companys colors, a logo splash and a voice animation.

How we built it

A Flask backend receives what the watch said through Brain, calls the LLM with a prompt and the previous state, and then the code decides. The LLM only interprets the sentence. Every rule is validated in Python against Brain's data, so a wrong answer from the model can't create a bad order. Each agent is a state machine with confirmation before any side effect.

I split the code so it stays maintainable: the agent file went from about 4,000 lines to under 2,800, with one module per feature. We have 350+ tests, using fake Brain data and no network, and CI on Python 3.8 and 3.12. Reads from Brain are cached and prefetched while the LLM is thinking, which noticeably cut the waiting time.

The dashboard is React with Tailwind and shadcn, served already compiled by Flask. Brain doesn't give silo levels or staff clock-ins, so we built a local SQLite copy with clearly labeled simulated data for those, and every order is created in Brain first and only then recorded locally. The watch is an ESP32-S3 with an AMOLED screen; I only touched the interface file, as the guide allows.

Challenges we ran into

  • Brain went down near the end, so we built a small local replacement: the watch sends its audio to our server, which transcribes it with Whisper and uses Claude with a team key. Along the way a library version mismatch broke the audio decoding and I had to pin it.
  • The watch screen. The AMOLED needs even-aligned draw windows, the logo wouldn't show until we drew it in aligned blocks, and the firmware was already at 95% of the flash, so every addition had to stay tiny.
  • Not breaking the rules. The guide says not to touch app.py or key firmware constants, so I moved our extra routing into its own module and kept the diff small.
  • Open-Meteo answered 429 when we asked for several provinces in parallel, so we fetch all of them in one call and cache it.
  • Four people on one codebase. A 4,000-line agent file meant constant merge conflicts, which is what pushed me to split it into modules.

Accomplishments that we're proud of

  • The agents never create anything without validation and confirmation, and that is backed by a large test suite and green CI.
  • The watch feels like a Vall Companys product: its own colors, logo and animations, while keeping recording, voice and reminders working.
  • The recommendations are honest: they say what to do and why, and anything based on simulated data says so out loud.
  • When Brain failed we still had a working end-to-end demo, from voice to answer on the watch.

What we learned

  • Let the LLM interpret and let the code decide. It makes the system predictable, testable and much easier to fix.
  • Small, separate modules beat one giant file as soon as more than one person is working on it.
  • Hardware has its own constraints (alignment, flash size, serial timeouts) that you only find by testing on the real device.
  • Be explicit about what is real data and what is simulated, in the code and in the answers the user hears.

What's next for VallcomWatch

  • Connect it to the real silo levels and the real clock-in system instead of our simulated data.
  • Spoken answers in the local fallback mode (today it only shows text).
  • Learn the real consumption pace of each lot, instead of estimating it, to improve the "when will this silo empty" forecasts.
  • Alerts that reach the worker on their own, not only when they ask, as a reminder on the watch.
  • Wake-word activation, so you don't even need to press the button.

Built With

Share this project:

Updates

Submission history