mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #4839] [CLOSED] feat: implement interface for multiple vectorstores #21575
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/4839
Author: @pascallim
Created: 8/23/2024
Status: ❌ Closed
Base:
dev← Head:implement-multi-vectorstores📝 Commits (1)
235793cfeat: implement interface for multiple vectorstores with usage of Langchain classes📊 Changes
16 files changed (+948 additions, -418 deletions)
View changed files
📝
backend/open_webui/apps/ollama/main.py(+24 -52)➕
backend/open_webui/apps/rag/embedding_model.py(+66 -0)📝
backend/open_webui/apps/rag/main.py(+148 -130)📝
backend/open_webui/apps/rag/utils.py(+39 -158)➕
backend/open_webui/apps/rag/vector_store/__init__.py(+3 -0)➕
backend/open_webui/apps/rag/vector_store/implementations/__init__.py(+5 -0)➕
backend/open_webui/apps/rag/vector_store/implementations/chroma.py(+279 -0)➕
backend/open_webui/apps/rag/vector_store/implementations/milvus.py(+89 -0)➕
backend/open_webui/apps/rag/vector_store/implementations/pgvector.py(+94 -0)➕
backend/open_webui/apps/rag/vector_store/vector_store_connector.py(+54 -0)➕
backend/open_webui/apps/rag/vector_store/vector_store_extension.py(+34 -0)📝
backend/open_webui/apps/webui/routers/memories.py(+67 -39)📝
backend/open_webui/config.py(+4 -39)📝
backend/open_webui/env.py(+30 -0)📝
backend/requirements.txt(+6 -0)📝
pyproject.toml(+6 -0)📄 Description
Pull Request Checklist
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
This MR is focused on implementing a new interface based on LangChain VectorStore Class to handle integration with different VectorStores. It is adapted to the use of the VectorStores by OpenWebUI solution, that means no breaking changes with the existing solution. This MR proposes the implementations for the existing VectorStore types (ChromaDB - Persisting mode and Server mode) and also two new VectorStore types (PGVector and Milvus).
With the use of LangChain VectorStore interface there is a need to use the LangChain Embeddings interface. So multiple modifications have been done to adapt to this. Further work can be done to create better Embedding interface adapted to OpenWebUI solution.
Some refactoring has been done to sort imports on file where changes have been made.
Here is the link to the MR link the modification of the documentation: https://github.com/open-webui/docs/pull/191
Added
Changed
Additional Information
Testing
The impacts of this MR are on the following features:
✔️ Upload Document (via Chat or Workspace).
✔️ Chat Completions with Query to documents (Simple Query + Query with Reranker).
✔️ Scan of documents (via AdminPanel)
✔️ Reset VectorDB (via AdminPanel)
✔️ Edit of EmbeddingModel settings
✔️ Memory feature
The tests can be done with the following integrations:
Embeddings:
✔️ HuggingFace Embeddings (ex: sentence-transformers/all-MiniLM-L6-v2)
✔️ OpenAI Embeddings
✔️ Ollama Embeddings
VectorStores:
✔️ Persistent Chroma
✔️ Chroma Server
✔️ PGVector
✔️ Milvus
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.