Inspiration
It started with a very annoying task. Our quality manager asked me to go through all the Excel result files from the entire year and collect sample codes manually. As someone who studied data science and programming, I refused to do it by hand — so I wrote a quick script to loop through all the files and extract what we needed. But while the script was running, I stopped and thought: what if anyone in the lab could do this just by typing a question? No code, no Excel, no IT request. That thought became LARS — a chatbot that lets lab staff query pesticide residue data in plain language. I built it for our lab, and it worked well. Then I found this hackathon and saw an opportunity to take it further: from a text chatbot to a real-time voice agent that lets a lab manager or chemist just speak their question and get an instant answer. LARS fixes that. You just ask.
What it does
LARS is a deterministic lab query engine with a voice interface. You speak naturally — Gemini Live captures your voice and extracts intent and entities. LARS Engine translates that into a constrained, validated query plan and executes deterministic SQL against real GC-MS/MS and LC-MS/MS laboratory results. The LLM never touches the data directly — it only interprets language. This architecture reduces hallucination risk and produces answers you can trust in a regulatory environment.
How we built it
The architecture has two layers. The frontend uses Google Gemini Live API for real-time bidirectional audio — the same technology that powers Google's most advanced voice assistants. The backend is a FastAPI server that bridges Gemini to LARS, a private query engine I built that understands natural language questions about pesticide data and translates them into precise database queries against a DuckDB instance containing real laboratory results. The whole thing runs on Google Cloud Run with Vertex AI handling the Gemini connection. The LLM layer is strictly limited to language understanding — intent detection and entity extraction. All data access is deterministic: constrained queries, validated dimensions, and verified results from the DuckDB lab database.
Challenges we ran into
Getting Gemini Live's tool calling to work reliably over WebSocket was the hardest part. Tool responses had to be normalized in a specific way, and stale responses after user interruptions caused session crashes. Each one took careful debugging. The other challenge was language — making LARS respond in the same language the user speaks. If the question is in English, answer in English. If it's in Arabic, answer in Arabic. Getting Gemini Live to follow this consistently required careful prompt engineering.
Accomplishments that we're proud of
A real lab problem solved with real lab data, not a demo dataset Voice queries answered in under 3 seconds end-to-end Bilingual support - Arabic and English in the same session Deployed and live on Google Cloud Run, accessible from any device
What we learned
Real-time voice AI is much harder than it looks. Latency, interruption handling, tool call timing — every small detail affects the experience. I also learned that prompt engineering for a voice agent is completely different from a text chatbot. The responses need to be concise, natural to hear, and work in two languages at the same time. Most importantly, I learned that the best ideas come from real problems. I didn't start with a hackathon in mind — I started with an annoying Excel task.
What's next for LARS — Laboratory Analysis and Risk System
Connecting LARS to more food safety datasets across the region Adding proactive alerts — LARS notifies the manager when a new violation is detected without being asked Making it available to other food safety labs in Saudi Arabia as a service
Built With
- duckdb
- fastapi
- google-cloud-run
- google-gemini-live-api
- javascript
- python
- vertex-ai
- vite
- web-audio-api

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