r/SpringAIDev • • May 08 '26

Video Building Java AI Agents with Spring AI by Yuriy Bezsonov

Thumbnail
youtube.com
2 Upvotes

In this talk, Yuri Bezsonov present how to leverage SpringAI to build agentic AI systems. In his presentation, he shows:

  • How agentic AI solutions evolved from simple assistants to full autonomous agents

  • How the agent loop enables an agent to perform complex, multi-step and reasoning actions

After introducing these fundamentals, then he proceeds to a practical application of agentic AI implementation with RAG and MCP tools integration.


r/SpringAIDev • • Aug 05 '26

Video Getting Started with GPT-4o in Spring AI with Chat and Vision Capabilities

Thumbnail
youtube.com
0 Upvotes

Dan Vega demonstrates how to integrate OpenAI's GPT-4o model into Spring applications using the Spring AI framework. This guide focuses on leveraging both text and vision capabilities for modern AI-powered development.

Highlights & Key Takeaways

  • GPT-4o Advantages: Benefit from 50% lower costs, 2x faster latency, and 5x higher rate limits compared to previous models.

  • Project Setup: Utilize the Spring AI 1.0.0-SNAPSHOT version to access the latest multimodal features.

  • Chat Implementation: Use the ChatClient API with PromptTemplates for structured interactions.

  • Vision Capabilities: Pass images via UserMessage and Media objects to allow the LLM to interpret visual data.

  • Practical Use Cases: Perform image analysis, such as scene description or extracting code snippets from screenshots.

  • API Integration: Secure sensitive keys via environment variables rather than hardcoding.

GPT-4o in Spring AI significantly lowers the barrier for building robust, multimodal Java applications.

👉 Watch the full video to dive deeper into the implementation.


r/SpringAIDev • • Jul 14 '26

Video Getting Started with GPT-4o in Spring AI with Chat and Vision Capabilities

Thumbnail
youtube.com
0 Upvotes

Dan Vega demonstrates how to integrate OpenAI's GPT-4o model into Spring applications using the Spring AI framework. This guide focuses on leveraging both text and vision capabilities for modern AI-powered development.

Highlights & Key Takeaways

  • GPT-4o Advantages: Benefit from 50% lower costs, 2x faster latency, and 5x higher rate limits compared to previous models.

  • Project Setup: Utilize the Spring AI 1.0.0-SNAPSHOT version to access the latest multimodal features.

  • Chat Implementation: Use the ChatClient API with PromptTemplates for structured interactions.

  • Vision Capabilities: Pass images via UserMessage and Media objects to allow the LLM to interpret visual data.

  • Practical Use Cases: Perform image analysis, such as scene description or extracting code snippets from screenshots.

  • API Integration: Secure sensitive keys via environment variables rather than hardcoding.

GPT-4o in Spring AI significantly lowers the barrier for building robust, multimodal Java applications.

👉 Watch the full video to dive deeper into the implementation.


r/SpringAIDev • • May 25 '26

Spring AI Recipe: Logging LLM Requests and Responses

Thumbnail thetalkingapp.medium.com
0 Upvotes

Craig Walls recently shared a recipe for logging LLM requests and responses, making it easier to debug and understand how prompts, advisors, and tools shape the output. The article explores two main approaches developers can use to gain visibility into their AI workflows.

Highlights / Key Takeaways

  • SimpleLoggerAdvisor offers a quick setup to log requests and final responses.

  • It’s lightweight but doesn’t capture intermediate tool interactions.

  • Logbook provides full-cycle visibility, including tool calls and results.

  • It requires extra setup and works with RestClient-based model implementations.

  • SimpleLoggerAdvisor is best for quick inspection, while Logbook suits deep debugging.

  • Logging is critical as agentic workflows grow more complex.

In short, effective logging isn’t just about troubleshooting—it’s about refining and improving how your AI systems behave.

👉 Check out the full article for implementation details and code examples.


r/SpringAIDev • • May 23 '26

Video Spring AI : How to perform Vector Search using Vector Store ?

Thumbnail
youtube.com
0 Upvotes

In this tutorial, TechyTacos walks Java developers through implementing vector search using the Spring AI framework. The video provides a practical guide to integrating and querying a simple vector store, making it a great starting point for those looking to build AI-powered applications with Spring.

