- Added Jackson annotations for JSON property handling in Chroma API request/response records.
Use @JsonInclude(JsonInclude.Include.NON_NULL) to ignore empty fields such as null where.
Use @JsonProperty(XYZ) to provide a strong contract with the Cohere API.
- Updated the Docker image for running Chroma locally and in tests to version 0.5.20.
- Enhanced methods with non-null assertions for improved code safety.
- Added a simple search test to verify document similarity search functionality.
Fixes#1749
Implemented a new configuration property 'useKeylessAuth' to toggle
between API key and Azure default credential authentication.
Added necessary dependencies and updated tests to reflect the new changes.
co-authored-by: mattgotteiner <mattgotteiner@users.noreply.github.com>
- Fix the embedding dimension configuration for opensearch client indices mapping
The dimension config is obtained by the underlying embedding model's dimension
- Updated OpenSearch mapping JSON to include dynamic embedding dimension.
- Changed default mapping for OpenSearch vector store to use generic dimension placeholder.
- Fixed OpenSearchVectorStoreAutoConfiguration to fallback to new default mapping if no custom mapping is provided.
- Added test for verifying mapping configuration with OpenSearch vector store.
- Added test dependencies for Ollama integration.
- Refactored OpenSearch integration tests to use new mapping and dimension logic.
Add tests
- Verify the mappingJson field is correctly set - verify the override works fine
- Add integration tests with Ollama embedding model
Resolves#1589
- Remove deprecated types,methods and references
- Remove usage of "Generation(String text)" and replace with
"Generation(AssistantMessage)"
- Remove MiniMaxApi,MootShotApi,OpenAiApi,ZhiPuAiApi
ChatCompletionFinishReason's FUNCTION_CALL
- Remove OllamaApi's deprecated types
- Remove deprecated constructors from PostgresMlEmbeddingModel
- Remove deprecated constructor from Media
- Remove tokenNames usage from antlr4 FiltersLexer and FiltersParser
- Remove deprecated methods from CassandraVectorStoreProperties
- Remove deprecated constructor and static config class from QdrantVectorStore
- Minor cleanups on removing deprecated models and versions
- Remove old name for mixtral models
Resolves#1599
Resolves#1628
In Azure Vector Store, the embedding field needs to be retrievable
for proper functionality. While SearchField class doesn't have a
'retrievable' property, the 'hidden' field serves the same purpose.
The fix sets hidden=false on the embedding field to make it retrievable.
Link: https://github.com/spring-projects/spring-ai/issues/1628
Due to changes in Chroma v0.5.13 (chroma-core/chroma#2880), the delete
operation no longer returns values. This impacts our ChromaVectorStore's delete
functionality.
Now we need to check the HTTP status code instead to properly verify if the
delete operation succeeded.
Test suite has been updated.
Resolves#1529
The change addresses initialization issues when ChromaVectorStore is used outside
Spring context, particularly in scenarios where collections are created manually
before store instantiation. Previously, collection ID wasn't properly populated
when afterPropertiesSet() wasn't called by Spring container.
- Add builder pattern to ChromaVectorStore for better initialization control
- Add initialization flag to prevent multiple collection creation calls
- Add integration tests for builder pattern usage scenarios
- Add spring-ai-transformers dependency for testing
- Remove unused constants (SIMILARITY_THRESHOLD_ALL, DEFAULT_TOP_K)
Collection ID is now properly set regardless of whether the store is managed by
Spring or created manually, solving the 404 Not Found errors during document
insertion.
Fixes: #1240
- Add maven properties for all vector stores such as
skip.vectorstore.azure-cosmos-db to control IT test execution
- Chroma and PGVector IT tests are enabled by default
- Docker Compose and Testcontainers module ITs are skipped by default
- Add parallel job to run docker-compose and testcontainers ITs
- Fix parameter access syntax in setNodeVectorProperty DDL statement
- Define DEFAULT_TRANSACTION_SIZE for the hardcoded batch size in
the delete query
Fixes#1623
Signed-off-by: jitokim <pigberger70@gmail.com>
Integrates Oracle Coherence 24.09+ as a vector store backend for Spring AI. The
implementation provides:
- Support for vector similarity search with configurable distance metrics (Cosine,
Inner Product, L2)
- Multiple indexing options including HNSW and Binary Quantization indexes
- Filter expression evaluation for metadata-based filtering
- Vector normalization capabilities
- Comprehensive test coverage including integration tests
The implementation includes:
- CoherenceVectorStore main implementation
- CoherenceFilterExpressionConverter for Spring AI to Coherence filter conversion
- Auto-configuration support via spring-boot-starter
- Documentation and usage examples
Requires Oracle Coherence 24.09 or later.
Replace traditional switch statements with Java 14 switch expressions across
vector store filter converters and related components. This change improves
code quality in our filter expression handling for Azure, Milvus, Redis,
Typesense and Weaviate implementations.
The switch expressions eliminate fall-through behavior, enforce exhaustive
pattern matching at compile time, and provide a more direct way to return
values. This makes the filter conversion logic more robust and maintainable.
- Milvus requires "not in" operator syntax instead of "nin" for filtering.
- See https://milvus.io/docs/boolean.md
- Updated test and added additional test coverage
- Disable project-wide Checkstyle checks to unblock development
- Add documentation for enabling Checkstyle locally
- Fix remaining checkstyle violations in current codebase
Fixes#1669
- The doSimilaritySearch method did not pass the databaseName parameter in milvus 2.3.4 and before, resulting in the use of the default database; The current milvus upgrade to 2.3.5 supports passing the databaseName parameter
- Update doSimilaritySearch to set the database name from the Milvus configuration
This change uses `session.executeWrite` and `session.executeRead` to interact with the database.
Those methods use build-in retries for several Neo4j specific error states.
Doing will improve the overall user experience in this case as the no other external retry mechanism should be used.
Doing so is fine, as the Neo4j vector store is not subject to Springs general transaction management.
The system text advise prompt is only joined with the value of the system text if it's non-null and non-empty.
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
When using a non-default database, MilvusVectorStore's doDelete method wasn't
passing the specified databaseName in DeleteParam, causing searches to fall back
to the default database where collections couldn't be found. Added explicit
databaseName parameter to fix this issue.
- Add databaseName to DeleteParam builder
- Upgrade milvus-sdk from 2.3.4 to 2.3.5
- Define the version for Azure Cosmos DB
- Add dependencies for the azure-cosmos-db-store module and boot starter
- Include the artifacts in spring-ai-bom
Signed-off-by: jitokim <pigberger70@gmail.com>
* GH-513 fix: Support custom field names for Milvus VectorStore collection
- Add configuration properties to override the default field names for doc_id, content, metadata and embedding
- Add support to allow auto-id when enabled
- Add tests
Resolves#513
* Fix package modifier
Adds @EnabledIfEnvironmentVariable annotation to integration tests that
use OpenAI embeddings. Tests will be skipped if OPENAI_API_KEY is not set,
making the build process more reliable for contributors who don't have
access to OpenAI services.
ObjectMapper instantiation is costly, so unless its usage
is one-shot, it is better to create a reusable instance
for upcoming usage.
Also, before this commit, serialization of most Kotlin
classes was not supported due to the lack of proper
Jackson KotlinModule detection.
This commit:
- Avoids per invocation ObjectMapper instantiation when
relevant
- Automatically detects and enables well-known Jackson
modules including the Kotlin one
- Removes org.springframework.ai.vectorstore.JsonUtils
which looks not needed anymore
More optimizations are possible like reusing more
ObjectMapper instances, but this could introduce more breaking
changes so this commit intends to be a good first step.
Kotlin tests will be provided in a follow-up commit.
Additional changes:
- Update ModelOptionsUtils to use JacksonUtils.instantiateAvailableModules()
- Add missing license headers
- Add missing author Javadoc comments
- Implement core vector store module for CosmosDB integration
- Add Spring Boot auto-configuration capabilities
- Integrate batch processing strategy for optimized operations
- Include comprehensive tests for core and auto-config modules
- Add reference docs for the CosmosDB vector store support
- Remove unnecessary spring-web dependencies
- Update third-party library versions
- Refactor API classes to use consistent header handling
- Remove ApiUtils class and inline its functionality
- Adjust RestClient and WebClient builder usage in autoconfiguration
- Replace direct RestClient.Builder injections with ObjectProvider<RestClient.Builder>
and WebClient.Builder injections with ObjectProvider<WebClient.Builder>
- Update ChromaVectorStoreAutoConfiguration to use ObjectProvider
- Rename MongoDbAtlasLocalContainerConnectionDetailsFactoryTest to IT
- Switch spring-ai-chroma-store dependency from spring-web to spring-webflux
- Simplify ChromaApi constructor by using method reference for default headers
- Adjust import order
Resolves#1066Resolves#524
- Improve ChromaVectorStore to throw exception on missing collection with disabled schema
- Add test case to verify exception is thrown when collection doesn't exist and schema init is false
- Correctly set Chroma collection id when initializeSchema set to false
Co-authored-by: Christian Tzolov <ctzolov@vmware.com>
- Resolved issue where index name was not being sent during
similaritySearch
- Updated similaritySearch method to include index in the SearchRequest
- Implemented test to verify documents can be added and retrieved from
two different indices using separate OpenSearchVectorStore instances
- Ensured similarity search results are correctly returned for the
respective indices
Fixes#885
* Unify image definition for vector stores in vector-store modules
* Unify image definition for vector stores in spring-ai-testcontainers module
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>