You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🚀🚀🚀 Spring AI Summary is a collection of sample projects based on native Spring AI, designed to help developers quickly master the core features and usage of the Spring AI framework. With a modular design, each module focuses on a specific functional area, providing clear code examples and detailed documentation to help you get started easily and deeply understand the core concepts of the framework.
10
12
11
-
🚀🚀🚀 This project is a quick-start sample for Spring AI, designed to demonstrate the core features and usage of the Spring AI framework through practical mini-cases. The project adopts a modular design, with each module focusing on a specific functional area for easy learning and extension.
13
+
### Project Features
12
14
13
-
## 📖 About Spring AI
15
+
-**Modular Design**: Each module focuses on a functional area, such as chat, RAG (Retrieval Augmented Generation), text embedding, tool function calling, chat memory management, etc., making it easy for developers to learn and apply as needed.
16
+
-**Practical Examples**: Each module contains complete sample code and documentation, demonstrating real-world application scenarios of Spring AI, helping you quickly build your own AI applications.
17
+
-**Continuous Updates**: The project keeps up with the latest developments and version updates of Spring AI, optimizing sample code and documentation in a timely manner to ensure content is always up-to-date.
18
+
-**Community Support**: High-quality technical articles and practical experience are shared, offering best practices to help developers better understand and apply Spring AI.
14
19
15
-
The goal of the Spring AI project is to simplify the development of applications that integrate AI capabilities, avoiding unnecessary complexity. For more information, please visit the [Spring AI official documentation](https://spring.io/projects/spring-ai).
20
+
### Who Is This For?
21
+
22
+
Spring AI Summary is for developers interested in the Spring AI framework. Whether you are a beginner or an experienced engineer, you can quickly learn the core features of the framework and apply them to real projects through this project.
23
+
24
+
With Spring AI Summary, you can:
25
+
26
+
- Master the core concepts and features of Spring AI.
27
+
- Learn how to build efficient AI applications.
28
+
- Get the latest technical trends and practical experience.
29
+
30
+
Welcome to join the community and explore the infinite possibilities of Spring AI together!
cd spring-ai-summary && mvn clean compile -DskipTests
82
84
```
83
85
86
+
> If you encounter slow Maven dependency downloads, try using a domestic Maven mirror (e.g., Aliyun, Tsinghua). For any other issues, feel free to join the WeChat group above for discussion and support.
87
+
84
88
### 2. 🛠️ Configure Environment Variables
85
89
86
90
For each module, configure the required API keys in the `application.yml`/`application.properties` file under the `resources` folder. For example, in **spring-ai-chat-deepseek**:
Replace `spring.ai.deepseek.api-key` with your actual API key to start the service.
95
-
96
-
### 3. 🗄️ Start Milvus
97
-
98
-
Milvus is an open-source vector database for storing and retrieving high-dimensional vector data. This project uses Docker to run Milvus, but you can use other installation methods or an existing Milvus service.
99
-
100
-
> PS: If you do not use the spring-ai-rag or spring-ai-embedding modules, you can skip this step.
99
+
Replace `spring.ai.deepseek.api-key` with your actual API key to start the service. For how to apply for an API key, see the project [Wiki page](https://github.com/java-ai-tech/spring-ai-summary/wiki).
101
100
102
-
The project uses Milvus version 2.5.0. See the [Install Milvus in Docker](https://milvus.io/docs/install_standalone-docker.md) guide.
103
-
104
-
⚠️ On Mac Air M2, there may be issues with the `milvus-standalone` image when using the official docker-compose file.
105
-
106
-
### 4. ▶️ Run Examples
101
+
### 3. ▶️ Run Examples
107
102
108
103
After the above steps, you can run different modules to experience Spring AI features. For example, to start **spring-ai-chat-deepseek** (port may vary):
104
+
109
105
```bash
110
106
2025-06-04T14:18:43.939+08:00 INFO 88446 --- [spring-ai-chat-deepseek] [ main] c.g.ai.chat.deepseek.DsChatApplication : Starting DsChatApplication using Java 21.0.2 with PID 88446 (/Users/glmapper/Documents/projects/glmapper/spring-ai-summary/spring-ai-chat/spring-ai-chat-deepseek/target/classes started by glmapper in /Users/glmapper/Documents/projects/glmapper/spring-ai-summary)
111
107
...
112
108
```
113
-
Once started, you can test with HTTPie or Postman:
109
+
Once started, you can test with cUrl, HTTPie, or Postman:
110
+
114
111
```bash
115
-
GET /api/deepseek/chatWithMetric?userInput="Who are you?" HTTP/1.1
116
-
Host: localhost:8081
117
-
User-Agent: HTTPie
112
+
curl localhost:8081/api/deepseek/chatWithMetric?userInput="Who are you?"
@@ -142,38 +139,36 @@ Example response for `ai.completion.tokens`:
142
139
}
143
140
```
144
141
145
-
## 📚 Module Overview
142
+
**For usage and configuration of other modules, see the [Wiki page](https://github.com/java-ai-tech/spring-ai-summary/wiki) or each module's `README.md`.**
143
+
144
+
## 📚 Learning Resources (Continuously Updated)
146
145
147
-
### 1. 💬 Chat Module (spring-ai-chat)
146
+
Here are some recommended learning resources:
148
147
149
-
Provides integration with multiple LLMs:
150
-
- Single-model chat: OpenAI, Qwen, Doubao, DeepSeek, etc.
151
-
- Multi-model parallel: Call multiple models and compare results
152
-
- Prompt templates: Customizable prompt templates and variable replacement
153
-
- Token stats: Input/output token statistics and cost estimation
148
+
> The official [Awesome Spring AI](https://github.com/spring-ai-community/awesome-spring-ai) list is also available, but it mainly collects overseas resources. This project focuses on aggregating domestic learning resources for your reference.
154
149
155
-
###2. 📖 RAG Module (spring-ai-rag)
150
+
#### Technical Community
156
151
157
-
Implements retrieval-augmented generation:
158
-
- Document embedding: Supports various document formats
159
-
- Vector storage: Efficient storage and retrieval with Milvus
160
-
- Semantic search: Similarity and hybrid search
161
-
- Answer generation: Generate accurate answers based on retrieval
152
+
-[Spring AI Official Documentation](https://spring.io/projects/spring-ai)
153
+
-[Spring AI Alibaba Official Documentation](https://github.com/alibaba/spring-ai-alibaba)
-[How to Build Agents with Spring AI (YouTube)](https://www.youtube.com/watch?v=d7m6nJxfi0g)
169
+
-[Spring AI Video Tutorials (YouTube)](https://www.youtube.com/watch?v=yyvjT0v3lpY&list=PLZV0a2jwt22uoDm3LNDFvN6i2cAVU_HTH)
172
170
173
-
Provides chat history management:
174
-
- JDBC persistence: Store chat history in a database
175
-
- Local file storage: Store chat history in the file system
176
-
- Context management: Manage and clean up chat context
171
+
If you have good articles or resources, feel free to submit a PR or Issue to supplement and improve this list. See below for development and contribution guidelines.
177
172
178
173
## 🔧 Development Guide
179
174
@@ -189,6 +184,7 @@ Provides chat history management:
189
184
190
185
2.**Create a feature branch**
191
186
```bash
187
+
# Create and switch to a new feature branch
192
188
git checkout -b feature/your-feature-name
193
189
```
194
190
@@ -211,39 +207,14 @@ Provides chat history management:
211
207
- Describe your changes and reasons
212
208
- Wait for review and merge
213
209
214
-
### Development Environment Setup
215
-
1.**IDE Setup**
216
-
- Recommend IntelliJ IDEA
217
-
- Install Lombok plugin
218
-
- Configure Java 21 SDK
219
-
2.**Maven Setup**
220
-
```xml
221
-
<properties>
222
-
<java.version>21</java.version>
223
-
<spring-ai.version>1.0.0</spring-ai.version>
224
-
</properties>
225
-
```
226
-
3.**Run Tests**
227
-
```bash
228
-
# Run all tests
229
-
mvn test
230
-
# Run tests for a specific module
231
-
mvn test -pl spring-ai-chat
232
-
```
233
-
234
210
## 📝 Notes
235
211
236
212
1.**API Key Security**
237
213
- Use environment variables to store API keys to avoid leaks
238
214
- Never hardcode keys in the codebase
239
215
- Rotate keys regularly for better security
240
216
241
-
2.**Milvus Usage**
242
-
- Ensure vector dimension matches the embedding model when creating collections
243
-
- Load the collection before retrieval (load collection)
244
-
- Create indexes before retrieval for better performance
245
-
246
-
3.**Token Usage**
217
+
2.**Token Usage**
247
218
- Monitor token consumption to avoid overuse
248
219
- Set reasonable token limits to prevent abuse
249
220
- Implement caching to improve response speed and cost control
@@ -264,3 +235,5 @@ Provides chat history management:
264
235
-[Qwen](https://qianwen.aliyun.com) - Qwen series models
265
236
-[Doubao](https://www.volcengine.com/docs/82379) - Doubao series models
266
237
-[Milvus](https://milvus.io) - Vector database support
238
+
239
+
This project is fully open source, aiming to aggregate more high-quality Spring AI learning resources. Most resources are collected from the internet. If there is any infringement, please contact for removal. Special thanks to all open source contributors and everyone who shares technology in the community!
0 commit comments