Key Takeaways:

  • Learn the fundamental process of converting text data into document objects for vector storage.

  • Understand the role of embedding models, specifically OpenAI, in transforming text into numerical vectors.

  • See how to configure an in-built simple vector store to avoid complex external database setups.

  • Discover how the K-nearest neighbor algorithm enables similarity searches for queries.

  • Explore how to enhance search precision using SearchRequest filters and similarity thresholds.

This walkthrough demystifies integrating generative AI components into a standard Spring ecosystem. Check out the video to see the code in action!


r/SpringAIDev • • May 13 '26

Video Spring AI : Build generative AI applications using Spring Boot and Java

Thumbnail
youtube.com
0 Upvotes

Hello community!

This video does a fantastic job of walking through the fundamentals of Spring AI, showing how you can integrate OpenAI models directly into your Java applications.

Here’s what it covers:

  • Setting up the environment: A step-by-step guide on configuring pom.xml with the necessary repositories and dependencies.

  • Building the App: How to set up your Controller and Service layers effectively.

  • Hands-on Examples:

    • Generating creative content like jokes using AIClient and PromptTemplate.

    • Parsing responses into structured JSON for more complex application needs.

It’s a perfect entry point if you're tired of switching to Python just to experiment with LLMs. Check it out if you're looking to modernize your stack!


r/SpringAIDev • • Aug 25 '26

Article A Guide to Structured Output in Spring AI

Thumbnail
baeldung.com
0 Upvotes

In this guide, Dmytro Ponomarenko demonstrates how to tame unpredictable LLM responses using Spring AI. It explores the Structured Output API to seamlessly parse AI-generated text into strict Java objects.

Highlights & Key Takeaways

  • Predictable AI: Force LLMs to return valid JSON rather than unstructured strings.

  • Core Interface: StructuredOutputConverter injects JSON schema instructions into your prompt and parses the AI's reply.

  • Java Beans: BeanOutputConverter maps AI responses directly into your custom Java classes.

  • Collections Support: Generate simple structures instantly with ListOutputConverter and MapOutputConverter.

  • Custom Solutions: Build tailored converters using Jackson's ObjectMapper to handle complex, generic data types.

These tools bridge the gap between flexible AI output and strict application logic, ensuring robust, type-safe system integrations.

👉 Read the full Baeldung article for code examples and implementation details.


r/SpringAIDev • • May 24 '26

Using Spring AI's Output Parsers to structure the response from LLMs

Thumbnail
youtube.com
0 Upvotes

In this tutorial, Dan Vega explores how to move beyond raw string responses when working with Large Language Models in Spring AI. He demonstrates how developers can leverage Output Parsers to transform unstructured LLM output into typed, usable objects for real-world applications.

Key Takeaways:

  • Output Parsers are essential for turning raw LLM text into actionable data structures.

  • The List Output Parser allows you to easily parse comma-separated results into a Java List.

  • The Map Output Parser is ideal for structuring complex, key-value data returned by the model.

  • The Bean Output Parser converts LLM responses directly into custom POJOs or Java Records.

  • Proper prompt engineering remains critical to ensuring the LLM respects the requested output format.

Structuring LLM responses is a vital step in building robust AI integrations. By using these built-in Spring AI tools, you can ensure your code remains type-safe and reliable.


r/SpringAIDev • • Jun 08 '26

Discussion Craig Walls’ Spring AI in Action is out: 5-book giveaway + Spring AI discussion

4 Upvotes

Hi r/SpringAIDev,

Manning here. The mods invited us here, so we wanted to share something that should be directly relevant to this community:

Craig Walls’ Spring AI in Action

Craig is a principal engineer on the Spring team and the author of Spring in Action. This new book is written for Spring developers who want to build AI features in Java and Spring Boot without having to stitch together a Python sidecar or learn an entirely different app stack first.

The book starts with a small “Hello AI” Spring Boot app, then keeps building on it until you have a much more serious AI-enabled application. The running example is Board Game Buddy, an assistant that answers questions about tabletop game rules. Across the book, it picks up RAG, chat memory, tools, MCP, voice, images, observability, security, and agents.

A few topics that seem especially relevant here:

  • ChatClient, prompt templates, roles, response metadata, and streaming

  • Testing and evaluating generated responses

  • RAG with vector stores, document loading, Qdrant, advisors, and modular RAG

  • Conversational memory, including persistent memory

  • Tool calling with u/Tool methods and Java Function-style tools

  • Model Context Protocol clients and servers

  • Audio transcription, text-to-speech, image input, and image generation

  • Actuator metrics, Prometheus, Grafana, and tracing AI operations

  • Spring Security for RAG filtering, secured tools, prompt leaks, and moderation

  • Agentic workflows and Embabel

