Commit Graph

248 Commits

Author SHA1 Message Date
Soby Chacko
f3b4624494 GH-3029: Remove HanaDB vector store autoconfiguration
Fixes: #3029

- Remove HanaDB vector store autoconfiguration
- Remove the corresponding starter
- Update docs
- Update maven configuration
- Remove autoconfiguration and starter entries from Spring AI BOM

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-05-08 16:55:48 +01:00
GR
c54dfd35d5 feat: add deepseek starter and docs - fix pom module ordering
- Add remaining deepseek modules
- Fix build order to put autoconfig modules after model modules to fix javadoc build

Signed-off-by: GR <gr@fastball.dev>
2025-05-07 23:38:07 -04:00
Mark Pollack
a5920a17fa Add core deepseek classes
Signed-off-by: Mark Pollack <mark.pollack@broadcom.com>
2025-05-07 21:27:39 -04:00
Mark Pollack
a2975a6cec Switch to mcp sdk 0.10.0-SNAPSHOT
Signed-off-by: Mark Pollack <mark.pollack@broadcom.com>
2025-05-06 06:54:59 +02:00
Mark Pollack
9e71b163e3 Remove Waston text generation model 2025-05-03 18:36:02 -04:00
Mark Pollack
846165d47f update to build against boot 3.4.5 2025-05-02 12:49:43 -04:00
Ilayaperumal Gopinathan
3acc206eb2 Next development version 2025-04-30 17:51:20 +01:00
Ilayaperumal Gopinathan
b657cf3bae Release version 1.0.0-M8 2025-04-30 17:51:07 +01:00
Christian Tzolov
e05552f6eb refactor(mcp): disable completion features and downgrade MCP SDK to 0.9.0
- Comment out AsyncCompletionSpecification and SyncCompletionSpecification imports
- Comment out completion parameters and processing in both sync and async server creation methods
- Downgrade MCP SDK version from 0.10.0-SNAPSHOT to 0.9.0

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-04-30 03:10:56 +03:00
Kushagra Thapar
6c85aeabba Updated azure service dependencies to the latest versions
Signed-off-by: Kushagra Thapar <kuthapar@microsoft.com>
2025-04-29 16:49:48 -04:00
Nicolas KRIER
388068d481 Maven build issues fixes
Signed-off-by: Nicolas KRIER <7557886+nicolaskrier@users.noreply.github.com>
2025-04-29 07:29:18 +01:00
Christian Tzolov
1457dc800d feat(mcp): add support for completion specifications in MCP server
Add support for completion specifications in both sync and async MCP servers by:

- Adding parameters for SyncCompletionSpecification and AsyncCompletionSpecification
- Implementing registration of completion specifications in server builders
- Updating capabilities builders to include completions
- Upgrading MCP SDK version to 0.10.0-SNAPSHOT

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-04-29 07:54:59 +03:00
Thomas Vitale
0024e4dd49 Chat Memory Enhancements
* ChatMemory will become a generic interface to implement different memory management strategies. It’s been moved from the “”spring-ai-client-chat” package to “spring-ai-model” package while retaining the same package, so it’s transparent to users.
* A MessageWindowChatMemory has been introduced to provide support for a chat memory that keeps at most N messages in the memory.
* A ChatMemoryRepository interface has been introduced to support different storage strategies for the chat memory. It’s meant to be used as part of a ChatMemory implementation. This is different than before, where the storage-specific implementation was directly tied to the ChatMemory. This design is familiar to Spring users since it’s used already in the ecosystem. The goal was to use a programming model similar to Spring Session and Spring Data.
* The JdbcChatMemory has been supersed by JdbcChatMemoryRepository.
* A ChatMemory bean is auto-configured for you whenever using one of the Spring AI Model starters. By default, it uses the MessageWindowChatMemory implementation and stores the conversation history in memory. If a different repository is already configured (e.g., Cassandra, JDBC, or Neo4j), Spring AI will use that instead.
* First-class documentation has been introduced to describe the ChatMemory API and related features.
* All the changes introduced in this PR are backward-compatible.

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2025-04-25 15:53:20 -04:00
Mark Pollack
98052624b1 Remove Qianfan and Moonshot model modules
Drop support for the Qianfan and Moonshot models by removing their modules from the build.

