Status: [UNTESTED] Endpoints found: http://localhost:8080/ai/chat?message=Hello%20from%20Spring%20AI http://localhost:8080/ai/chat/stream?message=Tell%20me%20a%20short%20story http://localhost:8080/ai/chat/memory?sessionId=$SESSION&message=My%20name%20is%20Tiago http://localhost:8080/ai/chat/memory?sessionId=$SESSION&message=What%20is%20my%20name%3F http://localhost:8080/ai/chat/tools?message=What%20is%20the%20current%20date%3F%20Use%20the%20tool%20to%20answer Source: https://github.com/tiagouzl/spring-ai-ollama-demo # Spring AI + Ollama Demo ![Java](https://img.shields.io/badge/Java-21-ED8B00?logo=openjdk&logoColor=white) ![Spring Boot](https://img.shields.io/badge/Spring_Boot-3.4-6DB33F?logo=spring&logoColor=white) ![Spring AI](https://img.shields.io/badge/Spring_AI-1.0.0-green) ![Ollama](https://img.shields.io/badge/Ollama-granite4.1:3b-000000) [![Build](https://img.shields.io/github/actions/workflow/status/tiagouzl/spring-ai-ollama-demo/ci.yml?branch=main&label=CI)](https://github.com/tiagouzl/spring-ai-ollama-demo/actions) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) A minimal, production-style **Spring Boot 3** application that integrates **Spring AI** with a **local LLM served by Ollama** โ€” no cloud API key required, fully offline and free. This project is a clean reference for building AI-agent / LLM applications on the **Java + Spring** ecosystem, which is widely adopted by enterprises in China (Spring AI Alibaba ecosystem). --- ## โœจ Highlights - ๐Ÿ“ฆ **Spring Boot 3.4** + **Spring AI 1.0.0 (GA)** - ๐Ÿ  **100% local & free** โ€” uses Ollama, no OpenAI/DashScope key needed - โšก Powered by the fluent `ChatClient` API - ๐Ÿ”„ **Streaming** responses (Server-Sent Events) with `ChatClient.stream()` - ๐Ÿ’ฌ **Multi-turn chat** with per-conversation memory (`MessageChatMemoryAdvisor`) - ๐Ÿ›  **Function calling / Tool use** with `@Tool` โ€” model calls Java methods (`DateTimeTools`, `MathTools`) - ๐Ÿ” **RAG** with `SimpleVectorStore` + `nomic-embed-text` (local embeddings, no external DB) - ๐Ÿงน Minimal setup โ€” only `spring-boot-starter-web`, `spring-ai-starter-model-ollama`, `spring-ai-vector-store` - ๐Ÿ‡จ๐Ÿ‡ณ Aligned with the **Spring AI Alibaba Agent Framework** learning path --- ## ๐Ÿ›  Tech Stack | Layer | Technology | |-----------|-----------------------------------------------| | Language | Java 21 (LTS) | | Framework | Spring Boot 3.4.5