What I like about the book is that it treats Spring AI as part of the Spring application model, not as an isolated demo layer. The examples are controllers, services, configuration, tests, Actuator endpoints, security rules, Docker Compose files, and Gradle builds. In other words, the sort of code Spring developers actually have to maintain.

We also have 5 ebooks to give away to the 5 most thoughtful commenters.

To enter, leave a comment with your take on one of these:

  • What are you building, or hoping to build, with Spring AI?

  • Where do you think Spring AI fits best in production Java apps?

  • What’s your biggest concern with adding LLMs to Spring Boot systems?

  • Are you more interested in RAG, tools, MCP, agents, observability, or security?

  • If you’ve tried Spring AI already, what surprised you?

We’ll look at the comments and community upvotes, then pick 5 winners.

For everyone else, Manning has a 50% discount code for this subreddit:

PBWALLS1050RE

I’m especially curious how this community is thinking about MCP and agents in Spring apps now that Spring AI has moved beyond basic chat examples. Is MCP becoming part of your architecture, or are most teams still focused on RAG and tool calling first?

Thanks for having us. It feels great to be here.

Cheers,

Stjepan


r/SpringAIDev • • Aug 24 '26

Article Configuring Multiple LLMs in Spring AI

Thumbnail
baeldung.com
1 Upvotes

In this guide, Hardik Singh Behl demonstrates how to integrate multiple Large Language Models (LLMs) in a Spring Boot app using Spring AI. The focus is on configuring a range of models to build a highly resilient chatbot.

Highlights & Key Takeaways

  • Multi-Provider Setup: Configure LLMs from different providers, like OpenAI and Anthropic, together.

  • Primary Routing: Designate a default model using the @Primary annotation on a ChatClient bean.

  • Same-Provider Config: Manually define custom ChatModel beans to run multiple models from one provider.

  • Spring Retry: Use @Retryable to handle transient API failures from your primary LLM.

  • Graceful Fallbacks: Implement @Recover methods to automatically switch to backup models during outages.

Layering multiple LLMs with robust fallback mechanisms ensures continuous availability during provider outages. This architecture guarantees a highly reliable user experience.

👉 Check out the full Baeldung article to see the complete code.


r/SpringAIDev • • 3d ago

Question Any one here know about cards problem when add to render?

1 Upvotes

Java spring boot


r/SpringAIDev • • May 20 '26

Tutorial Spring AI Recipe: Composing ChatClient Behavior

Thumbnail thetalkingapp.medium.com
1 Upvotes

In this Spring AI recipe, we dive into how to keep ChatClient clean and modular by using ChatClientCustomizer. Instead of stuffing every feature into a single config, we compose behaviors —such as tools, prompts, and conditions—separately, making the system easier to extend and maintain.

Key takeaways:

  • Add tools (like weather lookups) without bloating the core client

  • Use customizers to inject prompts or behaviors independently

  • Keep concerns separated for clarity and reusability

  • Toggle features on/off via application.properties with @ConditionalOnProperty

  • Gain flexibility through environment variables or config servers

  • Treat customizers as a design pattern, not just convenience

In short, this approach makes advanced agentic scenarios manageable and future-proof.


r/SpringAIDev • • Aug 06 '26

Video Building Agentic Applications with Spring AI • Matthew Meckes • GOTO 2025

Thumbnail
youtube.com
1 Upvotes

Matthew Meckes explores how Java developers can leverage Spring AI to build production-ready agentic applications that integrate seamlessly with existing enterprise systems.

Highlights & Key Takeaways

  • Agents use LLMs, memory, and tools to perform autonomous tasks, but production scale requires robust control flow.

  • Spring AI provides abstractions for RAG, chat memory, and function calling within the familiar Spring ecosystem.

  • Use the Model Context Protocol (MCP) to expose existing Java beans as tools without rewriting logic.

  • Prioritize human-in-the-loop workflows to validate agent outputs and manage hallucinations.

  • Keep agent scope small—3 to 10 steps—to ensure reliability and testability.

  • Focus on using LLMs to bridge natural language and structured API calls, rather than relying solely on agentic reasoning.

