Spring

Spring is a powerful set of tools designed for building web applications quickly and efficiently, allowing developers to create enterprise-level applications by using a simple and extensible way of making the code. Spring framework facilitates the use of Java or other languages to create the application and to be deployed on any sort of tiered server whether it be an HTTP server or an application server. Spring has been proven to add value in a wide range of environments, making a wide range of tasks easier for both smaller and larger teams. The framework provides different modules which can be used separately or together to create enterprise-level applications, bringing flexibility and simplicity to the development process. The official Spring site provides various resources and tools such as documentation, tutorials, training courses, and examples that help developers to get started and master the framework. The site also includes the latest release notes, updates, and a community section where developers can share ideas, get support, or contribute to the project.

Thread Of Notes

Large language models, while powerful, struggle with structured data for software integration. Spring AI's structured output bridges this gap by allowing models to produce text conforming to a defined schema, which is then parsed into typed objects. Spring AI 2.0 introduces two key enhancements: provider-native structured output and self-correcting schema validation. Existing code remains compatible due to unchanged defaults.To generate structured output, developers define a Java record and then use the .entity() method to specify the target type. This process internally generates a JSON schema from the record, appends it to the prompt, and parses the model's JSON response back into the desired object. Prior to Spring AI 2.0, this process lacked guarantees, leading to potential parsing errors if models deviated from the schema.The .validateSchema() switch activates a self-correcting retry loop, automatically validating the model's response against the schema and re-issuing the prompt with specific error feedback if validation fails. For stronger guarantees, .useProviderStructuredOutput() leverages provider-specific API features to enforce schema conformance at the source. This minimizes malformed output by preventing invalid responses from being emitted in the first place.These two features can be combined for maximum resilience, with provider-native output acting as a primary constraint and schema validation as a fallback. For generic types like Lists and Maps, ParameterizedTypeReference is used instead of a simple Class. The .responseEntity() method allows access to both the parsed entity and the raw ChatResponse for metadata.When built-in converters are insufficient, custom StructuredOutputConverter implementations can handle non-standard JSON wrapping or entirely different formats like YAML or CSV. This provides further flexibility for diverse integration needs.
CdXz5zHNQW_ujOXatEKZz.png
The Spring AI engineering team has announced the release of Spring AI 2.0.0-RC1, which is an API stabilization milestone on the road to 2.0.0 GA. This release includes a unified tool execution across all models, with tool execution now handled externally via ChatClient with ToolCallingAdvisor. The internalToolExecutionEnabled property has been removed, and the toolNames API and SpringBeanToolCallbackResolver have been replaced with explicit ToolCallback beans. The ToolCallAdvisor has been renamed to ToolCallingAdvisor, and a new ToolSearchToolCallingAdvisor has been introduced for on-demand tool discovery. Memory advisors are now placed outside ToolCallingAdvisor by default, and the DEFAULT_CHAT_MEMORY_PRECEDENCE_ORDER has been lowered. The release also includes chat memory improvements, such as turn-boundary snapping in MessageWindowChatMemory and avoiding duplicate chat memory in tool prompts. Structured output enhancements have been added, including the ability to access the timestamp field from the spring_ai_chat_memory table programmatically. The release also includes API and code cleanup, model updates, bug fixes, documentation updates, and dependency upgrades. The Spring AI team thanks all the contributors who worked on this release, and resources are available on the project page, GitHub, and Stack Overflow. The release notes and documentation for 2.0.0-RC1 are also available. Overall, this release provides a range of improvements and enhancements to the Spring AI framework, and is an important step towards the final 2.0.0 GA release.