Retrieval-augmented generation (RAG) | ...
QQ:
1) In the following code, how do I specify a subcollection that's associated with a user so only that user's docs are vectorized? The documentation says "collection: Override the default collection to search for e.g. subcollection search." but doesn't provide an example.
const yourRetrieverRef = defineFirestoreRetriever({
name: "yourRetriever",
firestore: getFirestore(app),
collection: "yourCollection",
contentField: "yourDataChunks",
vectorField: "embedding",
embedder: textEmbeddingGecko, // Import from '@genkit-ai/googleai' or '@genkit-ai/vertexai'
distanceMeasure: "COSINE", // "EUCLIDEAN", "DOT_PRODUCT", or "COSINE" (default)
});
2) Am I able to index/vectorize say a bunch of txt files each on various topics all into the same subcollection from above so I can do retrivals on it? I am trying to see if Firebase can handle document chunking. Essentially curious if the example of ingesting menu PDFs can be done using Firestore as the vector store. https://firebase.google.com/docs/genkit/rag