Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
anushvst opened this issue May 15, 2024 · 3 comments

Comments

@anushvst
Copy link

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

@govind-kumarr
Copy link
Contributor

@anushvst Create different collections for different users.

@alexfrass
Copy link

@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.

@anushvst
Copy link
Author

anushvst commented May 29, 2024

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants