spring-projects / spring-projects/spring-ai
The `VectorStore` has poor scalability as it is limited by the `Document` class. It is desired to be able to customize the extension of the `Document` class to complete custom retrieval logic
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
Please do a quick search on GitHub issues first, the feature you are about to request might have already been requested.
Expected Behavior
I hope the VectorStore.add method can support subclasses of Document because the Document class does not meet my requirements.
Now even if I implement the VectorStore interface, I'm still completely restricted by the Document class and cannot achieve custom fields. Vector databases support multi-field mode, but the Document class completely limits its flexibility. Can this issue be resolved?
Current Behavior
Due to the interface being defined as void add(List<Document> documents);, it is not possible to use subclasses of Document.
Context
I want to extend it with a text field, and the use case is for Q&A. I need to convert Q into the vector store for retrieval, while A is only stored as data, which can be returned separately after a hit.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the VectorStore.add method and the Document class definition. Trace how implementations consume List and determine what must change to support Document subclasses and custom fields. Done means the Q&A use case can retain answer data while retrieving by the question text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- ai, backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100