These integrations are now maintained in the community repositories:
https://github.com/spring-ai-community/qianfan
https://github.com/spring-ai-community/moonshot
2025-04-25 14:02:23 -04:00
Mark Pollack
ff52859b2d migrate remaining moonshot modules to community repo 2025-04-25 13:05:11 -04:00
Thomas Vitale
2bc29dab32 Introduce TemplateRenderer for prompt templating
- Introduce new TemplateRenderer API providing the logic for rendering an input template.
- Update the PromptTemplate API to accept a TemplateRenderer object at construction time.
- Move ST logic to StTemplateRenderer implementation, used by default in PromptTemplate. Additionally, make start and end delimiter character configurable.

Relates to gh-2655

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
2025-04-24 17:17:40 -04:00
Soby Chacko
687dea52e0 Update Bedrock runtime from 2.29.29 to 2.31.26
- Update bedrockruntime.version to 2.31.26 in root pom.xml
- Standardize AWS SDK dependencies in bedrock-converse module to use
  bedrockruntime.version property instead of awssdk.version
- Affected dependencies: bedrockruntime, sts, netty-nio-client

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-04-23 12:36:28 -04:00
Soby Chacko
81b715b3d2 Update dependencies and cleanup misc version management
- Extract common dependency versions to properties in root pom
  - Added jsoup.version property
  - Added mockk-jvm.version property
  - Added neo4j-cypher-dsl-bom.version property
- Update dependency versions:
  - djl from 0.30.0 to 0.32.0
  - oci-sdk from 3.51.0 to 3.63.1
  - azure-identity from 1.14.0 to 1.15.4
- Remove hardcoded versions for consistency
- Minor polishing

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-04-22 19:10:36 -04:00
Soby Chacko
05529b6bf5 Update dependencies for vector stores
Update multiple dependency versions including:

- Milvus from 2.5.4 to 2.5.7
- Azure Search from 11.6.1 to 11.7.6
- Weaviate client from 5.0.1 to 5.2.0
- Typesense from 0.5.0 to 1.3.0 (with matching code update)
- OpenSearch client from 2.10.1 to 2.23.0
- MariaDB from 3.5.1 to 3.5.3
- Couchbase from 3.7.8 to 3.8.0
- Neo4j Cypher DSL from 2024.0.2 to 2024.5.1
- Jedis from 5.1.0 to 5.2.0

Updates TypesenseVectorStore to use IndexAction enum instead of string literal.

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-04-22 17:36:18 -04:00
Soby Chacko
3756e16526 Upgrade azure-open-ai-client to 1.0.0-beta.16
Adjust MergeUtils to accommodate API changes:
- Update ChatCompletions constructor parameter list to remove the usage argument
- Move usage assignment to post-construction via reflection

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-04-17 17:07:11 -04:00
ddobrin
53359fd9e6 Fixes #2185 - googleSearchRetrieval(true) causes INVALID_ARGUMENT error with Gemini 2.0 (use google_search instead) 2025-04-17 14:22:30 -04:00
Eddú Meléndez
318bdfc7c1 Add missing chat memory entries to BOM
Also, create new memory chat starters for cassandra and neo4j.

Signed-off-by: Eddú Meléndez <eddu.melendez@gmail.com>
2025-04-13 00:37:56 -05:00
Ilayaperumal Gopinathan
bda702e8e1 Next development version 2025-04-10 20:23:38 +01:00
Ilayaperumal Gopinathan
584138af28 Release version 1.0.0-M7 2025-04-10 20:23:07 +01:00
Christian Tzolov
3409c1fd87 feat(mcp): update WebFlux and WebMvc server transport providers with URL configuration
- Update MCP SDK version to 0.9.0
- Add baseUrl and sseEndpoint properties to McpServerProperties
- Update WebFlux and WebMvc server transport providers to use new URL configuration properties
- Remove deprecated backward compatibility code and related tests
- Remove deprecated methods from McpToolUtils
- Update MCP SDK version to 0.9.0-SNAPSHOT
- Add tool filtering capability to MCP Tool Callback Providers
  Introduces a BiPredicate-based filtering mechanism for both Sync and Async
  MCP Tool Callback Providers, allowing selective tool discovery based on
  custom criteria. This enables filtering tools by name, client, or
  any combination of properties.
  * Apply filter in getToolCallbacks() methods for both providers
  * Add  tests for various filtering scenarios
