Okay, let’s be real for a second. Tossing a basic frontend on top of an AI chat API is something you can almost do in your sleep now. But what about building something that actually understands the messy, personal stuff? I’m talking about blood sugar numbers, specific calorie burns, real dietary limits—not just generic wellness platitudes.
That was the puzzle I wanted to solve. I just open-sourced a project called Acara Plate, a platform for personalized nutrition, and my goal felt pretty straightforward. I wanted to move past the “eat your vegetables” advice and create an assistant that could genuinely work with someone’s unique body data. The catch? I really, really didn't want to get buried in infrastructure management for weeks on end.
Here’s the story of how I built it using Laravel and, in a way, completely bypassed the need for a vector database by using Gemini’s file search. It was a bit of a different path, and it worked better than I expected.
The First Hurdle: Stopping the AI from Making Things Up
This is arguably the scariest part of building for health. You cannot have a language model, which is basically a super-powered pattern guesser, casually inventing a food suggestion that could mess with someone's condition. The risk of hallucination is very real.
My solution was to put the AI in a structured box. Instead of having a friendly conversation and hoping for the best, my code forces a very specific, rigid format for the response. I tell it to return data only as a JSON object that matches my exact blueprint. Then, the Laravel backend acts as a strict math teacher, checking every calorie and gram before anything reaches a person. If the numbers don’t add up, the system just tosses that plan out and asks the AI to try again. It’s a way of making sure the creative engine is guided by unbreakable rules.
The Big Infrastructure Skip: No Vector DB Required
Now, to give useful advice, the AI needs access to a mountain of facts—in this case, the entire USDA food database. The traditional playbook here is a real chore: you chunk the giant dataset, you set up a vector database to store and search it, and you write a bunch of retrieval logic. It’s a lot.
What I did felt like finding a hidden door. Gemini has this built-in feature called File Search. So, I just uploaded the massive USDA files directly to Gemini’s environment. The model itself holds onto the data and can search through its own understanding of it. When a user asks about iron-rich foods, for example, the AI just sifts through the information it already has on file. The upside is pretty huge: I avoided managing an entire database system, the whole setup took an afternoon, and the AI seems to get better context because it sees the full dataset relationship, not just isolated pieces.
Keeping Private Data Actually Private
When you’re dealing with someone’s personal health metrics, privacy isn’t a feature; it’s the foundation. Even as an open-source project, this had to be locked down. The architecture ensures data isolation so that users can only ever see their own information. But the key decision, I think, was putting the choice in the user’s hands. They can select which AI provider to use, or even provide their own API key. This means they have control over where their sensitive details are sent, which builds a necessary level of trust. The interface, built as a Progressive Web App with Inertia and React (Typescript), just feels like a normal app on your phone, which makes the whole experience a bit smoother.
Wrapping Up
This whole process showed me that you don’t necessarily need the most complex setup to build something both smart and safe. Sometimes, using a newer capability in a simpler way can cut out a ton of work. I wanted to prove that a small team or even a solo developer could create a high-stakes AI tool without getting lost in the infrastructure maze.
If you're curious about how the pieces fit together in code, you can check out the GitHub repository or try the live demo. And if you've found other ways to simplify building with AI, I'd honestly love to hear about it.
Try it Out
I built this to help developers learn how to integrate AI into complex domains like health. I’d love for you to check out the code, especially how the PrismPHP integration handles the prompt engineering.
📂 GitHub Repo: github.com/acara-app/plate
🚀 Live Demo: plate.acara.app
If you found this helpful, drop a star on the repo! ⭐
Top comments (0)