-
Notifications
You must be signed in to change notification settings - Fork 98
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
Adding support for Pgvector #74
Conversation
cc @jmartisk |
Thanks a lot @sebastienblanc! What do you still want to do on this? |
I assume this means that when the user configures:
the datasource is used to configure PgVector as well? |
Yes ! It takes the default datasource, named datasources is not something I added yet. |
Great!
We don't need to worry about that for now |
...c/main/java/io/quarkiverse/langchain4j/pgvector/deployment/Langchain4jPgvectorProcessor.java
Outdated
Show resolved
Hide resolved
...t/src/test/java/io/quarkiverse/langchain4j/pgvector/test/Langchain4jPgvectorDevModeTest.java
Outdated
Show resolved
Hide resolved
...ployment/src/test/java/io/quarkiverse/langchain4j/pgvector/test/Langchain4jPgvectorTest.java
Outdated
Show resolved
Hide resolved
pgvector/runtime/src/main/java/io/quarkiverse/langchain4j/pgvector/PgVectorEmbeddingStore.java
Outdated
Show resolved
Hide resolved
pgvector/runtime/src/main/java/io/quarkiverse/langchain4j/pgvector/PgVectorEmbeddingStore.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/quarkiverse/langchain4j/pgvector/runtime/PgVectorEmbeddingStoreConfig.java
Outdated
Show resolved
Hide resolved
pgvector/runtime/src/main/resources/META-INF/quarkus-extension.yaml
Outdated
Show resolved
Hide resolved
pgvector/runtime/src/main/resources/META-INF/quarkus-extension.yaml
Outdated
Show resolved
Hide resolved
For the tests you can reuse the once from Redis. |
...c/main/java/io/quarkiverse/langchain4j/pgvector/deployment/Langchain4jPgvectorProcessor.java
Outdated
Show resolved
Hide resolved
pgvector/runtime/src/main/java/io/quarkiverse/langchain4j/pgvector/PgVectorEmbeddingStore.java
Show resolved
Hide resolved
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.
Nice, technically all looks good to me now.
We're missing documentation and the option to choose a non-default datasource
I will add soon some doc. Do we want also a simple sample project ? like we have here https://github.com/quarkiverse/quarkus-langchain4j/blob/main/samples/chatbot/src/main/java/io/quarkiverse/langchain4j/sample/chatbot/IngestorExample.java ? |
Yeah, that would be nice. Also note, that we'll the commits to be squashed and rebased when done. |
@geoand Will try to add this early next week, I had a busy end of the week. |
👍 That doc is generated |
I suspect this needs a rebase :) |
Yeah I did one this weekend but another is needed (and realized my git rebase skills were a bit rusty :) ) |
5a99454
to
5eb5993
Compare
@geoand This looks better, I need to squash all the commits now , right ? |
Yeah, that would certainly be nice :) |
5eb5993
to
2deb50b
Compare
@geoand I squashed that beast |
@jmartisk can you make sure this works in native mode? |
We don't yet have any integration tests related to embedding stores, but yeah I can look into creating some infrastructure for that |
For now just a sample manual test would be fine |
Ok gimme 15 minutes I'll try it |
Thanks a lot! |
Ok, I've added a reflective class registration, it seems to work now (tried both inserting and retrieving) |
adding pgvector as embedding store detect if pgvector is installable make sure the exception is related to the missing extension make dimension config property mandatory Update pgvector/runtime/src/main/resources/META-INF/quarkus-extension.yaml Update pgvector/runtime/src/main/resources/META-INF/quarkus-extension.yaml various refactoring based on feedback and added a real test deleted readme Update pgvector/deployment/src/main/java/io/quarkiverse/langchain4j/pgvector/deployment/Langchain4jPgvectorProcessor.java remove useless description Pinecone embedding store adding pgvector as embedding store add documentation generated config doc and added pgvector to doc's pom pgvector store
I rebased this onto the latest |
Based on this discussion : #46
this is still in draft but will make the review and discussions easier