Bug description
When I create a RAG Application with SimilaritySearch, the search returns similar documents when using Azure OpenAI, but always returns zero documents with Ollama. The issue occurs specifically when I use the withSimilarityThreshold parameter with Ollama.
Environment
last version of spring-ai BOM
ollama with llama 3.2
Azure OpenAI
PGVector
Steps to reproduce
When I use withSimilarityThreshold with Ollama, I always have 0 Document in my similarDocuments (it's ok with Azure OpenAI)
var similarity = 0.8;
var topk =20;
var searchRequest = SearchRequest.query(question.question())
.withTopK(topk)
.withSimilarityThreshold(similarity);
List<Document> similarDocuments = vectorStore.similaritySearch(searchRequest);
Expected behavior
The search should return similar results between Azure OpenAI and Ollama. However, Ollama consistently returns zero similar documents.
Observed Behavior
Azure OpenAI: Returns a list of documents that meet the similarity threshold.
Ollama: Returns zero documents, regardless of the similarity threshold set.
Additional Information
Configuration Consistency: The vectorStore configuration is identical for both platforms.
Error Logs: No explicit error messages are thrown; however, the empty response from Ollama does not align with the expected output.
[spring-ai-bootstraping] [nio-8080-exec-1] c.c.s.s.controller.AskRagController : Found 0 similar documents
Bug description When I create a RAG Application with SimilaritySearch, the search returns similar documents when using Azure OpenAI, but always returns zero documents with Ollama. The issue occurs specifically when I use the withSimilarityThreshold parameter with Ollama.
Environment last version of spring-ai BOM ollama with llama 3.2 Azure OpenAI PGVector
Steps to reproduce When I use withSimilarityThreshold with Ollama, I always have 0 Document in my similarDocuments (it's ok with Azure OpenAI)
Expected behavior The search should return similar results between Azure OpenAI and Ollama. However, Ollama consistently returns zero similar documents.
Observed Behavior
Azure OpenAI: Returns a list of documents that meet the similarity threshold. Ollama: Returns zero documents, regardless of the similarity threshold set.
Additional Information
Configuration Consistency: The vectorStore configuration is identical for both platforms. Error Logs: No explicit error messages are thrown; however, the empty response from Ollama does not align with the expected output. [spring-ai-bootstraping] [nio-8080-exec-1] c.c.s.s.controller.AskRagController : Found 0 similar documents