-
Notifications
You must be signed in to change notification settings - Fork 2k
Adding SAP HanaDB as a vector store. #535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution @rahulmitt !
I left few review comments in the code.
In addition you have to
- add the vector store dependency to the spring-bom.
- will consider adding auto-configuration and spring-boot for it? This is the primary way to use the vector stores.
package org.springframework.ai.vectorstore; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import lombok.extern.slf4j.Slf4j; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't use the lombok
in the vector store implementation.
Later might be fine for end user applications, but because of multiple technical and compatibility issues is inappropriate for utilities/libraries such as spring-ai.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ACK
<version>2.20.11</version> | ||
</dependency> | ||
|
||
<dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't use the lombok in the vector store implementation.
Later might be fine for end user applications, but because of multiple technical and compatibility issues is inappropriate for utilities/libraries such as spring-ai.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ACK
<dependency> | ||
<groupId>com.sap.cloud.db.jdbc</groupId> | ||
<artifactId>ngdbc</artifactId> | ||
<version>2.20.11</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the version as a property in the parent pom.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ACK
@@ -0,0 +1,284 @@ | |||
# SpringAI using SAP HANA Cloud vector engine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ACK
} | ||
|
||
@Override | ||
public List<Document> similaritySearch(SearchRequest request) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the VectorStore integrations provide support for the Metadata Expression Filtering.
Please consider adding filtering support. Otherwise you should throw and exception that the feature is not supported like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! Thanks @rahulmitt
LGTM, will merge it soon.
@rahulmitt when i try to run the ITs locally
|
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-data-jpa</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I missed this.
Please try to replace the boot starter with the relevant data jpa dependency.
We should not use starters here, not even for the testing.
(P.S. I know that we leaked the logging starter in some places that we will have to fix)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Should be fixed now. Thanks
Hi @rahulmitt , thank you for the updates. Also:
|
Hi @tzolov - thanks for your kind reviews. Let me work on the following:
Will update the status here. |
… to create a BTP trial account and provision an instance for SAP Hana Cloud db
Hi @tzolov - I attempted to write the IT for HanaCloudVectorStoreAutoConfiguration. However, it is failing with below error. So, checked in as disabled for now.
If I add the following dependency to spring-ai-spring-boot-autoconfigure/pom.xml, the above error is resolved.
However, it starts complaining about:
I am looking for pointers on how to fix this. Do you mind taking a look pls? |
@rahulmitt thank you for the contribution. |
Rebased, squashed and merged at 466b824
|
@rahulmitt This is an old issue and hope you see this. We have not been able to gain access to SAP HANA to see if this functionality still works. Can you help? |
Hi - see if this documentation helps. |
Thank you for taking time to contribute this pull request!
You might have already read the [contributor guide][1], but as a reminder, please make sure to:
main
branch and squash your commits