Commit Graph

94 Commits

Author SHA1 Message Date
Ilayaperumal Gopinathan
b68fa9d790 Add spring-ai-starter-vector-store-couchbase to Spring AI BOM
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-05-19 10:20:21 +01:00
Ilayaperumal Gopinathan
d601af76b5 Add spring ai starter for model chat memory to BOM
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-05-19 10:11:13 +01:00
Soby Chacko
368be3a04f Fixing miscellaneous checkstyle errors
Enabling checkstyle by default in the project build

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-05-16 11:08:33 +01:00
Ilayaperumal Gopinathan
2d517eec5c Refactor chat memory repository artifacts for clarity
- Rename the artifact ID of the chat memory repository artifacts:

    - `spring-ai-model-chat-memory-jdbc` -> `spring-ai-model-chat-memory-repository-jdbc`
    - `spring-ai-model-chat-memory-cassandra` -> `spring-ai-model-chat-memory-repository-cassandra`
    - `spring-ai-model-chat-memory-neo4j` -> `spring-ai-model-chat-memory-repository-neo4j`

 - Rename the package names to include "repository". Example: org.springframework.ai.chat.memory.repository.jdbc.JdbcChatMemoryRepository
    - This package renaming also requires to change the default schema location for the jdbc repository to include "repository"
      - Update the docs

 - Update the artifact IDs in the parent POM, BOM, autoconfiguration and starters
 - Update upgrade notes and docs to describe the changes

Fix JdbcChatMemoryRepositoryPostgresqlIT
 - Make sure to set the dialect via datasource

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-05-12 13:02:26 -04:00
Ilayaperumal Gopinathan
f6dba1bf08 Refactor chat memory repository autoconfigurations and Spring Boot starters for clarity
- Rename chat memory repository autoconfiguration modules to include the "repository" suffix:
    - spring-ai-autoconfigure-model-chat-memory-cassandra -> spring-ai-autoconfigure-model-chat-memory-repository-cassandra
    - spring-ai-autoconfigure-model-chat-memory-jdbc -> spring-ai-autoconfigure-model-chat-memory-repository-jdbc
    - spring-ai-autoconfigure-model-chat-memory-neo4j -> spring-ai-autoconfigure-model-chat-memory-repository-neo4j
- Update Spring Boot starter modules to match the new naming convention.
- Rename packages to include `.repository.` for improved clarity and consistency.
- Rename configuration and related classes to use the `ChatMemoryRepository` suffix.
- Update Spring AI BOM and parent POM files to reference the new artifact names.
- Update all imports, references, and configuration to use the new package and class names.

BREAKING CHANGE:
These changes require users to update their dependencies, imports, and configuration to use the new artifact, package, and class names. See the upgrade notes for migration instructions.

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-05-10 14:56:08 -04:00
Ilayaperumal Gopinathan
62cc6f12c0 Update Spring AI BOM with spring-ai-autoconfigure-model-chat-memory
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-05-09 22:46:30 +01:00
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
9e71b163e3 Remove Waston text generation model 2025-05-03 18:36:02 -04:00
Mark Pollack
bfcaad7b54 Second pass to remove qianfan code 2025-05-03 17:15:18 -04:00
Ilayaperumal Gopinathan
781e85dc2d Configuration updates to Spring AI BOM
Add repository element to the distributionManagement for Spring AI BOM

Add sonatype profile to Spring AI BOM

Add developer info to Spring AI BOM

Remove javadoc skip at spring-ai-spring-boot-testcontainers POM

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-05-01 08:05:27 +01:00
Ilayaperumal Gopinathan
363ebf8de6 Fix Spring AI BOM flatten maven plugin configuration
- Make sure to keep the dependencyManagement entries

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-04-28 16:06:18 +01:00
Ilayaperumal Gopinathan
acd986e59c Add maven plugins to Spring AI BOM
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-04-28 07:53:40 +01:00
Ilayaperumal Gopinathan
867bc2e028 Add additional metadata to Spring AI BOM
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-04-25 23:32:42 +01:00
Ilayaperumal Gopinathan
8c718ca8a7 Spring AI BOM updates
- Remove spring-ai-parent POM as its parent
    - This change is done to make Spring AI dependencies independent of Spring Boot

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-04-25 22:55:25 +01: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
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
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
b4fa31188a Refactoring cleanup
- Update Spring AI BOM with the newly added modules
 - Remove unnecessary dependencies from the modules' POM file
