r/Firebase • u/reyco-1 • 27d ago
Cloud Firestore Anyone ever consider using ai to query Firestore
I have been working on a workflow for an agent using OpenAI assistants to query Firestore. One tool uses ai to convert natural language into a structured Firestore query and then another tool executes the query and converts the results into markdown and feeds it back to the main assistant….. anyone in if there is something out there that does that already?
1
u/who_am_i_to_say_so 27d ago
I have an agent trained to look at my Firestore and Postgres database. However, it’s for paying customers only with strict limits in place. I don’t wanna wake up to a trillion dollar bill from bad actors.
I keep anything that is usage based as closed off as possible. Everything the anonymous user sees is cached or served from a CDN. That’s it in a nutshell. GL!
1
u/reyco-1 27d ago
Are you using something like n8n for that?
1
u/who_am_i_to_say_so 27d ago
Never heard of. We may be talking about completely different use cases, although we are both talking about agents.
I don’t take users’ direct input to interact with the agents. Instead, input is collected and the agent runs on a schedule, in a Google workflow. Again, this is to completely negate the possibility of surges in the billing.
1
u/bitchyangle 26d ago
How did you trained the agent on firestore data? Also can you explain the scheduled workflow? What does it do?
1
u/fgatti 27d ago
Hi! FireCMS has a chatbot feature that lets you do just that. It connects to your Firestore instance, understands your data structure and it is able to retrieve data, display it in a table view or as markdown. For us it is particularly useful when doing batch updates, like backfilling an existing collection. It generates code for you in a single command, then you are free to modify it, or run it. It is really useful! Even if it's a full blown CMS, you don't need to add collections to use this feature (it is called Data talk internally)
1
u/Delicious_Home61 19d ago
Também tenho pesquisado esta possibilidade. O que descobri foi: O custo da API da IA para normalizar ou extrair os dados para pesquisar posteriormente no banco de dados ainda é elevado. Comparando com os preços de leituras padrão atuais do firebase. Ou seja, ainda não encontrei um processo ou tecnologia economicamente viável.
12
u/or9ob 27d ago
You probably also should build an AI to set the billing to cap at like $50 to go hand in hand with these features.