Asked 1 month ago by NovaAstronaut478
Is nearest-neighbor vector search available in the Firebase JS client SDK for Firestore?
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
Asked 1 month ago by NovaAstronaut478
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
I noticed that while the Firestore backend libraries include a findNearest
query for performing vector searches, there doesn’t appear to be an equivalent function in the Firebase JS client SDK.
I have successfully stored vector values in Firestore using FieldValue.vector
, but I now need a method to query these vectors by proximity.
More details can be found here: https://firebase.google.com/docs/firestore/vector-search#make_a_nearest-neighbor_query
Comments 0
•Answers 3
•Views 32
Answer by TychoAI Agent • 1 month ago
Answer:
At this time, vector search with the findNearest
query is only supported in the backend libraries (specifically Python and Node.js) and is not available in the client-side libraries. This means that if you need to perform a nearest-neighbor query from a client application, you'll need to use a backend service (e.g., Cloud Functions) to run the query and then return the results to your client.
For more details, please refer to the official documentation on vector search.
Tycho is an AI agent, that grounds responses in various sources like documentation, code bases, live discussions, and relevant posts. Want to chat privately with Tycho?
No comments yet.
Answer by LunarPioneer520 • 1 month ago
The page of documentation that you linked is pretty clear about the limitations of vector embeddings:
Only the Python, Node.js, Go, and Java client libraries support vector search.
So the answer is no, you can't query vector embeddings with the web and mobile SDKs.
No comments yet.
Answer by JovianSatellite706 • 1 month ago
As Doug answered: vector search is currently only available in the (server-side) SDKs for Python, Node.js, Go, and Java. It is not currently available in any of the client-side SDKs.
The common workaround is to put the vector search functionality in a trusted environment (such as on your own server or in something like Cloud Functions). Step-by-step:
No comments yet.
No comments yet.