- Add utility method to retrieve MCP exchange from tool context
 * Add constant TOOL_CONTEXT_MCP_EXCHANGE_KEY to replace hardcoded exchange string
 * Implement getMcpExchange utility method to safely retrieve the MCP exchange object

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-04-10 19:30:49 +02:00
leijendary
4be10028b0 feat: JDBC implementation of ChatMemory
Signed-off-by: leijendary <jonathanleijendekker@gmail.com>

Remove references to spring-ai-core module in jdbc chat memory
2025-04-07 15:08:58 -04:00
Ilayaperumal Gopinathan
57f0b592e9 Update Spring Boot to 3.4.4 2025-04-04 12:43:23 -04:00
Soby Chacko
717e419515 Rename spring-ai parent from spring-ai to spring-ai-parent
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-04-04 12:43:22 -04:00
Soby Chacko
f7f00328a1 Migrate Cassandra chat memory implementation to its own module
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-04-04 11:44:38 -04:00
Mark Pollack
d45ff8e984 Refactorings
- Avoid overlapping package names
  Changed in spring-ai-commons package from org.sf.ai.model to org.sf.ai.content
  Refactor advisor module name to be spring-ai-advisors-vector-store
    Moved advisors into org.springframework.ai.chat.client.advisor.vectorstore

- Created top level memory directory
- Create new module spring-ai-model-chat-memory-neo4j and moved neo4j memory classes out of the vectorstore module
  Updated neo4j autoconfiguation
2025-04-04 11:44:38 -04:00
Mark Pollack
e3f9b7c16b rename spring-ai-core to spring-ai-client-chat 2025-04-04 11:44:38 -04:00
Mark Pollack
79671d47ec Move rag classes out of spring-ai-core and into new module spring-ai-rag 2025-04-04 11:44:38 -04:00
Mark Pollack
81fecefae8 Move advisors that depend on vector store to spring-ai-advisors module 2025-04-04 11:44:38 -04:00
Mark Pollack
69d5b5fcf0 Extract core modules for improved architecture
Extract functionality from spring-ai-core into dedicated modules:
  - spring-ai-commons: Common utilities and document handling
  - spring-ai-model: Core model interfaces and implementations
  - spring-ai-vector-store: Vector store abstraction and implementation

  This modularization creates clearer responsibility boundaries and allows
  consumers to include only what they need. The restructuring will make the
  codebase easier to maintain and extend as the project grows.
2025-04-04 11:44:38 -04:00
Ilayaperumal Gopinathan
00b0aab828 Refactor Cassandra ChatMemory Autoconfiguration
- Move Cassandra ChatMemory autoconfiguration into dedicated autoconfiguration

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-03-26 20:04:08 +00:00
Enrico Rampazzo
1d4bde80e5 Neo4j chatmemory implementation
- Add chatmemory implementation for Neo4j
  - Add autoconfiguration for Neo4jChatMemory
  - Add tests

Signed-off-by: Enrico Rampazzo <enrico.rampazzo@live.com>
2025-03-26 20:04:08 +00:00
Christian Tzolov
3b543cfb68 Update MCP version to 0.8.1
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-03-26 13:08:20 +01:00
Christian Tzolov
cde7e6686a Swirtch MCP from 0.8.0 to 0.9.0-SN
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-03-26 12:40:18 +01:00
Christian Tzolov
fc955c74eb feat(mcp): Refactor MCP server API to use Specification pattern
- Rename Registration classes to Specification (SyncToolRegistration → SyncToolSpecification)
- Update transport classes to use Provider suffix (WebFluxSseServerTransport → WebFluxSseServerTransportProvider)
- Add exchange parameter to handler methods for better context passing
- Introduce McpBackwardCompatibility class to maintain backward compatibility
- Update MCP Server documentation to reflect new API patterns
- Add tests for backward compatibility
- Update mcp version to 0.8.0
- Add mcp 0.8.0 breaking change note-