2025-04-04 12:43:22 -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
Mark Pollack
e3f9b7c16b rename spring-ai-core to spring-ai-client-chat 2025-04-04 11:44:38 -04:00
Mark Pollack
c11cc739b3 update reference docs for upgrade 2025-03-24 23:07:27 -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
ddf7748786 Add missing vector store autoconfig coorindates to spring-ai-bom (#2564)
Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
2025-03-24 15:34:23 -04:00
Ilayaperumal Gopinathan
962f17915b Spring AI BOM updates
- Update the latest changes to autoconfigurations, starters for the Spring AI autoconfigurations and starters

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
2025-03-24 15:34:23 -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
82b46d2182 feat: add JSoup HTML document reader
This commit introduces the `JsoupDocumentReader` and `JsoupDocumentReaderConfig` classes, which provide functionality to read and parse HTML documents using the JSoup library.

The reader supports:
- Extracting text from specific HTML elements using CSS selectors.
- Extracting all text from the body of the document.
- Grouping text by element.
- Extracting metadata, including the document title, meta tags, and link URLs.
- Reading from various resource types (files, URLs, byte arrays).
- Configurable character encoding, selector, separator, and metadata extraction.

This new reader enhances Spring AI's ability to process web content and other HTML-based data sources.

Signed-off-by: Alexandros Pappas <apappascs@gmail.com>
2025-03-10 11:34:25 +00:00
Christian Tzolov
fe377ee5e1 Refactor: MCP Autoconfig Modularization
Core Architecture Changes:
- Split MCP into dedicated client/server modules
- Created separate starters: spring-ai-starter-mcp-webmvc and spring-ai-starter-mcp-webflux
- Removed property-based transport configuration in favor of auto-configuration
- Added support for multiple transport types (STDIO, WebMVC, WebFlux)

Client Improvements:
- Added support for both synchronous and asynchronous MCP clients
- Fixed client auto-configuration issues
- Added root change notification property to common properties

Configuration Enhancements:
- Improved configuration properties organization and validation
- Added ConditionalOnMissingBean for WebMvc/WebFlux configurations
- Enhanced lifecycle management and customization support

Testing and Documentation:
- Added comprehensive integration tests for McpClientAutoConfiguration
- Updated McpServerAutoConfigurationIT
- Added extensive JavaDoc documentation
- Improved MCP client/server starter documentation
- Added documentation for common utilities
- Updated navigation for new MCP documentation sections

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-11 00:52:00 -05:00
Christian Tzolov
f40945bd63 Add Spring AI MCP Integration
Adds comprehensive Model Context Protocol (MCP) integration to Spring AI, including:

Core Features:
- MCP client implementation with Spring AI tool calling capabilities
- Spring-friendly abstractions for MCP clients and servers
- Both synchronous and asynchronous MCP server operation modes
- Add MCP client autoconfiguration with support for STDIO, WebMVC and WebFlux transports
- Auto-configuration for MCP server components
- Spring Boot starter (spring-ai-starter-mcp) with WebFlux and WebMVC support
- MCP dependency management with BOM
- Add close() method to McpToolCallback for proper resource cleanup
- Add initialize flag to control MCP client initialization
- Add comprehensive integration tests and documentation for MCP client configuration

Technical Improvements:
- Split WebMvc and WebFlux configurations into separate auto-configuration classes
- Server type configurable via 'spring.ai.mcp.server.type' property (SYNC/ASYNC)
- Comprehensive test coverage including McpServerAutoConfigurationIT
- Utility classes for converting between Spring AI tools and MCP tools
- MCP SDK version management in parent pom

Reorganize MCP tool utilities and client configuration

- Rename ToolUtils to McpToolUtils for better MCP-specific naming
- Rename McpToolCallbackProvider to SyncMcpToolCallbackProvider
- Add utility methods for handling tool callbacks in McpToolUtils
- Extract client configuration logic into new McpClientDefinitions class
- Add tool callback support to ChatClient interface and implementations
- Remove redundant integration test

Introduce MCP client customization support

- Add McpSyncClientCustomizer interface for customizing MCP sync clients
- Replace McpClientDefinitions with McpSyncClientConfigurer
- Refactor MCP client initialization to support customization
- Remove redundant close() method from McpToolCallback
- Fix conditional class dependencies in WebMvc/Flux configurations

Add MCP AOT hints

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2025-02-05 15:54:48 -05:00
Mark Pollack
d7fe07b0f1 Next development version 2024-12-23 14:25:21 -05:00
Mark Pollack
ab022fa956 Release version 1.0.0-M5 2024-12-23 14:24:55 -05:00
diego
0b00e6f446 feat(vector-store) Add MariaDB Vector Store support to Spring AI
- Updated `org.springframework.boot.autoconfigure.AutoConfiguration.imports` to include MariaDB vector store auto-configuration
- Created MariaDB Vector Store autoconfiguration integration tests (`MariaDbStoreAutoConfigurationIT`)
- Added MariaDB store properties configuration and tests (`MariaDbStorePropertiesTests`)
- Introduced new Maven modules:
  - `spring-ai-mariadb-store`: Core MariaDB vector store implementation
  - `spring-ai-starter-mariadb-store`: Spring Boot starter for MariaDB vector store
- Added `MariaDBFilterExpressionConverter` to support JSON-based metadata filtering in MariaDB
- Implemented filter expression conversion for MariaDB vector store queries
- Added README.md with documentation link for MariaDB Vector Store
- Updated project dependencies to include MariaDB JDBC driver and test containers
- Configured integration testing with TestContainers for MariaDB
- Added observability support for MariaDB vector store operations
2024-11-28 17:25:32 +01:00
Mark Pollack
67a8896422 Next development version 2024-11-20 18:03:30 -05:00
Mark Pollack
33c05c399c Release version 1.0.0-M4 2024-11-20 18:02:47 -05:00
Ilayaperumal Gopinathan
bf66415e30 Add spring-ai-coherence store boot starter to Spring AI BOM 2024-11-07 12:07:43 +00:00
Eddú Meléndez
cafcecbdcc Add spring-ai-coherence-store to bom 2024-11-06 19:53:55 -06:00
Ilayaperumal Gopinathan
d44a6aff7c GH-924 Remove PaLM API support
https://github.com/spring-projects/spring-ai/pull/1664

  - As a follow up to decommission the PaLM API, the PaLM API support is removed.
  - Remove the model and vector store classes
  - Remove the documentation entries
  - Reference: https://ai.google.dev/palm_docs/deprecation

Resolves #924
2024-11-04 15:22:50 -05:00
Christian Tzolov
0d2d4b7385 Add Bedrock Converse API chat model support
Introduces support for Amazon Bedrock Converse API through a new BedrockProxyChatModel
implementation. This enables integration with Bedrock's conversation models with features
including:
- Support for sync/async chat completions
- Stream response handling
- Tool/function calling capabilities
- System message support
- Image input support
- Observation and metrics integration
- Configurable model parameters and AWS credentials

Adds core support classes:
- BedrockUsage: Implements Usage interface for token tracking
- ConverseApiUtils: Utility class for handling Bedrock API responses including:
  - Tool use event aggregation and processing
  - Chat response transformation from stream outputs
  - Model options conversion
  - Support for metadata aggregation
- URLValidator: Utility for URL validation and normalization with support for:
  - Basic and strict URL validation
  - URL normalization
  - Multimodal input handling
- Enhanced FunctionCallingOptionsBuilder with merge capabilities for both ChatOptions
  and FunctionCallingOptions
- Added BEDROCK_CONVERSE to AiProvider enum for metrics tracking
- Extended AWS credentials support with session token capability
- Added configurable session token property to BedrockAwsConnectionProperties

Adds new auto-configuration support:
- BedrockConverseProxyChatAutoConfiguration for automatic setup of the Bedrock Converse chat model
- BedrockConverseProxyChatProperties for configuration including:
  - Model selection (defaults to Claude 3 Sonnet)
  - Timeout settings (defaults to 5 minutes)
  - Temperature and token control
  - Top-K and Top-P sampling parameters
- Integration with existing BedrockAwsConnectionConfiguration for AWS credentials

Updates to testing infrastructure:
- Adds comprehensive test suite for Bedrock Converse properties and auto-configuration
- Integration tests for chat completion and streaming scenarios
- Property validation tests for configuration options
- Temporarily disabled other Bedrock tests due to AWS quota limitations
- Added ObjectMapper configuration for proper JSON handling

Added new spring-ai-bedrock-converse-spring-boot-starter module

Updates module configuration in parent POM and BOM to include new bedrock-converse
modules and starters. Adds necessary auto-configuration imports for seamless integration
with Spring Boot applications.

Unrelated changes:
- Disabled several Bedrock model tests (Jurassic2, Llama, Titan) due to AWS quota limitations
- Disabled PaLM2 tests due to API decommissioning by Google

Resolves #809, #802

Add docs and fix configs

- Move timeout configuration from chat properties to connection properties
- Add comprehensive documentation for Bedrock Converse API usage and configuration
- Update tests to reflect configuration changes

Co-authored-by: maxjiang153 <maxjiang153@users.noreply.github.com>

Standardize AWS credential handling in integration tests

- Improve how we manage AWS credentials across our integration test
suite and ensures consistent test configuration. We're replacing individual
environment variable checks with @RequiresAwsCredentials
annotation and standardizing the use of BedrockTestUtils for context creation
in tests

We also align all AWS regions to US_EAST_1 for consistency and add missing
dependency versioning for Oracle Free.

These changes make our AWS tests more easier to maintain.

Key changes:
- Replace @EnabledIfEnvironmentVariable with @RequiresAwsCredentials
- Standardize context creation via BedrockTestUtils
- Set AWS region to US_EAST_1
- Add Oracle Free dependency version in pom.xml
2024-11-03 17:10:24 -05:00
jito
1e980d13b2 Azure cosmos-db vector store maven cleanup (#1631)
- 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>
2024-10-30 17:07:13 -04:00
Soby Chacko
8e758dbd00 Introduce checkstyle plugin
- Based on https://github.com/spring-io/spring-javaformat
- In this iteration, checkstyles are only enabled for spring-ai-core
2024-10-24 16:43:59 -04:00
Mark Pollack
4c83fe8302 Guard against NPE in ZhiPu embedding model
- Update retry test to pass - needs investigation
2024-10-08 23:37:00 +02:00
Mark Pollack
4a892b5269 Release version 1.0.0-M3 2024-10-08 23:18:50 +02:00
Anders Swanson
ccf190c77c Add OCI GenAI embedding model support
This commit introduces support for Oracle Cloud Infrastructure (OCI)
GenAI embedding models in Spring AI. It includes:

* New OCIEmbeddingModel class for interacting with OCI GenAI API
* Auto-configuration for easy setup and integration
* Properties for configuring OCI connection and embedding options
* Documentation updates explaining usage and configuration
* Integration tests to verify functionality

Signed-off-by: Anders Swanson <anders.swanson@oracle.com>
2024-09-26 17:04:05 -04:00
Eddú Meléndez
9f33e326b1 Add spring-ai-spring-boot-docker-compose to BOM
Fixes #1314
2024-09-10 14:01:24 +02:00