mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-05 18:38:17 -05:00
[GH-ISSUE #6550] Memory creation fails when using Milvus Vector DB #14402
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?
Originally created by @jasonpnnl on GitHub (Oct 29, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/6550
Installation Method
git clone
Environment
Open WebUI Version: v0.3.35
Operating System: Windows 10, Debian Bookworm
Confirmation:
Expected Behavior:
Memory is created by creating a collection when using both Chroma and Milvus
Actual Behavior:
Memory is not added. Silently fails.
Receive error from backend:
pymilvus.exceptions.MilvusException: <MilvusException: (code=1100, message=Invalid collection open_webui_user-memory-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. , collection name can only contain numbers, letters and underscores: invalid parameter)>
Description
Bug Summary:
Memories.py creates collections using names that contain dashes. Milvus does not allow dashes so this fails.
Reproduction Details
Steps to Reproduce:
Logs and Screenshots
pymilvus.exceptions.MilvusException: <MilvusException: (code=1100, message=Invalid collection open_webui_user-memory-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. , collection name can only contain numbers, letters and underscores: invalid parameter)>

Additional Information
I have a proposal for how to fix this and can submit a PR. Instead of setting the collection name with dashes in it multiple times in memories.py, create a function, get_collection_name that returns collection_name but with dashes replaced with underscores if the VECTOR_DB_CLIENT is MilvusClient, otherwise return collection_name as currently implemented to keep backward compatibility.
@jasonpnnl commented on GitHub (Oct 29, 2024):
I had tested this on a previous version and then saw it was still present in the latest version in memories.py. However, upon further review I can see that there was code added to apps/retrieval/vector/dbs/milvus.py to perform the replacements at that level. Sorry about the false report. I will be more careful checking in the future. This can be closed as it's actually fixed in the latest version.