# albertowang/spring-ai-alibaba-noob architecture

> Architecture diagram of the GitHub repository albertowang/spring-ai-alibaba-noob, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/albertowang/spring-ai-alibaba-noob
- Repository: https://github.com/albertowang/spring-ai-alibaba-noob

## Overview

This repository is a Spring AI agent and graph-workflow demo. Its main user path accepts an HTTP message, runs a streaming ReAct weather agent, and returns generated content; the tool can supply city weather data. Separate examples demonstrate intent-routed arithmetic and chat memory backed by files or Redis. Monitoring is also implemented, though the sampled code does not establish its wiring. The README is empty, so capability coverage is based on the source tree and sampled files.

Main entry points: [`src/main/java/alberto/ai/memory/GraphChatClient.java`](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/memory/GraphChatClient.java) (Chat graph), [`src/main/java/alberto/ai/graph/MyWorkflowGraph.java`](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/graph/MyWorkflowGraph.java) (Workflow runner), [`src/main/java/alberto/ai/controller/ReactAgentStreamController.java`](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/controller/ReactAgentStreamController.java) (Stream controller), [`src/main/java/alberto/ai/memory/redis/GraphChatClientRedisWriteMemory.java`](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/memory/redis/GraphChatClientRedisWriteMemory.java) (Redis write example)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent["Streaming agent"]
  node_controller["Stream controller"]
  node_react["ReAct agent"]
  node_weather["Weather tool<br/>[WeatherTool.java]"]
  node_schema["Weather schema<br/>[WeatherSchema.java]"]
end

subgraph group_workflow["Graph workflow"]
  node_workflow_entry["Workflow runner"]
  node_classifier["Intent classifier"]
  node_arithmetic["Add/subtract nodes"]
  node_print["Print result"]
end

subgraph group_memory["Chat memory"]
  node_chat_graph["Chat graph"]
  node_chat_model["Chat model"]
  node_file_saver[("File checkpoint")]
  node_redis_saver[("Redis checkpoint")]
  node_file_example["File memory example"]
  node_redis_write["Redis write example"]
  node_redis_read["Redis read example"]
end

subgraph group_ops["Monitoring"]
  node_monitor["AI monitor<br/>[AiMonitor.java]"]
end

node_user(("HTTP user"))
node_dashscope["DashScope model"]
node_redis_service[("Redis")]

node_user -->|"sends message"| node_controller
node_controller -->|"streams request"| node_react
node_react -->|"calls model"| node_dashscope
node_react -->|"dispatches tool"| node_weather
node_controller -->|"streams content"| node_user
node_workflow_entry -->|"runs classifier"| node_classifier
node_workflow_entry -->|"routes intent"| node_arithmetic
node_workflow_entry -->|"runs output"| node_print
node_file_example -->|"invokes graph"| node_chat_graph
node_redis_write -->|"invokes graph"| node_chat_graph
node_redis_read -->|"reads graph state"| node_chat_graph
node_chat_graph -->|"calls model"| node_chat_model
node_chat_graph -->|"checkpoints"| node_file_saver
node_chat_graph -->|"checkpoints"| node_redis_saver
node_redis_write -->|"connects to"| node_redis_service
node_redis_read -->|"connects to"| node_redis_service

