spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

Add Couchbase vector store support

Open ldoguin opened this issue 1 year ago • 10 comments

  • Implement CouchbaseVectorStore, including support for filter expression conversion.
  • Add couchbase vectore store documentation
  • Add spring boot autoconfig and starter

Resolves# https://github.com/spring-projects/spring-ai/issues/938

ldoguin avatar Jun 23 '24 17:06 ldoguin

Thanks for the contribution @ldoguin

Before we can start the review could please:

  • add the couchbase.adoc to the nav.adoc catalog (they vector stores are listed in alphabetical order).
  • add the vector store and the boot starter dependency to the BOM's pom

tzolov avatar Jun 24 '24 09:06 tzolov

Hi @tzolov, just added them. Thank you !

ldoguin avatar Jun 24 '24 11:06 ldoguin

Hi @sobychacko, I have implemented your comments, thanks !

ldoguin avatar Jun 24 '24 16:06 ldoguin

@ldoguin, I added some more minor comments to the review. I also suggest you add some testing around the Boot auto-configuration. Take a look here for examples: https://github.com/spring-projects/spring-ai/tree/main/spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore.

sobychacko avatar Jun 24 '24 23:06 sobychacko

@sobychacko change the Thread.sleep to watcher and retries. Unfortunately we don't have a synchronous API for these.

ldoguin avatar Jun 27 '24 15:06 ldoguin

@ldoguin Thanks for the updates. When running the tests locally, I see the following two tests consistently fail. Could you look into them?

CouchbaseVectorStoreAutoConfigurationIT#addAndSearchWithFilters CouchabaseVectorStoreIT#searchWithFilters

Also, can you rebase the PR branch against the latest main?

sobychacko avatar Jun 27 '24 20:06 sobychacko

Hi @sobychacko, I sadly can't reproduce. Is it a Couchbase connection error ?

ldoguin avatar Jul 01 '24 10:07 ldoguin

@ldoguin These are the types of errors I am seeing locally:

Caused by: com.couchbase.client.core.error.UnambiguousTimeoutException: WaitUntilReady timed out in stage WAIT_FOR_CONFIG (spent PT1.001939792S in that stage) {"bucket":"example","checkedServices":
[],"desiredState":"ONLINE","remainingPingTargets":{},"services":{"mgmt":[{"last_activity_us":1006741,"state":"connected","circuit_breaker_state":"disabled","id":"0x9367b2dd",
"remote":"localhost:53016","local":"127.0.0.1:53070"},{"lastConnectAttemptFailure":"finishConnect(..) failed: Connection refused: localhost/127.0.0.1:8091 - Check server ports and cluster encryption setting.","state":"disconnected","circuit_breaker_state":"disabled"},
{"lastConnectAttemptFailure":"finishConnect(..) failed: Connection refused: localhost/127.0.0.1:8091 - Check server ports and cluster encryption setting.","state":"disconnected","circuit_breaker_state":"disabled"},{"lastConnectAttemptFailure":"finishConnect(..) failed: Connection refused: localhost/127.0.0.1:8091 - Check server ports and cluster encryption setting.","state":"disconnected","circuit_breaker_state":"disabled"},
{"lastConnectAttemptFailure":"finishConnect(..) failed: Connection refused: localhost/127.0.0.1:8091 - Check server ports and cluster encryption setting.","state":"disconnected","circuit_breaker_state":"disabled"},{"lastConnectAttemptFailure":"finishConnect(..) failed: Connection refused: localhost/127.0.0.1:8091 - Check server ports and cluster encryption setting.","state":"disconnected","circuit_breaker_state":"disabled"},{"lastConnectAttemptFailure":"finishConnect(..) 

sobychacko avatar Jul 01 '24 14:07 sobychacko

@sobychacko So it does look like a couchbase/testcontainer issues. Let me see how we are doing tests with Spring Data Couchabse.

ldoguin avatar Jul 01 '24 15:07 ldoguin

@ldoguin Any updates on this PR?

sobychacko avatar Jul 26 '24 15:07 sobychacko

Hi @ldoguin Its' beena while, wondering if you could take a look again on this.

markpollack avatar Nov 25 '24 21:11 markpollack

@markpollack Sorry for the delay, we will start working on it this week and push all the fixes.

deniswsrosa avatar Feb 18 '25 11:02 deniswsrosa

This issue has been resolved via https://github.com/spring-projects/spring-ai/commit/d25d37ab12c0fd4eb77773d157eb15002b4ff897.

sobychacko avatar Mar 25 '25 18:03 sobychacko