You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description
I created everything on standard settings. Connection to OpenAI and the Neo4j vector database.
Environment
Steps to reproduce
Create connection to OpenAI and create Neo4j vector database.
public EmbeddingModel embeddingModel() {
return new OpenAiEmbeddingModel(new OpenAiApi(embeddingBaseUrl, embeddingApiKey), MetadataMode.EMBED, OpenAiEmbeddingOptions.builder().withModel(embeddingModel).build());
}
public Neo4jVectorStore neo4jVectorStore(Driver driver, EmbeddingModel embeddingModel) {
return new Neo4jVectorStore(driver, embeddingModel, Neo4jVectorStoreConfig.defaultConfig(), true);
}
public List<Document> findSimilarContent(SimilarContentRequest request) {
SearchRequest searchRequest = SearchRequest.query(request.getQuery())
.withTopK(request.getTopK())
.withFilterExpression(buildFilterExpression(request.getMetadata()));
return vectorStore.similaritySearch(searchRequest);
}
org.neo4j.driver.exceptions.ClientException: Failed to invoke procedure `db.index.vector.queryNodes`: Caused by: java.lang.IllegalArgumentException: Index query vector has 3072 dimensions, but indexed vectors have 1536.
I've check using Neo4j Console
there is index spring-ai-document-index
so created by spring ai
with following settings:
{
"indexProvider": "vector-2.0",
"indexConfig": {
"vector.dimensions": 1536,
"vector.similarity_function": "COSINE"
}
}
so spring ai set the wrong index even though he had the embedding model in hand and couldn't put it together properly, causing the solution not to work
Expected behavior
When I use EmbeddingModel to create VectoreStore everything should be created correctly.
Correct indexes and probably other errors that I will come across
The text was updated successfully, but these errors were encountered:
In cases where no custom size is set, derive the size by the given
embedding model.
Had to migrate the embeddingDimension Spring Boot property from int to Integer
to introduce the null check for the fluent config. Everything else would
have been just noisy.
Closesspring-projects#977
Signed-off-by: Gerrit Meier <[email protected]>
Bug description
I created everything on standard settings. Connection to OpenAI and the Neo4j vector database.
Environment
Steps to reproduce
Create connection to OpenAI and create Neo4j vector database.
I've check using Neo4j Console
there is index spring-ai-document-index
so created by spring ai
with following settings:
{
"indexProvider": "vector-2.0",
"indexConfig": {
"vector.dimensions": 1536,
"vector.similarity_function": "COSINE"
}
}
so spring ai set the wrong index even though he had the embedding model in hand and couldn't put it together properly, causing the solution not to work
Expected behavior
When I use EmbeddingModel to create VectoreStore everything should be created correctly.
Correct indexes and probably other errors that I will come across
The text was updated successfully, but these errors were encountered: