DEV Community

Cover image for Build a smart search bot for your phone
Amanda Fitch
Amanda Fitch

Posted on

Build a smart search bot for your phone

I was on my phone the other day and wanted to find everything and anything related to a hamster I used to know named Stinky. His memories remain in various photos, videos, journal entries and songs, but Stinky is no longer with us (he died a few years ago of old age). My phone's built-in search wasn't much help – it just looked for titles of files – so I decided to see what I could build myself without coding.

I conducted some research

First, I did a quick Google search to see what on-device models were available on Hugging Face:

I’m looking for a model on Hugging Face that I can put on my phone that lets me context search for video, audio, text, and photos.

And I received three strong leads:

  • Google Embeddinggemma 2: 740M parameters, 1.5 GB storage, 2GB RAM
  • Meta ImageBind: ~1.2B parameters, 2.5GB storage, 4GB RAM
  • NVIDIA Omni-Embed-Nemotron: ~3B–4.7B parameters, 9.5 GB storage, 8GB RAM

I chose to work with Embeddinggemma 2 since its size was small enough to run on a smartphone.

Finally, I thought about how I was going to get the app on my phone. I chose to use Flutter, a multi-platform mobile framework that is easy and fun to use. With my toolbox complete, I set out to build the personal search bot of my dreams.

I used these steps to build the app

On my laptop, I loaded up my agent command center, Antigravity, and passed it a prompt to create the app:

Create an app that can search my phone for a theme of my choice. The app should be able to search photos, videos, documents, and voice recordings on my phone and return a list of them that match my theme. I want to use Embeddinggemma 2 as my model and Flutter as my framework. Call the app Lark. Design it to be cheerful and fun.

45 minutes later, the first version of an app called Lark was complete, no coding required.

When I launched the app though, it didn't quite work. The AI agent had mocked the search experience and hadn't actually connected my app to a model. After some back and forth over a few hours, the model was properly connected and the mocked data removed. The resulting app was quite nice!

When I was finished, I wondered how easy it might be to connect this to Model Garden so I could free up 1.5GB on my device and use my app on all of my devices. I prompted Antigravity to do this and in 30 minutes I had a working gig!

3 things I learned building the app

Building a fully functional semantic search app without writing code was wild, but it definitely wasn't magic. If you're looking to build your own AI tools, here are my biggest takeaways:

  1. Don't fall for the mock data trap. Antigravity built a beautiful UI in just 45 minutes, but it was just a facade. AI had mocked the search experience instead of connecting the model. I had to explicitly request that it not use mock data to get what I needed.

  2. Pivoting from an on device model to a cloud hosted model is surprisingly easy. You don't have to lock yourself in one architecture. Switching stacks is much easier these days.

  3. Simple math is your friend on mobile. EmbeddingGemma 2 uses clever math optimizations that eliminate the need for heavy native dependencies that would have drained my phone's battery.

Barriers are vanishing

Projects like Lark prove that the barrier to entry for highly personalized software is vanishing. You no longer need an engineering team to solve a hyper-specific personal problem, you just need a bit of patience and the right prompts.

P.S.

Want to see what I built? Download the source code for the Lark app here. Take what you want, modify it into what you need, and if you build something cool, let me know!

~ Stinky (2021-2023) ~ Gone but not forgotten ~

Top comments (0)