click node_controller "https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/controller/ReactAgentStreamController.java"
click node_react "https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/controller/ReactAgentStreamController.java"
click node_weather "https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/tools/WeatherTool.java"
click node_schema "https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/tools/WeatherSchema.java"
click node_workflow_entry "https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/graph/MyWorkflowGraph.java"
click node_classifier "https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/graph/IntentClassifierNode.java"
click node_arithmetic "https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/graph/MyWorkflowGraph.java"
click node_print "https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/graph/MyWorkflowGraph.java"
click node_chat_graph "https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/memory/GraphChatClient.java"
click node_chat_model "https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/memory/GraphChatClient.java"
click node_file_saver "https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/memory/GraphChatClient.java"
click node_redis_saver "https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/memory/GraphChatClient.java"
click node_file_example "https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/memory/GraphChatClientFileSystemMemory.java"
click node_redis_write "https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/memory/redis/GraphChatClientRedisWriteMemory.java"
click node_redis_read "https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/memory/redis/GraphChatClientRedisReadMemory.java"
click node_monitor "https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/hook/AiMonitor.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_controller,node_react,node_weather,node_schema,node_user toneBlue
class node_workflow_entry,node_classifier,node_arithmetic,node_print,node_redis_service toneAmber
class node_chat_graph,node_chat_model,node_file_saver,node_redis_saver,node_file_example,node_redis_write,node_redis_read toneMint
class node_monitor toneRose
class node_dashscope toneIndigo
```

## Components

### Streaming agent

- [Stream controller](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/controller/ReactAgentStreamController.java): `src/main/java/alberto/ai/controller/ReactAgentStreamController.java`
- [ReAct agent](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/controller/ReactAgentStreamController.java): `src/main/java/alberto/ai/controller/ReactAgentStreamController.java`
- [Weather tool](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/tools/WeatherTool.java): `src/main/java/alberto/ai/tools/WeatherTool.java`
- [Weather schema](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/tools/WeatherSchema.java): `src/main/java/alberto/ai/tools/WeatherSchema.java`

### Graph workflow

- [Workflow runner](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/graph/MyWorkflowGraph.java): `src/main/java/alberto/ai/graph/MyWorkflowGraph.java`
- [Intent classifier](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/graph/IntentClassifierNode.java): `src/main/java/alberto/ai/graph/IntentClassifierNode.java`
- [Add/subtract nodes](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/graph/MyWorkflowGraph.java): `src/main/java/alberto/ai/graph/MyWorkflowGraph.java`
- [Print result](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/graph/MyWorkflowGraph.java): `src/main/java/alberto/ai/graph/MyWorkflowGraph.java`

### Chat memory

- [Chat graph](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/memory/GraphChatClient.java): `src/main/java/alberto/ai/memory/GraphChatClient.java`
- [Chat model](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/memory/GraphChatClient.java): `src/main/java/alberto/ai/memory/GraphChatClient.java`
- [File checkpoint](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/memory/GraphChatClient.java): `src/main/java/alberto/ai/memory/GraphChatClient.java`
- [Redis checkpoint](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/memory/GraphChatClient.java): `src/main/java/alberto/ai/memory/GraphChatClient.java`
- [File memory example](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/memory/GraphChatClientFileSystemMemory.java): `src/main/java/alberto/ai/memory/GraphChatClientFileSystemMemory.java`
- [Redis write example](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/memory/redis/GraphChatClientRedisWriteMemory.java): `src/main/java/alberto/ai/memory/redis/GraphChatClientRedisWriteMemory.java`
- [Redis read example](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/memory/redis/GraphChatClientRedisReadMemory.java): `src/main/java/alberto/ai/memory/redis/GraphChatClientRedisReadMemory.java`

### Monitoring

- [AI monitor](https://github.com/albertowang/spring-ai-alibaba-noob/blob/main/src/main/java/alberto/ai/hook/AiMonitor.java): `src/main/java/alberto/ai/hook/AiMonitor.java`

### Other components

- **HTTP user**
- **DashScope model**
- **Redis**

## Connections

- HTTP user → Stream controller: sends message
- Stream controller → ReAct agent: streams request
- ReAct agent → DashScope model: calls model
- ReAct agent → Weather tool: dispatches tool
- Stream controller → HTTP user: streams content
- Workflow runner → Intent classifier: runs classifier
- Workflow runner → Add/subtract nodes: routes intent
- Workflow runner → Print result: runs output
- File memory example → Chat graph: invokes graph
- Redis write example → Chat graph: invokes graph
- Redis read example → Chat graph: reads graph state
- Chat graph → Chat model: calls model
- Chat graph → File checkpoint: checkpoints
- Chat graph → Redis checkpoint: checkpoints
- Redis write example → Redis: connects to
- Redis read example → Redis: connects to