Ultimately, Spring AI allows enterprises to modernize by embedding AI agents directly into proven Java stacks.

👉 Watch the full video to dive deeper into the implementation.


r/SpringAIDev • • May 29 '26

Multi model setup using Spring AI

1 Upvotes

Last Friday I shared what I learned from swapping providers in a Spring AI app. This Friday: what happens when you stop swapping and start routing dynamically.

Same project as previous videos. Same ChatClient code. The only new piece is a dispatcher that looks at each request before choosing which provider handles it.

The pattern in one method:

public RoutedResponse route(String prompt) {

RoutingDecision decision = router.route(prompt);

ChatClient client = (decision.tier() == ModelTier.LOCAL)

? localClient

: cloudClient;

ChatResponse response = client.prompt(prompt).call().chatResponse();

long[] tokens = extractTokens(response, prompt, text);

tracker.record(decision, tokens[0], tokens[1]);

return new RoutedResponse(decision, text);

}

Two ChatClient beans — one autoconfigured against LM Studio (local), one explicit @Configuration for Anthropic (cloud). Spring's qualifier mechanism handles disambiguation. The dispatch is a ternary expression.

The router itself is intentionally simple — length check + keyword check. Not embeddings, not a classifier model. Just transparent rules you can debug by reading the code.

Result from the demo: 10 code review requests, 7 routed local, 3 routed cloud. Routed total $0.25 vs all-cloud baseline $0.48 — 48% lower, with identical-quality answers on the easy questions (verified by side-by-side comparison).

The data point worth flagging: those 7 routed-away queries would have cost ~$0.23 collectively on cloud, almost matching the $0.25 from the 3 cloud queries. The cheap-individually queries collectively rival the expensive ones. Routing the long tail away from cloud is where the real savings come from, not avoiding premium prices on premium queries.

A few practical notes that aren't obvious until you actually ship this:

  1. Anthropic's API requires max_tokens on every request. Without it, Spring AI's default truncates Opus responses mid-sentence. Set it explicitly to 4096 on cloud options.

  2. Claude Opus regularly takes 15-45 seconds per call. Spring AI's underlying Reactor Netty client has a default response timeout shorter than that. You'll see ReadTimeoutException in the Spring log if you don't extend it. Custom RestClient.Builder with responseTimeout(Duration.ofSeconds(300)).

  3. Don't refactor the original endpoints. The /chat, /review, /chat-with-tools endpoints from Model Switching keep running on the autoconfigured local ChatClient unchanged. The new multi-model controller lives in a separate package under /ai. Less surgery, less narrative debt.

Recorded the full walkthrough including a live cost dashboard demo: https://youtu.be/ziMzlY9Szvs

Has anyone here implemented cost-based routing in production? Curious how teams are handling the "is this request hard enough to escalate" decision — keyword rules, embeddings, confidence scoring, or something else.

As always, latest code in the repo: https://github.com/DmitryFinashkin/spring-ai


r/SpringAIDev • • May 21 '26

ChatClient Fluent API in Spring AI

Thumbnail
baeldung.com
1 Upvotes

Spring AI’s ChatClient Fluent API is designed to make building conversational applications smoother and more intuitive. Baeldung’s article dives into how developers can leverage this API to integrate AI-driven chat features directly into Spring projects, with a focus on flexibility and clean design.

Key takeaways:

  • Provides a fluent, chainable API for building chat interactions.

  • Simplifies integration of AI models into Spring applications.

  • Supports structured prompts and responses for better control.

  • Enables customization of conversation flow with minimal boilerplate.

  • Designed to be developer-friendly, reducing complexity in setup.

  • Encourages clean, maintainable code for AI-driven features.

In short, this API helps developers bring conversational AI into their Spring apps without the usual headaches of complex configuration. It’s a practical step forward for anyone working with AI in Java-based projects.


r/SpringAIDev • • May 16 '26

Article Spring AI Series, by Baeldung

1 Upvotes

Hello community!

This post at Baeldung is a compilation of many other articles on Spring AI.

It covers everything from basic to advanced topics, including the ChatClient and memory, as well as more advanced ones such as RAG pipelines, vector search, advisors, and multimodal models.

If you do not like to spend too much time digging on the internet, it is definitely worth saving this page in your bookmarks.

Check the post in the link below 👇
https://www.baeldung.com/spring-ai-series


r/SpringAIDev • • May 12 '26

