Content
# spring-ai-demo
SpringAI-based demo project to quickly experience SpringAI capabilities and record personal experience with SpringAI for large model upper-level application development, also providing references for Java developers interested in large model application development.
Main site: [https://ppai.top](https://ppai.top)
## Technology Stack
- SpringBoot 3.5.3
- SpringAI ~~1.0.1~~ 🚀upgraded to -> 1.1.2
- LangGraph4J
- Java17
- Maven
v2 directory stores examples based on SpringAI 2.x:
- Java21
- SpringBoot 4.x
- SpringAI 2.x
Spring-Ai-alibaba related example projects are in the ali/ directory:
- Java17+
- spring-ai-alibaba-agent-framework: 1.1.2.1
### Local Startup Instructions
All projects in this repository are independent and do not depend on each other; you can choose any project and start it using its Application startup class.
However, before starting, please replace the model configuration in `resources/application.yml` according to your actual model needs.
For keys, during local development, you can inject them through environment context, startup parameters, configuration file hardcoding, etc.; you can also copy the [.env.example](./.env.example) file and name it `.env`.
Then, in this configuration file, maintain the ApiKey, and the project will automatically read the ApiKey when started, mainly relying on [spring-ai-demo-starter](./spring-ai-demo-starter) for support.
## Tutorial Directory
### 1. Basic Tutorial
Introduces basic SpringAI usage, corresponding project engineering starts with `Sxx-`, through these examples, you will master SpringAI basics (such as prompts, context, structured output, tool calling, MCP, advise, ChatClient, multi-models, etc.) and start using SpringAI for large model application development.
- [x] [01. Create a SpringAI-Demo project.md](docs/01.创建一个SpringAI-Demo工程.md)
- [x] [02. Prompt usage.md](docs/02.提示词设置.md)
- [x] [03. Structured return](docs/03.结构化返回.md)
- [x] [04. Chat context to achieve multi-round dialogue](docs/04.聊天上下文.md)
- [x] [05. Custom large model access](docs/05.自定义大模型接入.md)
- [x] [06. Function Tool tool call](docs/06.工具调用.md)
- [x] [07. Implement a simple MCP Server](docs/07.实现一个简单的McpServer.md)
- [x] [08. MCP Server simple authentication implementation](docs/08.MCP%20Server简单鉴权的实现.md)]
- [x] [09. ChatClient usage instructions](docs/09.ChatClient使用说明.md)]
- [x] [10. Advisor realizes SpringAI interaction enhancement](docs/10.Advisor实现SpringAI交互增强.md)]
- [x] [11. Image model - generate images](docs/11.图像模型.md)
- [x] [12. Multi-modal implementation of ingredient image calorie identification example](docs/12.多模态实现食材图片卡路里识别示例.md)
- [x] [13. Support MCP Client AI dialogue implementation](docs/13.支持MCP%20Client的AI对话实现.md)
- [x] [14. Create a LangGraph4J example project](docs/14.创建一个Langgraph4j示例工程.md)
- [x] [15. Access OpenAI interface style large model](docs/15.接入OpenAI接口风格的大模型.md)
- [x] [16. Asynchronous streaming model call](docs/16.异步流式模型调用.md)
- [x] [17. Reasoning large model access and reasoning process return](docs/17.推理大模型接入与推理过程返回.md)
- [x] [18. Voice model voice recognition](https://www.ppai.top//ai-guides/ai-dev/基础篇/18.语音模型之语音识别.html#_1-初始化)
- [x] [19. From automatic to manual control tool calls](https://mp.weixin.qq.com/s/TbTnpPkVPY_bTts_l8ltGQ)
- [ ] [Audio model](docs/)
- [ ] [Retrieval-enhanced generation RAG](docs/)
### 2. Advanced Tutorial
Advanced tutorials will introduce how to better use SpringAI for large model application development, corresponding examples are in [advance-projects](./advance-projects).
- [x] [01. Use MySql to persist conversation history](docs/A01.使用MySql持久化对话历史.md)
- [x] [02. Use H2 to persist conversation history](docs/A02.使用H2持久化对话历史.md)]
- [x] [03. Use Redis to persist conversation history](docs/A03.使用Redis持久化对话历史.md)
- [x] [04. Use LangGraph4J to achieve multi-round dialogue](docs/A04.使用Langgraph4j实现多伦对话.md)
- [x] [05. Use LangGraph4J to achieve Agent routing selection](docs/A05.使用LangGraph4J实现Agent路由选择.md)
- [x] [06. Farewell traditional AI development! SpringAI Agent + Skills redefine intelligent applications](https://mp.weixin.qq.com/s/ujxVleNhjxzUgL-rjfFcVA)
- [x] [07. Spring AI multi-round dialogue art: let large models actively ask questions to obtain clear needs](https://mp.weixin.qq.com/s/LcvmiIERs6aOIlRAKGGnFg)
- [x] [08. In-depth understanding of ReAct mode: based on Spring AI from 0 to 1 to achieve a ReAct Agent](https://mp.weixin.qq.com/s/mJIibMdAFSDgXZBsM3tuPw)
### 3. Application Tutorial
Takes building a complete and usable SpringAI application as the goal, demonstrating SpringAI's business boundaries and performance, corresponding projects are in [app-projects](./app-projects).
- [x] [Create a weather-based tourism food recommendation intelligent body from 0 to 1](docs/D01.从0到1创建一个基于天气的旅游美食推荐智能体.md)
- [x] [Large model application development practice: implement a natural language address extraction intelligent body in two hundred lines](https://mp.weixin.qq.com/s/96rHyp_gBUgmA2dhSbzNww)
- [x] [Goodbye, OCR template! Hello, invoice intelligent body: zero-configuration invoice intelligent extraction architecture based on SpringAI and large models](https://mp.weixin.qq.com/s/SnXdTB6tYqAzG7HgbnTSAQ)
- [x] [Practical | Zero-based knowledge base question and answer robot: complete implementation based on SpringAI+RAG](https://mp.weixin.qq.com/s/NHqLJbos-_nrxNNmhg7IBQ)
- [x] [I used SpringAI to create a 'WeChat red envelope cover designer'](https://mp.weixin.qq.com/s/QyuWZ4EZ32pbcWn3fVphHQ)
- [x] [Practical dry goods! Spring AI integrates voice recognition to achieve real-time translation robot complete guide](https://mp.weixin.qq.com/s/qF0RfLts-fuMzv-uJZnBig)
- [x] [Farewell pure text chat: based on Spring AI, build a streaming dialogue system that supports rich UI](https://mp.weixin.qq.com/s/U6ua-dpkVZTYT1n5JXiYDg)
Corresponding application examples:
| Agent | Diagram |
|-----------------------------------------------------------------------|--------------------------------------------------------------------|
| [RAG question and answer robot](https://mp.weixin.qq.com/s/mJIibMdAFSDgXZBsM3tuPw) |  |
| [WeChat red envelope cover design Agent](https://mp.weixin.qq.com/s/QyuWZ4EZ32pbcWn3fVphHQ) |  |
| [Voice recognition translation robot](https://mp.weixin.qq.com/s/qF0RfLts-fuMzv-uJZnBig) |  |
| [Natural language to SQL, and support human review](https://mp.weixin.qq.com/s/454LmLMAVDuZfi6t-DgSqg) |  |
### 4. Source Code Interpretation
From the perspective of source code, introduces SpringAI's core implementation, corresponding project engineering starts with `Yxx-`
### 5. LLM Application Development Introduction
- [What is LLM application development: a popular science article that even beginners can understand (extremely simplified version)](https://mp.weixin.qq.com/s/qCn8x2XO2shA8MheYbHq0w)
- [Large model application development series tutorial:序-why you 'can use LLM' but can't make complex applications?](https://mp.weixin.qq.com/s/2GXBNOUq3jlysipftz8TpA)
- [Large model application development series tutorial: Chapter 1 What does LLM do?](https://mp.weixin.qq.com/s/v-z6EHY300ElOxdGPdzc0w)
- [Large model application development series tutorial: Chapter 2 The model is not the focus, parameters are your real control panel](https://mp.weixin.qq.com/s/t_BuAW9i0npcaJdua3Am2Q)
- [Large model application development series tutorial: Chapter 3 Why my Prompt performance is poor?](https://mp.weixin.qq.com/s/vzt0bGwcfnASOiBa0Kc7VQ)
- [Large model application development series tutorial: Chapter 4 Prompt engineering structure design](https://mp.weixin.qq.com/s/Nk-N34TLJVCTI5F4k5rGaQ)
- [Large model application development series tutorial: Chapter 5 From Prompt to Prompt template and engineering governance](https://mp.weixin.qq.com/s/ZQbztqBq7_PzynG06N4-mg)
- [Large model application development series tutorial: Chapter 6 Context window's real boundary](https://mp.weixin.qq.com/s/nnKspRO87xbrn4-LBV3RNA)
- [Large model application development series tutorial: Chapter 7 From 'stacking context' to 'managing context'](https://mp.weixin.qq.com/s/_5D2tF6CPnafj5mlmlwLNw)
- [Large model application development series tutorial: Chapter 8 Memory strategy's engineering choice](https://mp.weixin.qq.com/s/z5qaLtjChsvjhWNs8Nw05Q)
Agent development-related knowledge sharing
- [Complex tasks are difficult? Try letting a group of AI divide and cooperate - Multi-Agent system practice interpretation](https://mp.weixin.qq.com/s/pdG9C0CQVYFUleftfga3bA?token=1761013062&lang=zh_CN)
- [When Spring AI Alibaba meets Multi-Agent: unlock intelligent body's team collaboration mode](https://mp.weixin.qq.com/s/wrKymQhomKCf9yi-bHbmyg?token=1761013062&lang=zh_CN)
- [Agent development avoid pit | From 'all stuffed in' to '精挑细选': Agent development绕不开的工具管理难题](https://mp.weixin.qq.com/s/Cu5J6q1jj1j9Chrxzfy5fg)
### 6. LangChain Related
- [LangChain development introduction series](https://liuyueyi.github.io/langchain-demo/#)
### 7. SpringAI Alibaba
SpringAI alibaba is an open-source project based on SpringAI, providing SpringAI integration solutions. The architecture includes three layers:
- Agent Framework, an Agent development framework with ReactAgent design concept as the core, enabling developers to build Agents with automatic context engineering and human-computer interaction capabilities.
- Graph, a low-level workflow and multi-agent coordination framework, helping developers implement complex application orchestration, with rich preset nodes and simplified graph state definition, Graph is the underlying runtime base of Agent Framework.
- Augmented LLM, based on Spring AI framework's underlying atomic abstraction, providing basic abstraction for building large language model (LLM) applications, such as model (Model), tool (Tool), multi-modal components (MCP), message (Message), vector store (Vector Store), etc.
[ali](./ali) directory mainly contains example projects based on SpringAI alibaba, where example projects start with `Lxx-`
- [01. Spring AI Alibaba intelligent body development basic example | Helllo LLM Guides](https://www.ppai.top/ai-guides/ai-dev/ALiAI/L01.Spring%20AI%20Alibaba%20%E6%99%BA%E8%83%BD%E4%BD%93%E5%BC%80%E5%8F%91%E4%BD%BF%E7%94%A8%E4%BD%93%E9%AA%8C.html)
- [02. From natural language to SQL, add an artificial defense line: Spring AI Alibaba practice](https://mp.weixin.qq.com/s/454LmLMAVDuZfi6t-DgSqg)
- [03. From zero to master Spring AI Alibaba Skill: definition, registration, and gradual disclosure](https://mp.weixin.qq.com/s/TfTfQx1e661s6-cgVP8lwg)
- [04. Spring AI Alibaba practice: from zero to achieve express ordering multi-round dialogue assistant](https://mp.weixin.qq.com/s/phTndkT6-FzpJw6jSo3lHQ)
- [05. Multi-intelligent body practice | Based on Spring AI Alibaba from 0 to 1 to achieve story creation intelligent body](https://mp.weixin.qq.com/s/k_3viD7wDe616hhpiWvyrQ)
- [06. Multi-intelligent body practice | Based on Spring AI Alibaba to achieve program planning multi-intelligent body](https://mp.weixin.qq.com/s/iKOAzyAZxm1u5ooxcmCNBA)
## About
This project is mainly for JAVA AI application development of some basic example projects, to help everyone quickly get started and master some large model application development, Agent development of basic knowledge points;
Since the project itself is positioned as an example project, therefore, for some large model application development of theoretical, conceptual, architectural design, framework encapsulation implementation and other related content, may be relatively small;
If you are also interested in this block of small partners, you may wish to follow my WeChat public number: **一灰灰blog**, get more content.

Connection Info
You Might Also Like
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
servers
Model Context Protocol Servers
servers
Model Context Protocol Servers
Time
A Model Context Protocol server for time and timezone conversions.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.