I using Firebase as my data store. I have a Firestore data structure where documents in a parent collection (“organizations”) contain a subcollection (“rags”) that stores text chunks along with their corresponding vector embeddings.
I want to create a retriever that efficiently fetches the most relevant documents from a specific organization’s “rags” subcollection.
Here’s a simplified version of my current code:
const retrieverConfig = defineFirestoreRetriever({
name: 'retriever',
firestore: firestore,
collection: 'organizations',
...options,
embedder: textEmbeddingGecko
})
This won’t retrieve the vectors from the subcollection since it is only looking at the parent collection ‘organizations’.
How do I create a custom retriever to query the subcollection?