- 添加以Agent为入口的注册链

- 调整项目结构
- 定义标准输入类
- 明确层级职责,Agent将负责处理所有原始输入并中转给真正的协调层InteractionHub
- 添加针对Agent层级的websocket能力扩展
This commit is contained in:
2025-04-15 23:05:44 +08:00
parent 527781cdae
commit 27719b7c11
41 changed files with 391 additions and 135 deletions

View File

@@ -30,6 +30,11 @@
<artifactId>commons-io</artifactId>
<version>2.18.0</version>
</dependency>
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>

View File

@@ -1,10 +1,12 @@
package work.slhaf;
import work.slhaf.agent.core.memory.MemoryGraph;
import work.slhaf.agent.Agent;
import work.slhaf.agent.modules.memory.MemoryGraph;
import java.io.IOException;
public class Main {
public static void main(String[] args) {
MemoryGraph graph = MemoryGraph.initialize("test");
public static void main(String[] args) throws IOException {
Agent agent = Agent.initialize();
}
}

View File

@@ -1,4 +1,67 @@
package work.slhaf.agent;
public class Agent {
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import work.slhaf.agent.common.config.Config;
import work.slhaf.agent.core.InteractionHub;
import work.slhaf.agent.core.interation.TaskCallback;
import work.slhaf.agent.core.interation.data.InteractionInputData;
import work.slhaf.agent.gateway.AgentWebSocketServer;
import work.slhaf.agent.gateway.MessageSender;
import java.io.IOException;
import java.time.LocalDateTime;
@Data
@Slf4j
public class Agent implements TaskCallback {
private static Agent agent;
private InteractionHub interactionHub;
private MessageSender messageSender;
public static Agent initialize() throws IOException {
if (agent == null) {
//加载配置
Config config = Config.load();
agent = new Agent();
agent.setInteractionHub(InteractionHub.initialize(config));
agent.registerTaskCallback();
agent.setMessageSender(new AgentWebSocketServer(config.getWebSocketConfig().getPort(),agent));
log.info("Agent 加载完毕..");
}
return agent;
}
/**
* 接收用户输入,包装为标准输入数据类
* @param input
*/
public void receiveUserInput(String userNickName,String userInfo,String input){
InteractionInputData inputData = new InteractionInputData();
inputData.setContent(input);
inputData.setUserInfo(userInfo);
inputData.setUserNickName(userNickName);
inputData.setLocalDateTime(LocalDateTime.now());
interactionHub.call(inputData);
}
/**
* 向用户返回输出内容
* @param output
*/
public void sendToUser(String userInfo,String output){
System.out.println(output);
messageSender.sendMessage(userInfo,output);
}
@Override
public void onTaskFinished(String userInfo, String output) {
sendToUser(userInfo,output);
}
private void registerTaskCallback(){
interactionHub.setCallback(this);
}
}

View File

@@ -1,15 +1,15 @@
package work.slhaf.agent.core.chat;
package work.slhaf.agent.common.chat;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.json.JSONUtil;
import lombok.Data;
import lombok.NoArgsConstructor;
import work.slhaf.agent.core.chat.constant.Constant;
import work.slhaf.agent.core.chat.pojo.ChatBody;
import work.slhaf.agent.core.chat.pojo.ChatResponse;
import work.slhaf.agent.core.chat.pojo.Message;
import work.slhaf.agent.core.chat.pojo.PrimaryChatResponse;
import work.slhaf.agent.common.chat.constant.Constant;
import work.slhaf.agent.common.chat.pojo.ChatBody;
import work.slhaf.agent.common.chat.pojo.ChatResponse;
import work.slhaf.agent.common.chat.pojo.Message;
import work.slhaf.agent.common.chat.pojo.PrimaryChatResponse;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package work.slhaf.agent.core.chat.constant;
package work.slhaf.agent.common.chat.constant;
public class Constant {

View File

@@ -1,4 +1,4 @@
package work.slhaf.agent.core.chat.pojo;
package work.slhaf.agent.common.chat.pojo;
import lombok.*;

View File

@@ -1,4 +1,4 @@
package work.slhaf.agent.core.chat.pojo;
package work.slhaf.agent.common.chat.pojo;
import lombok.AllArgsConstructor;
import lombok.Builder;

View File

@@ -1,4 +1,4 @@
package work.slhaf.agent.core.chat.pojo;
package work.slhaf.agent.common.chat.pojo;
import lombok.*;

View File

@@ -1,4 +1,4 @@
package work.slhaf.agent.core.chat.pojo;
package work.slhaf.agent.common.chat.pojo;
import lombok.Getter;
import lombok.Setter;

View File

@@ -1,13 +1,13 @@
package work.slhaf.agent.core.config;
package work.slhaf.agent.common.config;
import cn.hutool.json.JSONUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import work.slhaf.agent.core.models.core.CoreModel;
import work.slhaf.agent.core.models.slice.SliceEvaluator;
import work.slhaf.agent.core.models.task.TaskTrigger;
import work.slhaf.agent.core.models.topic.TopicExtractor;
import work.slhaf.agent.core.model.CoreModel;
import work.slhaf.agent.modules.memory.SliceEvaluator;
import work.slhaf.agent.modules.task.TaskScheduler;
import work.slhaf.agent.modules.topic.TopicExtractor;
import java.io.File;
import java.io.IOException;
@@ -54,7 +54,7 @@ public class Config {
}
case 2 -> {
System.out.println("TaskTrigger:");
yield TaskTrigger.MODEL_KEY;
yield TaskScheduler.MODEL_KEY;
}
case 3 -> {
System.out.println("TopicExtractor:");

View File

@@ -1,4 +1,4 @@
package work.slhaf.agent.core.config;
package work.slhaf.agent.common.config;
import lombok.Data;

View File

@@ -1,4 +1,4 @@
package work.slhaf.agent.core.config;
package work.slhaf.agent.common.config;
import lombok.Data;

View File

@@ -1,12 +1,12 @@
package work.slhaf.agent.core.models.common;
package work.slhaf.agent.common.model;
import lombok.Data;
import work.slhaf.agent.core.chat.ChatClient;
import work.slhaf.agent.core.chat.constant.Constant;
import work.slhaf.agent.core.chat.pojo.Message;
import work.slhaf.agent.core.config.Config;
import work.slhaf.agent.core.config.ModelConfig;
import work.slhaf.agent.core.memory.MemoryGraph;
import work.slhaf.agent.common.chat.ChatClient;
import work.slhaf.agent.common.chat.constant.Constant;
import work.slhaf.agent.common.chat.pojo.Message;
import work.slhaf.agent.common.config.Config;
import work.slhaf.agent.common.config.ModelConfig;
import work.slhaf.agent.modules.memory.MemoryGraph;
import java.util.ArrayList;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package work.slhaf.agent.core.models.common;
package work.slhaf.agent.common.model;
public class ModelConstant {
public static final String CORE_MODEL_PROMPT = """

View File

@@ -1,4 +1,39 @@
package work.slhaf.agent.core;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import work.slhaf.agent.common.config.Config;
import work.slhaf.agent.core.interation.TaskCallback;
import work.slhaf.agent.core.interation.data.InteractionInputData;
import work.slhaf.agent.core.model.CoreModel;
import work.slhaf.agent.modules.memory.MemoryManager;
import work.slhaf.agent.modules.task.TaskScheduler;
@Data
@Slf4j
public class InteractionHub {
private static InteractionHub interactionHub;
private TaskCallback callback;
private CoreModel coreModel;
private MemoryManager memoryManager;
private TaskScheduler taskScheduler;
public static InteractionHub initialize(Config config) {
if (interactionHub == null) {
interactionHub = new InteractionHub();
interactionHub.setCoreModel(CoreModel.initialize(config));
interactionHub.setMemoryManager(MemoryManager.initialize(config));
interactionHub.setTaskScheduler(TaskScheduler.initialize(config));
log.info("InteractionHub注册完毕...");
}
return interactionHub;
}
public void call(InteractionInputData inputData) {
callback.onTaskFinished(null, null);
}
}

View File

@@ -0,0 +1,5 @@
package work.slhaf.agent.core.interation;
public interface TaskCallback {
void onTaskFinished(String userInfo,String output);
}

View File

@@ -0,0 +1,13 @@
package work.slhaf.agent.core.interation.data;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class InteractionInputData {
private String userInfo;
private String userNickName;
private String content;
private LocalDateTime localDateTime;
}

View File

@@ -0,0 +1,10 @@
package work.slhaf.agent.core.interation.data;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class InteractionOutputData {
private String content;
}

View File

@@ -1,4 +0,0 @@
package work.slhaf.agent.core.memory;
public class MemoryManager {
}

View File

@@ -1,13 +1,15 @@
package work.slhaf.agent.core.models.core;
package work.slhaf.agent.core.model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import work.slhaf.agent.core.config.Config;
import work.slhaf.agent.core.models.common.Model;
import work.slhaf.agent.core.models.common.ModelConstant;
import lombok.extern.slf4j.Slf4j;
import work.slhaf.agent.common.config.Config;
import work.slhaf.agent.common.model.Model;
import work.slhaf.agent.common.model.ModelConstant;
@EqualsAndHashCode(callSuper = true)
@Data
@Slf4j
public class CoreModel extends Model {
public static final String MODEL_KEY = "core_model";
@@ -18,6 +20,7 @@ public class CoreModel extends Model {
coreModel = new CoreModel();
coreModel.setPrompt(ModelConstant.CORE_MODEL_PROMPT);
setModel(config, coreModel, MODEL_KEY, coreModel.getPrompt());
log.info("CoreModel注册完毕...");
}
return coreModel;
}

View File

@@ -1,25 +0,0 @@
package work.slhaf.agent.core.models.task;
import lombok.Data;
import lombok.EqualsAndHashCode;
import work.slhaf.agent.core.config.Config;
import work.slhaf.agent.core.models.common.Model;
import work.slhaf.agent.core.models.common.ModelConstant;
@EqualsAndHashCode(callSuper = true)
@Data
public class TaskTrigger extends Model {
public static final String MODEL_KEY = "task_trigger";
private static TaskTrigger taskTrigger;
public static TaskTrigger initialize(Config config) {
if (taskTrigger == null) {
taskTrigger = new TaskTrigger();
taskTrigger.setPrompt(ModelConstant.SLICE_EVALUATOR_PROMPT);
setModel(config,taskTrigger, MODEL_KEY, taskTrigger.getPrompt());
}
return taskTrigger;
}
}

View File

@@ -1,4 +0,0 @@
package work.slhaf.agent.core.task;
public class TaskScheduler {
}

View File

@@ -0,0 +1,64 @@
package work.slhaf.agent.gateway;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.java_websocket.WebSocket;
import org.java_websocket.handshake.ClientHandshake;
import org.java_websocket.server.WebSocketServer;
import work.slhaf.agent.Agent;
import work.slhaf.agent.core.interation.data.InteractionInputData;
import work.slhaf.agent.core.interation.data.InteractionOutputData;
import java.net.InetSocketAddress;
import java.util.concurrent.ConcurrentHashMap;
@Slf4j
public class AgentWebSocketServer extends WebSocketServer implements MessageSender {
private final Agent agent;
private final ConcurrentHashMap<String, WebSocket> userSessions = new ConcurrentHashMap<>();
public AgentWebSocketServer(int port, Agent agent) {
super(new InetSocketAddress(port));
this.agent = agent;
}
@Override
public void onOpen(WebSocket webSocket, ClientHandshake clientHandshake) {
log.info("新连接: {}",webSocket.getRemoteSocketAddress());
}
@Override
public void onClose(WebSocket webSocket, int i, String s, boolean b) {
log.info("连接关闭: {}",webSocket.getRemoteSocketAddress());
userSessions.values().removeIf(session -> session.equals(webSocket));
}
@Override
public void onMessage(WebSocket webSocket, String s) {
InteractionInputData inputData = JSONObject.parseObject(s, InteractionInputData.class);
userSessions.put(inputData.getUserInfo(), webSocket); // 注册连接
agent.receiveUserInput(inputData.getUserNickName(), inputData.getUserInfo(), inputData.getContent());
}
@Override
public void onError(WebSocket webSocket, Exception e) {
log.error(e.getLocalizedMessage());
}
@Override
public void onStart() {
log.info("WebSocketServer 已启动...");
}
@Override
public void sendMessage(String userInfo,String message) {
WebSocket webSocket = userSessions.get(userInfo);
if (webSocket != null && webSocket.isOpen()) {
webSocket.send(JSONUtil.toJsonStr(new InteractionOutputData(message)));
}else {
log.warn("用户不在线: {}",userInfo);
}
}
}

View File

@@ -0,0 +1,5 @@
package work.slhaf.agent.gateway;
public interface MessageSender {
void sendMessage(String userInfo,String message);
}

View File

@@ -1,16 +1,16 @@
package work.slhaf.agent.core.memory;
package work.slhaf.agent.modules.memory;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;
import work.slhaf.agent.core.chat.pojo.Message;
import work.slhaf.agent.core.memory.exception.UnExistedTopicException;
import work.slhaf.agent.core.memory.node.MemoryNode;
import work.slhaf.agent.core.memory.node.TopicNode;
import work.slhaf.agent.core.memory.pojo.MemoryResult;
import work.slhaf.agent.core.memory.pojo.MemorySlice;
import work.slhaf.agent.core.memory.pojo.MemorySliceResult;
import work.slhaf.agent.core.memory.pojo.PersistableObject;
import work.slhaf.agent.common.chat.pojo.Message;
import work.slhaf.agent.modules.memory.exception.UnExistedTopicException;
import work.slhaf.agent.modules.memory.node.MemoryNode;
import work.slhaf.agent.modules.memory.node.TopicNode;
import work.slhaf.agent.modules.memory.pojo.MemoryResult;
import work.slhaf.agent.modules.memory.pojo.MemorySlice;
import work.slhaf.agent.modules.memory.pojo.MemorySliceResult;
import work.slhaf.agent.modules.memory.pojo.PersistableObject;
import java.io.*;
import java.nio.file.Files;
@@ -115,7 +115,6 @@ public class MemoryGraph extends PersistableObject {
createStorageDirectory();
Path filePath = getFilePath(id);
if (memoryGraph == null && Files.exists(filePath)) {
try {
// 从文件加载
@@ -128,6 +127,7 @@ public class MemoryGraph extends PersistableObject {
// 创建新实例
memoryGraph = new MemoryGraph(id);
}
log.info("MemoryGraph注册完毕...");
return memoryGraph;
}
@@ -172,6 +172,40 @@ public class MemoryGraph extends PersistableObject {
checkCacheDate();
//如果topicPath在memorySliceCache中存在对应缓存由于进行的插入操作则需要移除该缓存但不清除相关计数
memorySliceCache.remove(topicPath);
TopicNode lastTopicNode = generateTopicPath(topicPath);
//检查是否存在当天对应的memorySlice并确定是否插入
LocalDate now = LocalDate.now();
boolean hasSlice = false;
MemoryNode node = null;
for (MemoryNode memoryNode : lastTopicNode.getMemoryNodes()) {
if (now.equals(memoryNode.getLocalDate())) {
hasSlice = true;
node = memoryNode;
break;
}
}
if (!hasSlice) {
node = new MemoryNode();
node.setLocalDate(now);
node.setMemoryNodeId(UUID.randomUUID().toString());
node.setMemorySliceList(new ArrayList<>());
lastTopicNode.getMemoryNodes().add(node);
lastTopicNode.getMemoryNodes().sort(null);
}
node.getMemorySliceList().add(slice);
//生成relatedTopicPath
for (List<String> relatedTopic : slice.getRelatedTopics()) {
generateTopicPath(relatedTopic);
}
updateDateIndex(now, slice);
updateDialogMap(slice);
node.saveMemorySliceList();
}
private TopicNode generateTopicPath(List<String> topicPath) {
topicPath = new ArrayList<>(topicPath);
//查看是否存在根主题节点
String rootTopic = topicPath.getFirst();
@@ -199,30 +233,7 @@ public class MemoryGraph extends PersistableObject {
existedTopicNodes.add(topic);
}
}
//检查是否存在当天对应的memorySlice
LocalDate now = LocalDate.now();
boolean hasSlice = false;
MemoryNode node = null;
for (MemoryNode memoryNode : lastTopicNode.getMemoryNodes()) {
if (now.equals(memoryNode.getLocalDate())) {
hasSlice = true;
node = memoryNode;
break;
}
}
if (!hasSlice) {
node = new MemoryNode();
node.setLocalDate(now);
node.setMemoryNodeId(UUID.randomUUID().toString());
node.setMemorySliceList(new ArrayList<>());
lastTopicNode.getMemoryNodes().add(node);
lastTopicNode.getMemoryNodes().sort(null);
}
node.getMemorySliceList().add(slice);
updateDateIndex(now, slice);
updateDialogMap(slice);
node.saveMemorySliceList();
return lastTopicNode;
}
private void updateDialogMap(MemorySlice slice) {

View File

@@ -0,0 +1,26 @@
package work.slhaf.agent.modules.memory;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import work.slhaf.agent.common.config.Config;
@Data
@Slf4j
public class MemoryManager {
private static MemoryManager memoryManager;
private MemoryGraph memoryGraph;
private SliceEvaluator sliceEvaluator;
public static MemoryManager initialize(Config config){
if (memoryManager == null) {
memoryManager = new MemoryManager();
memoryManager.setMemoryGraph(MemoryGraph.initialize(config.getAgentId()));
memoryManager.setSliceEvaluator(SliceEvaluator.initialize(config));
log.info("MemoryManager注册完毕...");
}
return memoryManager;
}
}

View File

@@ -1,13 +1,15 @@
package work.slhaf.agent.core.models.slice;
package work.slhaf.agent.modules.memory;
import lombok.Data;
import lombok.EqualsAndHashCode;
import work.slhaf.agent.core.config.Config;
import work.slhaf.agent.core.models.common.Model;
import work.slhaf.agent.core.models.common.ModelConstant;
import lombok.extern.slf4j.Slf4j;
import work.slhaf.agent.common.config.Config;
import work.slhaf.agent.common.model.Model;
import work.slhaf.agent.common.model.ModelConstant;
@EqualsAndHashCode(callSuper = true)
@Data
@Slf4j
public class SliceEvaluator extends Model {
public static final String MODEL_KEY = "slice_evaluator";
@@ -19,6 +21,7 @@ public class SliceEvaluator extends Model {
sliceEvaluator = new SliceEvaluator();
sliceEvaluator.setPrompt(ModelConstant.SLICE_EVALUATOR_PROMPT);
setModel(config,sliceEvaluator, MODEL_KEY, sliceEvaluator.getPrompt());
log.info("SliceEvaluator注册完毕...");
}
return sliceEvaluator;

View File

@@ -1,4 +1,4 @@
package work.slhaf.agent.core.memory.exception;
package work.slhaf.agent.modules.memory.exception;
public class NullSliceListException extends RuntimeException {
public NullSliceListException(String message) {

View File

@@ -1,4 +1,4 @@
package work.slhaf.agent.core.memory.exception;
package work.slhaf.agent.modules.memory.exception;
public class UnExistedTopicException extends RuntimeException {
public UnExistedTopicException(String message) {

View File

@@ -1,11 +1,11 @@
package work.slhaf.agent.core.memory.node;
package work.slhaf.agent.modules.memory.node;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;
import work.slhaf.agent.core.memory.exception.NullSliceListException;
import work.slhaf.agent.core.memory.pojo.MemorySlice;
import work.slhaf.agent.core.memory.pojo.PersistableObject;
import work.slhaf.agent.modules.memory.exception.NullSliceListException;
import work.slhaf.agent.modules.memory.pojo.MemorySlice;
import work.slhaf.agent.modules.memory.pojo.PersistableObject;
import java.io.*;
import java.time.LocalDate;

View File

@@ -1,8 +1,8 @@
package work.slhaf.agent.core.memory.node;
package work.slhaf.agent.modules.memory.node;
import lombok.Data;
import lombok.EqualsAndHashCode;
import work.slhaf.agent.core.memory.pojo.PersistableObject;
import work.slhaf.agent.modules.memory.pojo.PersistableObject;
import java.io.Serial;
import java.util.concurrent.ConcurrentHashMap;

View File

@@ -1,4 +1,4 @@
package work.slhaf.agent.core.memory.pojo;
package work.slhaf.agent.modules.memory.pojo;
import lombok.Data;

View File

@@ -1,8 +1,8 @@
package work.slhaf.agent.core.memory.pojo;
package work.slhaf.agent.modules.memory.pojo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import work.slhaf.agent.core.chat.pojo.Message;
import work.slhaf.agent.common.chat.pojo.Message;
import java.io.Serial;
import java.util.List;
@@ -48,7 +48,7 @@ public class MemorySlice extends PersistableObject implements Comparable<MemoryS
private String startUser;
/**
* 该切片涉及到的用户
* 该切片涉及到的用户uuid
*/
private List<String> involvedUsers;

View File

@@ -1,4 +1,4 @@
package work.slhaf.agent.core.memory.pojo;
package work.slhaf.agent.modules.memory.pojo;
import lombok.Data;

View File

@@ -1,4 +1,4 @@
package work.slhaf.agent.core.memory.pojo;
package work.slhaf.agent.modules.memory.pojo;
import java.io.Serializable;

View File

@@ -0,0 +1,12 @@
package work.slhaf.agent.modules.memory.pojo;
import lombok.Data;
import java.util.List;
@Data
public class User {
private String uuid;
private List<String> info;
private String nickName;
}

View File

@@ -0,0 +1,4 @@
package work.slhaf.agent.modules.task;
public class TaskExecutor {
}

View File

@@ -0,0 +1,28 @@
package work.slhaf.agent.modules.task;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;
import work.slhaf.agent.common.config.Config;
import work.slhaf.agent.common.model.Model;
import work.slhaf.agent.common.model.ModelConstant;
@EqualsAndHashCode(callSuper = true)
@Data
@Slf4j
public class TaskScheduler extends Model {
public static final String MODEL_KEY = "task_trigger";
private static TaskScheduler taskScheduler;
public static TaskScheduler initialize(Config config) {
if (taskScheduler == null) {
taskScheduler = new TaskScheduler();
taskScheduler.setPrompt(ModelConstant.SLICE_EVALUATOR_PROMPT);
setModel(config, taskScheduler, MODEL_KEY, taskScheduler.getPrompt());
log.info("TaskScheduler注册完毕...");
}
return taskScheduler;
}
}

View File

@@ -1,10 +1,10 @@
package work.slhaf.agent.core.models.topic;
package work.slhaf.agent.modules.topic;
import lombok.Data;
import lombok.EqualsAndHashCode;
import work.slhaf.agent.core.config.Config;
import work.slhaf.agent.core.models.common.Model;
import work.slhaf.agent.core.models.common.ModelConstant;
import work.slhaf.agent.common.config.Config;
import work.slhaf.agent.common.model.Model;
import work.slhaf.agent.common.model.ModelConstant;
@EqualsAndHashCode(callSuper = true)
@Data

View File

@@ -2,10 +2,10 @@ package memory;
import org.junit.Before;
import org.junit.Test;
import work.slhaf.agent.core.memory.MemoryGraph;
import work.slhaf.agent.core.memory.pojo.MemorySlice;
import work.slhaf.agent.core.memory.node.MemoryNode;
import work.slhaf.agent.core.memory.node.TopicNode;
import work.slhaf.agent.modules.memory.MemoryGraph;
import work.slhaf.agent.modules.memory.pojo.MemorySlice;
import work.slhaf.agent.modules.memory.node.MemoryNode;
import work.slhaf.agent.modules.memory.node.TopicNode;
import java.io.IOException;
import java.time.LocalDate;

View File

@@ -2,12 +2,12 @@ package memory;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import work.slhaf.agent.core.memory.MemoryGraph;
import work.slhaf.agent.core.memory.pojo.MemorySlice;
import work.slhaf.agent.core.memory.exception.UnExistedTopicException;
import work.slhaf.agent.core.memory.node.MemoryNode;
import work.slhaf.agent.core.memory.node.TopicNode;
import work.slhaf.agent.core.memory.pojo.MemoryResult;
import work.slhaf.agent.modules.memory.MemoryGraph;
import work.slhaf.agent.modules.memory.pojo.MemorySlice;
import work.slhaf.agent.modules.memory.exception.UnExistedTopicException;
import work.slhaf.agent.modules.memory.node.MemoryNode;
import work.slhaf.agent.modules.memory.node.TopicNode;
import work.slhaf.agent.modules.memory.pojo.MemoryResult;
import java.io.IOException;
import java.time.LocalDate;