Your First Spring AI 1.0 Application

Thumbnail
spring.io
1 Upvotes

This article by Spring AI developers introduces the fundamental concepts of Spring AI, including ChatClient, ChatMemory, system prompts, vector stores, and more.


r/SpringAIDev • • Aug 19 '26

Tutorial Ever wish your AI app could catch its own bad answers before a user sees them?

1 Upvotes

One model checks another model's work and retries if it's not good enough. New tutorial shows you how to build it, step by step.

That's basically what LLM-as-a-Judge does in Spring AI.

"LLM-as-a-Judge" and "LLM evaluation testing" are not the same thing. One runs in JUnit before you deploy. The other runs live, in the request path, and can retry a weak response automatically.

5 things to know before you build LLM-as-a-Judge into a Spring AI app:

  1. It's implemented via Recursive Advisors, a CallAdvisor that can call back into its own chain

  2. Non-streaming only, as of Spring AI 2.0

  3. Every failed judge check costs 2 extra LLM calls: one to judge, one to regenerate

  4. Use a separate model to judge, or you risk narcissistic bias

  5. Always cap maxAttempts, or a stubborn judge creates an infinite loop Full breakdown, with working code, in the new article.


r/SpringAIDev • • Sep 17 '26

Tutorial One project description can change the way a recruiter sees your Java Spring Boot profile.

Thumbnail javatechonline.com
1 Upvotes

Weak version: Developed an e-commerce application using Java and Spring Boot.

Stronger version: Developed Spring Boot REST APIs for product, cart, and order workflows; integrated MySQL using Spring Data JPA; implemented JWT authentication and centralized exception handling.

Even better, if the metric is real: Developed Spring Boot REST APIs for an e-commerce platform serving 10,000+ monthly users, integrated MySQL with Spring Data JPA, and reduced order-processing errors by 30% through validation, exception handling, and automated test coverage.

Your projects are not just “projects.”

They are proof that you can build, debug, integrate, test, and deliver software.

Use Java Resume Scanner to identify vague bullets and turn them into stronger Java resume content.


r/SpringAIDev • • May 31 '26

Article Spring AI Recipe: Asking Questions to the User

Thumbnail thetalkingapp.medium.com
1 Upvotes

Craig Walls recently published a recipe for building more natural AI conversations with Spring AI by enabling the system to ask clarifying questions of the user. This approach makes interactions feel less rigid and more collaborative.

Highlights / Key Takeaways

  • LLMs often need extra context, so asking questions improves accuracy.

  • Spring AI’s ChatClient and advisors manage dynamic conversation flows.

  • Advisors detect incomplete input and trigger follow-up questions.

  • The AI pauses, requests missing info, then continues processing.

  • This pattern supports agentic workflows where AI acts like a collaborator.

In short, the recipe shows how developers can design conversational flows that feel more human, with the AI actively engaging instead of passively responding.

👉 Read Craig Walls’ full article for examples and implementation details.


r/SpringAIDev • • May 22 '26

Bootiful Spring AI by Mark Pollack, Christian Tzolov, Josh Long, James Ward

Thumbnail
youtube.com
1 Upvotes

At Devoxx, Dr. Mark Pollack, Christian Tzolov, Josh Long, and James Ward explore how to integrate modern AI into Java applications using the powerful Spring AI framework. The team demonstrates how developers can leverage existing enterprise systems to build sophisticated AI-driven solutions without leaving the familiar Spring ecosystem.

Key Takeaways:

  • Spring AI provides a portable abstraction layer for connecting to diverse LLMs, including Amazon Bedrock.

  • Developers can implement semantic search and RAG patterns using existing data stores like PostgreSQL.

  • The Model Context Protocol (MCP) enables standardized, bidirectional communication between AI agents and tools.

  • Structured output support allows developers to receive type-safe JSON directly from AI models.

  • The new Spring AI Agent project introduces portable SDKs for managing complex, goal-oriented AI tasks.

This session bridges the gap between traditional enterprise development and the new agentic AI paradigm, proving that Java developers are perfectly positioned to lead the next wave of AI engineering.

Watch the full presentation to see these powerful integrations in action!


r/SpringAIDev • • Aug 26 '26

Article Using Anthropic’s Claude Models With Spring AI

Thumbnail
baeldung.com
1 Upvotes

In this guide by Hardik Singh Behl, developers learn to integrate Anthropic’s Claude models into applications using Spring AI. The article demonstrates how to build a context-aware, multimodal chatbot.