The changes align with the MCP specification evolution while maintaining backward compatibility through deprecated APIs.

refactor: Extract MCP tool callback configuration into separate auto-configuration

Extracts the MCP tool callback functionality from McpClientAutoConfiguration into a
new dedicated McpToolCallbackAutoConfiguration that is disabled by default.

- Created new McpToolCallbackAutoConfiguration class that handles tool callback registration
- Made tool callbacks opt-in by requiring explicit configuration with spring.ai.mcp.client.toolcallback.enabled=true
- Removed deprecated tool callback methods from McpClientAutoConfiguration
- Updated ClientMcpTransport references to McpClientTransport to align with MCP library changes
- Added tests for the new auto-configuration and its conditions

refactor: standardize tool names to use underscores instead of hyphens

- Change separator in McpToolUtils.prefixedToolName from hyphen to underscore
- Add conversion of any remaining hyphens to underscores in formatted tool names
- Update affected tests to reflect the new naming convention
- Add comprehensive tests for McpToolUtils.prefixedToolName method
- Add integration test for payment transaction tools with Vertex AI Gemini

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-03-25 14:23:12 -04:00
Soby Chacko
989971f641 Remove coherence vector store boot starter since it is missing the autoconfig (#2565)
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-03-24 15:34:23 -04:00
Soby Chacko
3d494961c2 Migrate Couchbase vector store auto-configuration to dedicated module
- Update dependencies and module names in maven pom.xml files affecting couchbase vector store support
- Rename artifact from spring-ai-couchbase-store-spring-boot-starter to spring-ai-starter-vector-store-couchbase
- Update imports and related cleanup
- Update corresponding documentation references

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-03-24 15:34:23 -04:00
Ilayaperumal Gopinathan
4ba932b42a Refactor auto-configurations
- Split model autoconfigurations based on the model

    - Change the autoconfiguration class into model specific autoconfigurations - chat, embedding, image etc.,
    - Update/add tests based on this change

 - Make sure the conditional logic to enable the model auto configuration is at the class level so that the configuration properties as well as the models are not enabled when the model is explicitly disabled. By default, the condition will allow enabling the beans if not explicitly overridden.

- Remove spring-ai-spring-boot-autoconfigure as a dedicated auto-configuration module

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-03-24 15:34:22 -04:00
Ilayaperumal Gopinathan
6b12ff5ae1 Refactor autoconfigurations for models
- Conditionally enable invidividual models within the provider
     - Introduce top level properties to support conditional logic
        - The properties will have the format like "spring.ai.model.<chat/embedding/image etc.,>=<provider>" to enable specific chat/embedding/image/audio/moderation models by the provider. By default, these will be enabled when no specific properties are set. To disable, set any value other than the provider name for example, "none"

    - For the auto configurations where the provider has multiple models, split the autoconfiguration into per model auto-configuration classes. This will enable the isolated auto-configurations for each provider and its model.
      - This PR addresses this for OpenAI and others will follow in subsequent PRs

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-03-24 15:34:22 -04:00
Soby Chacko
31bc8c470d Migrate vector store observation autoconfiguration to dedicated module
Update the vector store starters with the new observation autoconfig dependency

Other maven configuraiton changes

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-03-24 15:34:22 -04:00
Soby Chacko
fd1f0d9431 Migrate Azure and CosmosDB vector store auto-configurations to dedicated modules
Update dependencies and module names in maven pom.xml files

Update corresponding starter modules

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-03-24 15:34:22 -04:00
Soby Chacko
505046749f Migrate vector store auto-configurations to dedicated modules
Move vector store auto-configuration classes to dedicated modules under auto-configurations/vector-stores/:
- Creates separate modules for Cassandra, Chroma, Elasticsearch, GemFire, HanaDB, MariaDB, MongoDB Atlas, Neo4j, OpenSearch, Oracle, PGVector, and Redis vector stores
- Updates package names to follow the pattern org.springframework.ai.vectorstore.<implementation>.autoconfigure
- Renames corresponding starter modules to follow the pattern spring-ai-starter-vector-store-<implementation>
- Updates import paths in affected classes
- Relocates test resources alongside their respective implementations
- Updates imports in spring-ai-spring-boot-docker-compose and spring-ai-spring-boot-testcontainers

This change improves modularity by allowing each vector store implementation to be
independently versioned and maintained, following the migration pattern established
with previous vector store autoconfiguraiton and starters .

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-03-24 15:34:22 -04:00
Soby Chacko
7f24740690 Migrate vector store auto-configurations to dedicated modules
Move vector store auto-configuration classes to dedicated modules under auto-configurations/vector-stores/:

- Creates separate modules for Milvus, Pinecone, Qdrant, and Typesense vector stores
- Moves CommonVectorStoreProperties to spring-ai-core for better reusability
- Updates pom.xml dependencies to maintain proper relationships between modules
- Name the artifacts based on the pattern spring-ai-autoconfigure-vector-store-<implementation>.
  For example - spring-ai-autoconfigure-vectore-store-milvus
- Package names follow the pattern org.springframework.ai.vectorstore.<implementation>.autoconfigure
- Naming the correspondinbg starter modules accordingly (spring-ai-starter-vector-store-milvus for example).

This change improves modularity by allowing each vector store implementation to be
independently versioned and maintained, continuing the migration pattern established
with previous vector stores.

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-03-24 15:34:22 -04:00
Ilayaperumal Gopinathan
0453fc55d5 Modularise Spring AI Spring Boot autoconfigurations
- Split spring-ai-spring-boot-autoconfigure into modules

     - This PR addresses the restructuring of the following spring boot autoconfigurations:

       - spring-ai retry -> common
       - spring-ai chat client/model/memory -> chat
       - spring-ai chat/embedding/image observation -> observation
       - spring-ai chat/embedding models -> models

     - Update the Spring AI BOM and boot starters with the new autoconfigure modules

     - Rename the autoconfiguration and starters

        - The package name for the models in autoconfiguration classes will have `org.springframework.ai.model.<name>.autoconfigure`
        - Both the autoconfiguration and starters will have the prefix `spring-ai-autoconfigure-model` and `spring-ai-starter-model` respectively

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-03-24 15:34:22 -04:00
Laurent Doguin
d25d37ab12 GH-938: Add Couchbase vector store support
Fixes: #938

Issue link: https://github.com/spring-projects/spring-ai/issues/938

This commit integrates Couchbase as a vector store option in Spring AI, providing:

- CouchbaseSearchVectorStore implementation with vector similarity search capabilities
- Support for metadata filtering with SQL++ expression conversion
- Spring Boot auto-configuration and starter module for easy integration
- Comprehensive documentation covering setup, configuration, and usage examples
- Integration tests using TestContainers with Couchbase 7.6

The implementation supports configuring dimensions, similarity functions (dot_product/l2_norm),
and optimization strategies (recall/latency). Schema initialization is now opt-in via
the initializeSchema property. Documentation includes both auto-configuration and
manual configuration instructions, along with property configuration details.

Signed-off-by: Abhiraj <abhiraj.official15@gmail.com>

co-authored-by: Laurent Doguin <laurent.doguin@gmail.com>
2025-03-20 18:59:56 -04:00
Alexandros Pappas
e81f64c0fc feat(spring-ai-azure-openai): update azure-open-ai-client to 1.0.0-beta.14
resolves https://github.com/spring-projects/spring-ai/issues/2424

Signed-off-by: Alexandros Pappas <apappascs@gmail.com>
2025-03-11 16:09:37 -04:00