run-llama / LlamaIndexTS

LlamaIndex in TypeScript
https://ts.llamaindex.ai
MIT License
1.82k stars 348 forks source link

Feature Request: limit document list for VectorStore query #888

Closed justinmann closed 2 months ago

justinmann commented 4 months ago

I have multiple bots each with a set of documents. I only want them to query their documents.

I am able to solve this by wrapping from VectorStore and replacing the query function to add additional filters to query to limit the document list. Alternatively, I could solve this by creating one index & one collection for each bot. Most providers have limits one indexes, which make this prohibitive.

marcusschiesser commented 4 months ago

as far as I remember a couple of VectorStore implementations that we have can be limited on a collection. Can you tell us how your ideal example code would look like and what vector store are you using?

marcusschiesser commented 2 months ago

@justinmann with release 0.5.5, you can use metadata filtering (see https://ts.llamaindex.ai/modules/query_engines/metadata_filtering) - does that fit your needs? if not please reopen the ticket