Highlights & Key Takeaways

  • Dual Integration: Connect via Anthropic API or Amazon Bedrock Converse API.

  • Quick Setup: Use Spring AI dependencies for rapid configuration.

  • Stateful Memory: Add InMemoryChatMemory for multi-turn conversation context.

  • Custom Personas: Guide model behavior using injected system prompts.

  • Multimodal Input: Process text and image/PDF data through a unified service.

  • REST APIs: Serve the AI chatbot via standard Spring Boot controllers.

Using Spring AI lets engineering teams quickly deploy multimodal features with minimal infrastructure overhead.

👉 Read the full guide to explore the implementation.


r/SpringAIDev • • May 22 '26

Spring AI with local model through LM Studio

2 Upvotes

Couple of days ago I shared what I learned about Spring AI's chat memory. Today, here's what happened when I swapped the model behind it entirely.

Same Spring AI app. Same Java code. Same ChatClient, same @Tool annotations, same BeanOutputConverter for structured output. The only thing that changed: which model handled the requests.

OpenAI (GPT-4o) → Anthropic Claude Opus 4→ local Gemma 4 2B running through LM Studio.

The OpenAI → Claude switch was expected to work. Swap the starter dependency, update the config block, ship. Spring AI's provider abstraction is designed for this.

The local Gemma 4 2B switch was the interesting part. Same Anthropic starter dependency, just pointed at localhost:1234:

spring:

application:

name: spring-ai

ai:

anthropic:

api-key: ${LM_STUDIO_API_KEY}

base-url: http://127.0.0.1:1234

chat:

options:

model: google/gemma-4-e2b

memory:

repository:

jdbc:

initialize-schema: always

That's the entire config delta. LM Studio implements the Anthropic protocol, so Spring AI treats it as just another Anthropic-compatible endpoint. No separate "spring-ai-local" starter. No conditional Java code paths.

What I didn't expect — the 2B local model handled:

- Chat with memory (the same ChatMemoryAdvisor + JDBC repository setup from yesterday's post)

- Structured JSON output matching strict schemas

- Tool calling with proper parameter dispatch

- Code review (correctly identified a == vs .equals() bug in a real Java example)

Quality wasn't quite GPT-4o level, but it was meaningful enough that for what's probably 70% of business AI use cases — classification, summarization, structured extraction, simple agent loops — this would work in production. With zero per-request cost and full offline operation.

Recorded a walkthrough showing all three providers running the same demos (chat, memory, structured output, tool calling, code review) if you prefer video: https://youtu.be/lW0FMjDUzik

Repo with code: https://github.com/DmitryFinashkin/spring-ai

Has anyone here shipped multi-provider Spring AI in production yet? Curious how teams are handling provider routing — cost-based, latency-based, quality fallback, regional compliance — and what failure modes you're watching for.


r/SpringAIDev • • May 29 '26

Prompt Engineering Using Spring AI

2 Upvotes

🚀 Here is the Part 2 of my AI series using Spring AI !

In this blog, I have covered one of the most important (and often underrated) topics in AI development:

👉 Prompt Engineering using Spring AI

In this blog, I have explained:
✅ What is Prompt Engineering (in simple terms)
✅ How to implement it using Spring AI
✅ Different techniques

🔗 Read the full blog here:

https://heapsteep.com/prompt-engineering-using-spring-ai

This is Part 2 of the series… more practical AI concepts coming soon!


r/SpringAIDev • • Jun 05 '26

Streaming Response in Spring AI ChatClient

Thumbnail
baeldung.com
2 Upvotes

Large Language Models are powerful but inherently stateless—they don’t remember past prompts. Baeldung’s article on Chat Memory in Spring AI explores how developers can add memory to conversations, making AI interactions more contextual and natural.

Key takeaways:

  • Chat memory enables context, personalization, and persistence across sessions

  • In‑memory repositories are simple but short‑lived

  • JDBC repositories allow long‑term persistence in relational databases

  • Spring AI integrates memory with ChatService and MessageChatMemoryAdvisor

  • Session scope ensures continuity across multiple requests

  • OpenAI integration demonstrates how past messages enrich responses

By combining chat memory with Spring AI, developers can build smarter, more human‑like conversational systems that go beyond one‑off prompts.

Want the full breakdown? Check out Baeldung’s article for all the details.