Skip to content

Conversation

sobychacko
Copy link
Contributor

…pattern

  • Move PgVectorStore and related classes to org.springframework.ai.pg.vectorstore package
  • Update builder pattern to use more idiomatic method names (e.g. withSchemaName -> schemaName)
  • Deprecate existing constructors and old Builder class in favor of new static builder() method
  • Update tests to reflect the new builder style usage


var initializeSchema = properties.isInitializeSchema();

return new PgVectorStore.Builder(jdbcTemplate, embeddingModel).withSchemaName(properties.getSchemaName())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General thought: Given every vector store requires a client (jdbctemplate in this case) and an embedding model, can we make both of these as the default argument to the vector store builder?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the design we are using is to have zero arg builder consistent throughout the project. Reason is imagine a class that need 5 strings as required, if the builder takes 5 args, we haven't achieved any simplification by adding a fluent api.

@ilayaperumalg ilayaperumalg self-assigned this Dec 10, 2024
@ilayaperumalg ilayaperumalg added this to the 1.0.0-M5 milestone Dec 10, 2024
BatchingStrategy batchingStrategy, int maxDocumentBatchSize) {

super(observationRegistry, customObservationConvention);
// @Deprecated(forRemoval = true, since = "1.0.0-M5")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the plan was to keep the methods by deprecating instead of the removing?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

this.removeExistingVectorStoreTable, this.indexType, this.initializeSchema,
this.observationRegistry, this.searchObservationConvention, this.batchingStrategy,
this.maxDocumentBatchSize);
return PgVectorStore.builder(this.jdbcTemplate)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both observationRegistry and searchObservationConvention are missing in this builder setup?

…pattern

 - Move PgVectorStore and related classes to org.springframework.ai.pg.vectorstore package
 - Update builder pattern to use more idiomatic method names (e.g. withSchemaName -> schemaName)
 - Deprecate existing constructors and old Builder class in favor of new static builder() method
 - Update tests to reflect the new builder style usage
@markpollack
Copy link
Member

markpollack commented Dec 14, 2024

The postgresql library for vector store support uses com.pgvector so instead of org.springframework.ai.pg.vectorstore using org.springframework.ai.pgvector.vectorstore would be a better naming and is consistent with boot configuration property prefix.

@markpollack
Copy link
Member

updated reference docs and javadoc. change to use pgvector in package name.

Merged in 677a18e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants