I am using PGVector to store my vector embeddings and this works fine when fetching. Our vectordb was populated through a non spring-ai script and we are not conforming to a UUID as the id of the record and are instead using our own internal key. When I try to add/update a document in our table, I am getting the following error:

java.lang.IllegalArgumentException: Invalid UUID string: A101750
    at java.base/java.util.UUID.fromString1(UUID.java:282)
    at java.base/java.util.UUID.fromString(UUID.java:260)
    at org.springframework.ai.vectorstore.PgVectorStore$1.setValues(PgVectorStore.java:216)
    at org.springframework.jdbc.core.JdbcTemplate.lambda$getPreparedStatementCallback$6(JdbcTemplate.java:1603)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:658)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:701)
    at org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:1047)

And it is due to the following code in PgVectorStore.java: https://github.com/spring-projects/spring-ai/blob/f922195d36c5cdec641c3471337cc70b161b128b/vector-stores/spring-ai-pgvector-store/src/main/java/org/springframework/ai/vectorstore/PgVectorStore.java#L229

Why is this enforced to be a UUID? Can this be changed to allow any type? I would like to use the convenience of the VectorStore abstraction to handle embedding and everything for me, but will have to use a workaround with it in the current state.

Comment From: markpollack

Excellent point - there are many of the vector store impls that need to 'meet in the middle' (taken from ORM terminology). We will fix it.

Comment From: jitokim

@ilayaperumalg This issue can be closed by PR #2111 😃