Skip to content

Commit 37bab47

Browse files
committed
update readme_en
1 parent 753d20d commit 37bab47

File tree

1 file changed

+82
-109
lines changed

1 file changed

+82
-109
lines changed

README_EN.md

Lines changed: 82 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,37 @@
55
<p align="left">
66
<a href="README.md" style="text-decoration:none;"><span style="display:inline-block;border:1px solid #ccc;border-radius:4px;padding:2px 10px;margin-right:10px;">🇨🇳 中文</span></a>
77
<a href="README_EN.md" style="text-decoration:none;"><span style="display:inline-block;border:1px solid #ccc;border-radius:4px;padding:2px 10px;">🇺🇸 English</span></a>
8+
<a href="https://github.com/java-ai-tech/spring-ai-summary/wiki" target="_blank"><span style="display:inline-block;border:1px solid #ccc;border-radius:4px;padding:2px 10px;">📖 Wiki</span></a>
89
</p>
910

11+
🚀🚀🚀 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.
1012

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
1214

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.
1419

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!
31+
32+
<p align="center">
33+
<img width="189" alt="image" src="https://github.com/user-attachments/assets/18d946e0-3df9-4c83-9716-d607399a6e58" />
34+
</p>
1635

1736
## 🗂️ Project Structure
1837

19-
This project uses a modular design, divided by feature as follows:
38+
This project adopts a modular design, mainly divided into the following modules by feature:
2039

2140
```
2241
spring-ai-summary/
@@ -25,101 +44,79 @@ spring-ai-summary/
2544
│ ├── spring-ai-chat-qwen/ # Qwen integration
2645
│ ├── spring-ai-chat-doubao/ # Doubao integration
2746
│ ├── spring-ai-chat-deepseek/ # DeepSeek integration
28-
│ ├── spring-ai-chat-multi/ # Multi-model parallel
29-
│ └── spring-ai-chat-multi-openai/ # OpenAI multi-model parallel
47+
│ ├── spring-ai-chat-multi/ # Multi chat model
48+
│ │ spring-ai-chat-ollama/ # Ollama integration
49+
│ └── spring-ai-chat-multi-openai/ # Multi OpenAI protocol models
3050
├── spring-ai-rag/ # RAG (Retrieval Augmented Generation)
31-
├── spring-ai-embedding/ # Text embedding service
51+
├── spring-ai-vector/ # Text embedding service
52+
│ ├── spring-ai-vector-milvus/ # Milvus vector storage
53+
│ ├── spring-ai-vector-redis/ # Redis vector storage
3254
├── spring-ai-tool-calling/ # Tool/function calling examples
3355
├── spring-ai-chat-memory/ # Chat memory management
56+
│ ├── spring-ai-chat-memory-jdbc # JDBC-based storage
57+
│ ├── spring-ai-chat-memory-local # In-memory storage
3458
├── spring-ai-evaluation/ # AI answer evaluation
3559
└── spring-ai-mcp/ # MCP examples
60+
├── spring-ai-mcp-server # MCP server
61+
├── spring-ai-mcp-client # MCP client
62+
└── spring-ai-agent/ # Agent examples
3663
```
3764

38-
**The documentation list for different project modules is as follows.:**
39-
40-
* **spring-ai-chat-chat module**
41-
* [spring-ai-chat-openai](spring-ai-chat/spring-ai-chat-openai/README.md) - OpenAI Model access
42-
* [spring-ai-chat-qwen](spring-ai-chat/spring-ai-chat-qwen/README.md) - Qwen Model access
43-
* [spring-ai-chat-doubao](spring-ai-chat/spring-ai-chat-doubao/README.md) - Doubao Model access
44-
* [spring-ai-chat-deepseek](spring-ai-chat/spring-ai-chat-deepseek/README.md) - DeepSeek Model access
45-
* [spring-ai-chat-multi](spring-ai-chat/spring-ai-chat-multi/README.md) - multi chat Model access
46-
* [spring-ai-chat-multi-openai](spring-ai-chat/spring-ai-chat-multi-openai/README.md) - multi OpenAI protocol Model access
47-
* **[spring-ai-embedding-文本向量化服务]()** --to be added
48-
* **[spring-ai-rag-RAG 检索增强生成]()** --to be added
49-
* **[spring-ai-tool-calling-工具函数调用示例]()** --to be added
50-
* **[spring-ai-chat-memory-会话记忆管理]()** --to be added
51-
* **[spring-ai-mcp-MCP 示例]()** --to be added
52-
* **[spring-ai-evaluation-AI 回答评估]()** --to be added
53-
*
54-
## 🧩 Core Features
55-
56-
This sample project implements the following core features:
57-
58-
- **Multi-model support**: Integrates OpenAI, Qwen, Doubao, DeepSeek, and more LLMs
59-
- **RAG implementation**: Complete retrieval-augmented generation, supporting document embedding and semantic search
60-
- **Function Calling**: Supports function calling and tool integration
61-
- **Chat Memory**: Multiple storage options for chat history
62-
- **Evaluation System**: AI answer quality evaluation tools
63-
- **Monitoring & Stats**: Token usage and performance monitoring
64-
65-
You can quickly get started by following the steps below.
66-
6765
## 🚀 Quick Start
6866

