Bug description 创建 Document 时 ,嵌入了 Media 对象,但通过 vectorStore.similaritySearch 查询后,返回的 document 中 Media Collection 为空
Environment Please provide as many details as possible: Spring AI version, Java version, which vector store you use if any, etc Springboot 3.3.2 SpringAI 1.0.0.SNAPSHOT Java 17 Chroma
Steps to reproduce
1. 使用 Document doc = new Document(docId, docContent, mediaList, metadata); 新建 doc 并 调用 vectorStore.add(doc); 插入向量库
2. 使用 List
Expected behavior 希望使用 vectorStore.similaritySearch 查询时,能同时带出所关联的 media 集合,否则这 media 集合就没有意义了
Minimal Complete Reproducible example 请见重现步骤部分
Comment From: csterwa
English translation of title: SimilaritySearch of the vector library cannot bring back the media collection at the same time
bug description: When creating a Document, a Media object is embedded, but after querying through vectorStore.similaritySearch, the Media Collection in the returned document is empty
steps to reproduce: 1. Use Document doc = new Document(docId, docContent, mediaList, metadata); to create a new doc and call vectorStore.add(doc); to insert the vector store 2. Use List docs = vectorStore.similaritySearch(SearchRequest.defaults().withTopK(1)..withFilterExpression(filterExpr).withQuery(query)); to query the results 3. Confirm that docs contains an element with the same ID as doc, but the media in the element is empty 4. Tracking into the similaritySearch method of the org.springframework.ai.vectorstore.ChromaVectorStore class, it is found that when processing the query results, the constructor with media is not used 5. The VectorStore interface does not provide other methods to obtain the Media collection managed by Document
expected behavior: It is hoped that when using vectorStore.similaritySearch to query, the associated media collection can be brought out at the same time, otherwise this media collection is meaningless
minimal complete reproducible example: See the reproducible steps section
Comment From: markpollack
This is a very good use case, we have not pushed hard on multi-modal aspects in Spring AI, e.g getting image embedding and how to store the associated image. I'll rename the title of this issue to reflect this broad topic.