This repository teaches you how to build a production-style multi-agent system with Spring AI and Redis.
It contains both:
- a learner-facing workshop
- a finished reference implementation
If you are learning, start with the workshop.
If you want to see the end state, run or read the final app.
This repository has two modules:
-
stockanalysisagentworkshop This is the workshop path. It is the best place to start if you want to learn how the system is built.
-
stockanalysisagent This is the finished application. Use it as the reference implementation and runnable end state.
The workshop is not separate from the real app in spirit.
The idea of this repository is:
- learn the architecture in the workshop
- understand how the pieces fit together
- compare that with the finished application
By working through this repository, you will learn how to build a multi-agent application that can:
- route a user request to the right specialist agents
- run explicit orchestration in application code
- synthesize a grounded final answer
- preserve conversation memory
- cache expensive or repeated work
- emit useful traces for observability
- evaluate answer quality with Spring AI
This is not a generic “AI demo” repository.
It is focused on one concrete system:
a stock-analysis assistant that combines:
- market data
- fundamentals
- news
- technical analysis
At a high level, the application works like this:
user request
|
v
coordinator
|
v
orchestrator
|
+--> market data agent
+--> fundamentals agent
+--> news agent
+--> technical analysis agent
|
v
synthesis agent
|
v
final answer
As the repository progresses, that core flow is extended with:
- Redis-backed memory
- semantic caching
- observability
- evaluation
So the goal is not just to “make several agents talk.”
The goal is to show what it takes to turn a multi-agent system into a production-style application.
Go to:
That README is written for learners and walks you through the full sequence.
You will move through the workshop in order:
- Spring AI basics
- multi-agent system design
- specialist agents
- coordinator and orchestration
- memory
- caching
- observability
- evaluation
- what comes next
The workshop is designed so you do not have to invent the whole system architecture yourself.
You will be told:
- what file to open
- what code to paste
- why that code matters
- what that code is doing in the multi-agent system
Go to:
The finished app is a Spring Boot application with a browser chat UI and a Redis-backed local stack.
From the repository root, the most useful commands are:
./gradlew :stockanalysisagent:bootRun
./gradlew :stockanalysisagent:test
./gradlew :stockanalysisagent:compileJavaIf you want to run the real application locally, you will usually want:
- Ollama
- Redis
- Agent Memory Server
- Redis Insight
- optionally Zipkin for tracing
The repository already includes a local Docker stack in:
Start it with:
docker compose up -d redis ollama agent-memory-server agent-memory-task-worker redis-insightIf you want Compose to pre-load the default Ollama models into its own volume, run this once:
docker compose --profile ollama-setup up ollama-model-loaderIf you also want tracing:
docker compose up -d zipkinFor local secrets and machine-specific settings, use:
Typical local values include:
OLLAMA_BASE_URLOLLAMA_CHAT_MODEL- Twelve Data API key from Twelve Data
- Tavily API key from Tavily
- SEC user agent
- Agent Memory Server URL
Embeddings are disabled by default in the repo now. If you want semantic cache or Redis long-term memory back, opt in with the commented embedding settings in /.env.example.
Both Spring Boot apps load .env and application-local.* automatically when those files exist in either the repository root or the module directory.
-
stockanalysisagentworkshop Learner-facing workshop materials and scaffolded code
-
stockanalysisagent Finished application
-
compose.yaml Local Ollama, Redis, Agent Memory Server, Redis Insight, and Zipkin stack
-
docs Supporting planning and project documentation
If you finish this repository path, you should be able to explain and build:
- how Spring AI tools, prompts, and structured outputs work
- how specialist agents are structured
- how a coordinator decides what should run
- how orchestration stays explicit in code
- how Redis supports memory, caching, and scaling
- how observability helps you understand multi-agent execution
- how evaluation helps you measure answer quality
That is the real outcome of this repository.
Not just a demo that runs, but a clear mental model for how to build multi-agent systems that are useful, observable, and ready to grow.