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

Using Multiple StorageContexts with VectorStoreIndex for Different Users ? #730

Open
leoz2007 opened this issue Apr 17, 2024 · 1 comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@leoz2007
Copy link

I'm looking into using multiple storage contexts for initializing VectorStoreIndex.
My dataset includes 20 documents, each relevant to particular users.

For instance, I'd like to set up a storage context with Documents A, B, and D for one user query, and Documents A, B, and F for another.

Is this feasible?
Should I generate all document vectors first and then apply metadata filters?

Additionally, how would I go about filtering these in ChatEngine?

@himself65 himself65 added good first issue Good for newcomers help wanted Extra attention is needed labels Apr 19, 2024
@marcusschiesser
Copy link
Collaborator

@leoz2007 I think you can add metadata to the documents that can be used to relate the user to the document and then query using that metadata. In the simplest case, that would be adding the userId to the metadata.

Here's an example of filtering by metadata: https://github.com/run-llama/LlamaIndexTS/blob/main/examples/chromadb/preFilters.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants