Skip to content

Commit 112f541

Browse files
authored
Merge branch 'main' into feat-graph-node-mem0
2 parents e65eba1 + 91fb52b commit 112f541

File tree

200 files changed

+8484
-6037
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+8484
-6037
lines changed

community/memories/spring-ai-alibaba-starter-memory-mem0/src/main/java/com/alibaba/cloud/ai/memory/mem0/core/Mem0MemoryStore.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@
3838

3939
/**
4040
* @author miaoyumeng
41-
* @date 2025/06/24 14:28
42-
* @description TODO
41+
* @since 2025/06/24 14:28
4342
*/
4443
public class Mem0MemoryStore implements InitializingBean, VectorStore {
4544

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@
229229

230230
<!-- Nacos -->
231231
<nacos2.version>2.5.1</nacos2.version>
232-
<nacos3.version>3.0.2</nacos3.version>
232+
<nacos3.version>3.0.3</nacos3.version>
233233
<nacos-client-mse-extension.version>1.0.4</nacos-client-mse-extension.version>
234234
<spring-alibaba-nacos-config.version>2023.0.1.3</spring-alibaba-nacos-config.version>
235235

spring-ai-alibaba-deepresearch/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.alibaba.cloud.ai</groupId>
77
<artifactId>spring-ai-alibaba-deepresearch</artifactId>
8-
<version>0.1.0</version>
8+
<version>0.1.0-SNAPSHOT</version>
99
<name>Spring AI Alibaba Deep Research</name>
1010

1111
<properties>

spring-ai-alibaba-deepresearch/src/main/java/com/alibaba/cloud/ai/example/deepresearch/serializer/DeepResearchStateSerializer.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.alibaba.cloud.ai.graph.state.AgentStateFactory;
2121
import com.fasterxml.jackson.annotation.JsonAutoDetect;
2222
import com.fasterxml.jackson.annotation.PropertyAccessor;
23+
import com.fasterxml.jackson.core.type.TypeReference;
2324
import com.fasterxml.jackson.databind.MapperFeature;
2425
import com.fasterxml.jackson.databind.ObjectMapper;
2526
import com.fasterxml.jackson.databind.json.JsonMapper;
@@ -31,6 +32,7 @@
3132
import java.io.ObjectInput;
3233
import java.io.ObjectOutput;
3334
import java.nio.charset.StandardCharsets;
35+
import java.util.Map;
3436

3537
public class DeepResearchStateSerializer extends PlainTextStateSerializer {
3638

@@ -73,8 +75,8 @@ public String contentType() {
7375
}
7476

7577
@Override
76-
public void write(OverAllState object, ObjectOutput out) throws IOException {
77-
String json = objectMapper.writeValueAsString(object);
78+
public void writeData(Map<String, Object> data, ObjectOutput out) throws IOException {
79+
String json = objectMapper.writeValueAsString(data);
7880

7981
// 这边修改的原因在于,序列化长度限制的问题,当数据量过大时,可能会导致序列化失败。修改`DeepResearchStateSerializer`使用字节数组方式避免UTF长度限制
8082
byte[] jsonBytes = json.getBytes(StandardCharsets.UTF_8);
@@ -83,14 +85,15 @@ public void write(OverAllState object, ObjectOutput out) throws IOException {
8385
}
8486

8587
@Override
86-
public OverAllState read(ObjectInput in) throws IOException {
88+
public Map<String, Object> readData(ObjectInput in) throws IOException {
8789

8890
// 这边修改的原因在于,序列化长度限制的问题,当数据量过大时,可能会导致序列化失败。修改`DeepResearchStateSerializer`使用字节数组方式避免UTF长度限制
8991
int length = in.readInt();
9092
byte[] jsonBytes = new byte[length];
9193
in.readFully(jsonBytes);
9294
String json = new String(jsonBytes, StandardCharsets.UTF_8);
93-
return objectMapper.readValue(json, OverAllState.class);
95+
return objectMapper.readValue(json, new TypeReference<Map<String, Object>>() {
96+
});
9497
}
9598

9699
}

spring-ai-alibaba-graph-core/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
</properties>
4444

4545
<dependencies>
46+
<dependency>
47+
<groupId>io.projectreactor</groupId>
48+
<artifactId>reactor-core</artifactId>
49+
</dependency>
50+
4651
<dependency>
4752
<groupId>io.github.a2asdk</groupId>
4853
<artifactId>a2a-java-reference-server</artifactId>

spring-ai-alibaba-graph-core/src/main/java/com/alibaba/cloud/ai/graph/CompileConfig.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
*/
4040
public class CompileConfig {
4141

42+
// ================================================================================================================
43+
// Configuration Fields
44+
// ================================================================================================================
45+
4246
private SaverConfig saverConfig = new SaverConfig().register(SaverEnum.MEMORY.getValue(), new MemorySaver());
4347

4448
private Deque<GraphLifecycleListener> lifecycleListeners = new LinkedBlockingDeque<>(25);
@@ -56,6 +60,10 @@ public class CompileConfig {
5660

5761
private Store store;
5862

63+
// ================================================================================================================
64+
// Getter Methods
65+
// ================================================================================================================
66+
5967
/**
6068
* Returns the current state of the thread release flag.
6169
*
@@ -142,6 +150,10 @@ public void setStore(Store store) {
142150
this.store = store;
143151
}
144152

153+
// ================================================================================================================
154+
// Builder Methods
155+
// ================================================================================================================
156+
145157
/**
146158
* Returns a new instance of the builder with default configuration settings.
147159
* @return A new Builder instance.
@@ -297,6 +309,10 @@ public CompileConfig build() {
297309

298310
}
299311

312+
// ================================================================================================================
313+
// Constructors
314+
// ================================================================================================================
315+
300316
/**
301317
* Default constructor used internally to create a new configuration with default
302318
* settings. Made private to ensure all instances are created through the builder

0 commit comments

Comments
 (0)