VectorCollection.AddOrUpdateFrom
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu bằng cách lần theo DataSource.FromStream và AddDocumentsFromAsync, sau đó kiểm tra các abstraction của IVectorCollection và cơ sở dữ liệu vector đối với các thao tác metadata và cập nhật. Công việc được xem là hoàn tất khi xác định được cách các đường dẫn và hash nội dung nhận diện các tài liệu nguồn, xử lý nhiều vector trên mỗi tài liệu, và thêm hành vi AddOrUpdateFrom được đề xuất mà không phụ thuộc vào một tệp hoặc bài kiểm thử cụ thể được nêu trong issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
dani
I have a question, when I store a stream in the storage, how does it identify the insertion if it should be done or the index already exists, I have seen that DataSource.FromStream does not use a path, doesn't it make it difficult to find an element?
HavenDV — 05/02/2024 9:58 PM
DataSource.FromStream simply retrieves Documents from this Stream. Although there is metadata here, it is not currently used in any way, and the presence of the same data in the VectorCollection is not determined
dani — 05/02/2024 10:01 PM
I think I have not expressed myself well, for example in the code I am testing, I insert files from a repository, can I decide whether to insert or not if the vector already exists in the database?
foreach (var f in files)
{
if (!ignoreExt.Contains(Path.GetExtension(f.FilePath).ToLower()))
{
index = await vectordb.AddDocumentsFromAsync<GitlabLoader>(
embeddings,
dimensions: dimensions,
dataSource: DataSource.FromStream(f.ContentToStream),
collectionName: collection);
}
}
HavenDV — 05/02/2024 10:06 PM
IVectorDatabase.IsCollectionExistsAsync probably the best choice at the moment if you can store files in different collections
IVectorCollection.IsEmptyAsync can also be used, but it is not yet implemented/tested for all databases
dani — 05/02/2024 10:11 PM
My idea was to use a collection to store an entire repository, would it be viable to have a method to check if a path already exists? and that DataSource.FromStream has as an option to be able to pass it a path to have it indexed in some way
HavenDV — 05/02/2024 10:16 PM
I understand your problem, I'll think about it, for now the solution is only to recreate the entire collection for all files if any of the files have changed
The problem is that one DataSource can turn into several Documents, and as a result into several vectors in the database. And we need to add metadata to the database, such as FilePath, and then check for the presence of vectors with this metadata
Id for a specific vector won't work because it needs to be unique
dani — 05/02/2024 10:19 PM
You could recover a vector count with the same path, right?
HavenDV — 05/02/2024 10:23 PM
But what if the file changes partially?
dani — 05/02/2024 10:25 PM
Maybe you could have a hash function and if it doesn't match delete and reinsert?
HavenDV — 05/02/2024 10:31 PM
Yeah, that sounds like a good suggestion.
And add AddOrUpdateFrom, which does this automatically.
Also add the ability to pass metadata to the DataSource so that you can control this.
But this seems to go a little beyond the scope of the current release and sounds like a good plan for the near future
- Ngôn ngữ chính
- C#
- Star
- 12
- Fork
- 8
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của tryAGI/LangChain.Databases
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
-
Weaviate does not workĐang mởbug dependencies documentation help wanted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
tryAGI/LangChain.Databases#53 · 6 bình luận ·
-
use async methodsĐang mởtodo
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
review way to map metadataĐang mởtodo
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
todo
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Tất cả issue của tryAGI/LangChain.Databases
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
fluentassertions/fluentassertions#3353 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 78/100
unoplatform/uno#24769 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
AvaloniaUI/Avalonia#22323 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
microsoft/onnxruntime-genai#2633 ·
Maintainer thường phản hồi trong vòng 1 ngày