6967
### ⚙️ Requirements
7068

71-
- SpringBoot 3.3.6
72-
- Spring AI 1.0.0
73-
- JDK 21+
74-
- Maven 3.6+
75-
- Docker (for running Milvus)
69+
| Dependency | Version/Requirement | Note |
70+
| -------------- | ------------------ | ------------------- |
71+
| SpringBoot | 3.3.6 | |
72+
| Spring AI | 1.0.0 | |
73+
| JDK | 21+ | |
74+
| Maven | 3.6+ | |
75+
| Docker | (for running Milvus)| |
7676

7777
### 1. 🧬 Clone the Project
7878

7979
```bash
80-
git clone https://github.com/glmapper/spring-ai-summary.git
81-
cd spring-ai-summary
80+
# Clone the project
81+
git clone https://github.com/java-ai-tech/spring-ai-summary.git
82+
# Enter the project directory and compile
83+
cd spring-ai-summary && mvn clean compile -DskipTests
8284
```
8385

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+
8488
### 2. 🛠️ Configure Environment Variables
8589

8690
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**:
91+
8792
```properties
8893
# because we do not use the OpenAI protocol
8994
spring.ai.deepseek.api-key=${spring.ai.deepseek.api-key}
9095
spring.ai.deepseek.base-url=https://api.deepseek.com
9196
spring.ai.deepseek.chat.completions-path=/v1/chat/completions
9297
spring.ai.deepseek.chat.options.model=deepseek-chat
9398
```
94-
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).
101100

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
107102

108103
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+
109105
```bash
110106
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)
111107
...
112108
```
113-
Once started, you can test with HTTPie or Postman:
109+
Once started, you can test with cUrl, HTTPie, or Postman:
110+
114111
```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?"
118113
```
119114
Result:
115+
120116
![chat-ds-metrics.png](docs/statics/chat-ds-metrics.png)
121117

122118
You can also check token usage:
119+
123120
```bash
124121
# completion tokens
125122
http://localhost:8081/actuator/metrics/ai.completion.tokens
@@ -142,38 +139,36 @@ Example response for `ai.completion.tokens`:
142139
}
143140
```
144141

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)
146145

147-
### 1. 💬 Chat Module (spring-ai-chat)
146+
Here are some recommended learning resources:
148147

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.
154149
155-
### 2. 📖 RAG Module (spring-ai-rag)
150+
#### Technical Community
156151

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)
162154

163-
### 3. 🛠️ Tool Calling Module (spring-ai-tool-calling)
155+
#### Project Series
156+
- [MindMark: A RAG system based on SpringAI](https://gitee.com/mumu-osc/mind-mark)
157+
- [My AI Agent: An intelligent agent service based on Spring Boot and Spring AI](https://github.com/Cunninger/my-ai-agent)
164158

165-
Demonstrates tool/function calling:
166-
- Function definition: Use @Tool annotation to define tools
167-
- Tool registration: Dynamic registration and configuration
168-
- Dynamic invocation: Call tools at runtime
169-
- Result handling: Format and process tool results
159+
#### Blog Series
160+
- [MaJiang's Spring AI Series](https://cloud.tencent.com/developer/column/72423) (Chinese, some content may be outdated)
161+
- [In-depth Spring AI Series](https://www.cnblogs.com/guoxiaoyu/p/18666904) (Chinese, discontinued)
162+
- [How to Build MCP Client-Server Architecture with Spring AI](https://spring.didispace.com/article/spring-ai-mcp.html)
163+
- [Building Effective Agents with Spring AI](https://spring.io/blog/2025/01/21/spring-ai-agentic-patterns)
164+
- [Spring AI Large Model Output Formatting and Simple Usage](https://juejin.cn/post/7378696051082199080)
165+
- [Spring AI EmbeddingModel Concept and Source Code Analysis](https://my.oschina.net/u/2391658/blog/18534829)
170166

171-
### 4. 🧠 Chat Memory Module (spring-ai-chat-memory)
167+
#### Video Series
168+
- [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)
172170

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.
177172

178173
## 🔧 Development Guide
179174

@@ -189,6 +184,7 @@ Provides chat history management:
189184

190185
2. **Create a feature branch**
191186
```bash
187+
# Create and switch to a new feature branch
192188
git checkout -b feature/your-feature-name
193189
```
194190

@@ -211,39 +207,14 @@ Provides chat history management:
211207
- Describe your changes and reasons
212208
- Wait for review and merge
213209

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-
234210
## 📝 Notes
235211

236212
1. **API Key Security**
237213
- Use environment variables to store API keys to avoid leaks
238214
- Never hardcode keys in the codebase
239215
- Rotate keys regularly for better security
240216

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**
247218
- Monitor token consumption to avoid overuse
248219
- Set reasonable token limits to prevent abuse
249220
- Implement caching to improve response speed and cost control
@@ -264,3 +235,5 @@ Provides chat history management:
264235
- [Qwen](https://qianwen.aliyun.com) - Qwen series models
265236
- [Doubao](https://www.volcengine.com/docs/82379) - Doubao series models
266237
- [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

Comments
 (0)