make rag to support embedded documents workspace #90
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Abstract
This submission is to make rag support embedding documents workspace. Currently, all embedded documents operations such as obtaining all documents, performing similarity search and removing documents, are preformed across all embedded documents in vector store. With this submission, an embedded documents workspace (essentially a list of embedded document IDs) will be passed to rag, which is used to define the scope for all operations. If no workspace (i.e.,
None
) passed in, all operations will be considered to be performed across all documents as before.Besides introducing embedded documents workspace, this submission also moved xinference importing back to XinferenceDocumentEmbedder constructor. Previously, the xinference importing was moved to the beginning of the file to facilitate unit tests. However, this unexpectedly increased the size of biochatter-server docker image, even if xinference was not yet needed. By moving it back, it optimizes biochatter-server docker size and ensures that xinference is only imported when necessary.