FlowiseAI / Flowise

Drag & drop UI to build your customized LLM flow

Home Page:https://flowiseai.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to upsert a pdf file in particular collection and then retrieving answers specifically from it

anushvst opened this issue · comments

I made a web app where users upload a pdf file. I want the app such that when user A uploads a file, it should be stored in collection A and when users asks questions it should answer from collection A specifically. There would be N number of users. The question answering should not be mixed up and answers should be from the collection of that users only. Please help ASAP. I'm in an emergency situation @HenryHengZJ.

Frontend: Next.js
Backend: FastAPI
QA: Flowise AI
Database(relational and vector): PostgreSQL

@anushvst Create different collections for different users.

@anushvst You can use the metadata filter on the vector stores. Just assign the userID or a conversationID as metadata to the vector when it is being upserted, and then when you retrieve it you can filter the collection with the metadata value you assigned. That way it will only retrieve the relevant vectors. With this approach, all uploaded files are in the same collection.

There is an example of how to do this in the Flowise Marketplace called "Metadata Filter" and also something similar in the docs https://docs.flowiseai.com/use-cases/multiple-documents-qna.

@alexfrass @govind-kumarr @HenryHengZJ

I made a web app where users upload a pdf file.

My flow is this. The user asks question in the next.js UI. The question is sent to backend in fastapi. The question is then sent via API to flowise and then flowise generates answer and sends to fastapi and to the UI.

I understand but metadata filtering is a manual process from flowise. How can I send parameters via API to flowise from my backed like metadata for upserting and while retrieving how to set parameters while retrieving via backend code

currently via overriding flowise parameter, it is giving answers from other collections but not from a particular user collection

Frontend: Next.js
Backend: FastAPI
QA: Flowise AI
Database(relational and vector): PostgreSQL