A Vaadin-based web app that simulates a ChatGPT-like chat interface, built with Spring Boot, Kotlin, and Spring AI.
This project demonstrates how to integrate AI-driven chat using the Spring AI Ollama library with a customizable memory advisor, perfect for applications like virtual trip planning.
- AI Chat Interface: Chat with the AI assistant, “Path Buddy,” who offers travel advice and suggestions.
- Memory-Driven Responses: Contextual, memory-enabled conversations that retain prior interactions.
- User-Friendly UI: Designed with Vaadin for a sleek, responsive chat experience.
- Kotlin & Reactive Programming: Leverages Kotlin and Reactor for non-blocking, reactive chat responses.
- Kotlin
- Spring Boot 4 (Spring AI)
- Ollama AI
- Gemma models
- Vaadin
- Java 21 or higher.
- Ollama installed locally (instructions below)
- Maven
To install Ollama, follow these steps:
- Download Ollama: Visit the Ollama download page and download the installer for your operating system.
- Install the application: Follow the instructions on the page to install Ollama on your system.
- Download the Mistral Model: Go to the terminal and run:
ollama pull gemma4
Once Ollama is installed, you can use the model directly with the Spring Boot application.
- ChatService: Handles communication with the AI model using ChatClient.
- ChatConfig: Configures the chat memory and advisors for personalized conversation context.
- ChatView: Manages chat UI with Vaadin, including message display and user input.
- MainLayout: Provides a navigation bar with the app title.
- Clone the Repository
git clone https://github.com/dfjmax/vaadin-spring-ai-chat-gpt.git cd vaadin-spring-ai-chat-gpt - Starting the application: After the model is downloaded simply run:
mvn clean install mvn spring-boot:run