avatar
Published on

RAG with Gemini and Firebase DataConnect

I built a simple notes app in which users can chat with their notes as well and ask questions. The response is generated by an LLM whose prompt is augmented with the similar notes retrieved by a vector search.

I am using Firebase DataConnect to store the notes and their embeddings. And I am using Gemini to power the RAG.

Firebase DataConnect is a new product from Firebase (currently in public preview) that can help embed the content of your data and store it as vector embeddings. You can perform vector similarity searches on top of it. It is a service built on top of Postgres database.

I am still figuring out some of the parameters for the vector search, such as:

  1. method: cosine, L2, or dot product
  2. within which distance to search for similar notes
  3. limit number of notes to retrieve

I need to do a deeper understanding of these parameters to get the best results. But so far the results are looking good.

Here's the link to the app: https://notes-web-app--ai-notes-e3a37.us-central1.hosted.app/

Users can sign in with their Google account to use the app.

Will continue to work on this and share my learnings here.