dive-into-spring-ai: a Spring AI teaching project with Redis-Stack and Neo4j wired in
《动手学SpringAI》包含SSE流/Agent智能体/知识图谱RAG/FunctionCall/历史消息/图片生成/图片理解/Embedding/VectorDatabase/RAG
At a glance
- What is it?
- A Java 17 Spring Boot sample that demonstrates SSE streaming, agents, FunctionCall, embeddings, vector search and Graph RAG against DashScope or an OpenAI-compatible endpoint. It is a reference implementation for reading, not a library you add as a dependency.
- Who is it for?
- Adopt this if you are learning Spring AI and want working code for SSE streaming, FunctionCall, embeddings and Graph RAG in one repository, and you are willing to supply your own DashScope or OpenAI-compatible key plus MySQL, Redis-Stack and Neo4j instances.
- Can I use it commercially?
- Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
- Is it still maintained?
- Yes. The repository last received commits 62 days ago.
- What is it written in?
- Mainly Java, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
What dive-into-spring-ai is actually for
Spring AI moves fast and its reference documentation covers each capability in isolation. The gap this repository fills is the wiring between them. The README lists the topics it teaches: SSE streaming, Agent, FunctionCall, Embedding, VectorDatabase, RAG, Graph RAG, chat history, image generation and image understanding. That list is the scope statement. If you need to see how a streaming chat response, a tool call and a retrieval step coexist in one Spring Boot application, this is the material you read. If you need a maintained client library for a production service, this is not it. The README describes the project as teaching material (教学) and points to a companion blog and a Bilibili video, so the intended consumer is a developer following along, not an application depending on a published artifact. There are no releases in the repository metadata, which is consistent with that reading.
The runtime it assumes: Java 17, MySQL 8, Redis-Stack, Neo4j 5+
The environment list is the most concrete part of the README. Java 17, Node.js 18 or newer, MySQL 8, a DashScope API key or another provider, Redis-Stack and Neo4j 5 or newer. Redis-Stack appears because plain Redis does not do vector queries; the README says the stack image extends Redis with vector search, which is what the embedding and VectorDatabase topics need. Neo4j is there for the Graph RAG topic, and the README notes that after installation you reach the browser client at localhost:7474 with the default neo4j/neo4j credentials. Four infrastructure services before you write a line of application code is a real cost. It also tells you something about the design: the project does not abstract the vector store behind a swappable interface in a way the README describes, it picks Redis-Stack and Neo4j and demonstrates against them. If your team already runs Postgres with pgvector, you will be adapting rather than following.
Getting it running: the commands the README gives
Clone with git clone https://github.com/qifan777/dive-into-spring-ai, then open the project in IntelliJ IDEA. The README's step three is to edit application.yml and fill in the API key plus the MySQL, Redis-Stack and Neo4j connection settings. For OpenAI-compatible providers there is a specific instruction: set spring.ai.openai.base-url to http://ai.jarcheng.top without a trailing /v1, and set spring.ai.openai.api-key to a key created in the relay service's console. That base-url detail is worth noting because a trailing /v1 is the usual cause of a 404 on the chat completions path. The two infrastructure containers are given as docker run commands. Redis-Stack runs on ports 6379 and 8001 with a password passed through REDIS_ARGS="--requirepass 123456". Neo4j runs on 7474 and 7687 with APOC enabled through several NEO4J_ environment variables. Backend start is ServerApplication.java, followed by a step that is easy to miss: right-click target/generated-sources/annotations and mark it as a generated source root. The front end lives in front-end and runs npm run install, then npm run api with the backend already up, then npm run dev. Note that npm run install is not the standard npm install; the README gives it as a script name, so check package.json if it fails.
Where the documentation stops
The README is a setup guide, not a design document. It never states the licence, and the repository metadata supplied here lists the licence as unknown. That matters more than usual because the project promotes a paid API relay service in its own README, and the code demonstrates integration with it. Anyone intending to reuse the code in a commercial product should read the repository's licence file directly rather than inferring permission from a public GitHub URL. Beyond licensing, the README does not describe the module layout, the database schema, or how the Graph RAG path differs from the vector RAG path. The topic list names both, but nothing in the supplied material explains the extraction step that turns documents into graph entities. The blog and video links are where that detail presumably lives. A reader who only has the repository has to reconstruct the architecture from the source tree.
Maintenance cost and the moving target underneath
Spring AI is pre-1.0 in spirit even where version numbers suggest otherwise, and its abstractions have been renamed across milestones. A teaching repository pinned to one Spring AI version carries the cost of that churn: when the ChatClient or vector store API changes, the sample stops compiling and the reader has to map old code to new docs. The last push recorded for this repository is 2026-07-15, and there are no tagged releases, so there is no version you can pin against a known Spring AI release. Treat the repository as a snapshot. If you fork it for internal training, pin your Spring AI dependency explicitly and record which commit of the sample matched it. The four backing services add their own upgrade surface: Redis-Stack and Neo4j images both move, and the Neo4j container command in the README uses environment variable names from an older plugin mechanism, so expect to adjust it against current Neo4j 5 documentation.
How this differs from Spring AI's own reference material
The official Spring AI documentation and its sample repositories are the obvious alternative, and the difference is one of shape rather than quality. The official samples are typically narrow: one project for vector stores, one for tool calling, one for chat memory. This repository puts them in a single Spring Boot application with a front end, so you see the request path from browser to controller to model to vector store and back as a stream. The trade-off is legibility. A single-purpose official sample is easier to read because nothing else is in the file. A combined sample shows integration problems, such as how chat history is persisted to MySQL while the retrieval step queries Redis-Stack, but it also means more code to hold in your head before the first useful insight. If your goal is to understand one Spring AI abstraction in isolation, the official material is the faster route. If your goal is to see the abstractions assembled into something that resembles an application, this repository is the more direct answer.
Who should adopt it, and what to check first
This suits a Java developer who already knows Spring Boot and wants hands-on exposure to retrieval augmented generation, tool calling and streaming responses without building the scaffolding from scratch. It also suits a team running an internal study group, since the topic list maps cleanly onto a session plan. It does not suit anyone looking for a drop-in library, a production RAG service, or a project with a stated licence and a release history. Before committing time, verify three things in this order: the licence file in the repository, since the metadata does not state one; whether your model provider works with the spring.ai.openai.base-url configuration described in the README, because the sample assumes an OpenAI-compatible endpoint; and whether you can run Redis-Stack and Neo4j locally, because without both, the vector and graph sections of the project will not execute. If any of those three fails, the reading value drops sharply, since the setup steps are the part the README documents best.
Editorial conclusion
Adopt this if you are learning Spring AI and want working code for SSE streaming, FunctionCall, embeddings and Graph RAG in one repository, and you are willing to supply your own DashScope or OpenAI-compatible key plus MySQL, Redis-Stack and Neo4j instances. Do not adopt it as a production dependency or as a library to import; nothing in the material suggests it is packaged that way, and the licence is not stated in the repository metadata, so verify the licence file and the terms of the API relay service before you reuse any of it.
Community notes