Skip to content

Conversation

970263611
Copy link
Contributor

@970263611 970263611 commented Aug 7, 2025

Describe what this PR does / why we need it

使jmanus支持记忆能力
点击选择记忆按钮侧边展示记忆窗口
image
页面包含名称,修改名称按钮,展开记忆按钮,删除记忆按钮,记忆概览,记忆id,记忆条数,记忆时间
image
如未选择任何记忆(第一次交互也是如此),则会默认生成一条记忆。左侧列表会展示出来。
点击标题则选中记忆,此时选择记忆按钮会展示为选择的记忆id(包含清除记忆按钮),后续的对话会复用记忆并补充。同时侧边栏收起。也可以清除选择的记忆。选择不使用记忆来对话。
image
无论是否选择记忆,都可以通过点击选择记忆按钮来更换对话的记忆。

其他实现:
页面完全支持国际化。
记忆的默认名称是格式化的时间: 'MMM dd,yyyy hh:mm a' 。这里会根据不同时区展示不同的文字,如在中国会得到 '8月 07, 2025 09:30 上午' ,在美国会得到 'Aug 07, 2025 09:30 AM' 。
当侧边栏展开式,记忆列表会立即请求数据并保持每3秒刷新(当展开某一个记忆时,即使刷新数据也会保留展开状态,增强使用体验),当侧边栏收起时,则清除记忆列表的自动刷新。
同时增加了h2数据库的记忆组件。

对应issue:#1949

Does this pull request fix one issue?

Describe how you did it

Describe how to verify it

Special notes for reviews

@github-actions github-actions bot added area/jmanus SAA Jmanus module area/core SAA Core module area/community SAA community module area/memory SAA Community chat memory module labels Aug 7, 2025
@rainerWJY
Copy link
Collaborator

有点 对不齐 ,这个对应这个需求么?
#1949

@970263611
Copy link
Contributor Author

有点 对不齐 ,这个对应这个需求么? #1949

是的佬

@rainerWJY rainerWJY requested a review from yuluo-yx August 7, 2025 08:22
@rainerWJY
Copy link
Collaborator

@yuluo-yx 帮忙找个人review一下非 jmanus的代码 。

@ConfigurationProperties(H2ChatMemoryProperties.CONFIG_PREFIX)
public class H2ChatMemoryProperties {

public static final String CONFIG_PREFIX = "spring.ai.chat.memory.repository.jdbc.h2";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里和其他 memory 保持一致吧

* Auto-configuration for h2 chat memory repository.
*/
@AutoConfiguration(after = JdbcTemplateAutoConfiguration.class)
@ConditionalOnClass({ H2ChatMemoryRepository.class, DataSource.class, JdbcTemplate.class })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

javax.sql.DataSource 需要这个 conditional 条件吗?

@yuluo-yx
Copy link
Collaborator

yuluo-yx commented Aug 7, 2025

good job, thansk for your contribution.

Please fix ci and some review comments before merging it.

yuluo-yx
yuluo-yx previously approved these changes Aug 7, 2025
@rainerWJY
Copy link
Collaborator

rainerWJY commented Aug 8, 2025

界面目前看已经很棒了 !

不过,实测下来的问题:

  • 在 home(首页) 页面,点击 任何一个 测试按钮。 前端都不会传递请求到后端。
    claude 4 也找到了问题,是 没有按要求传递 InputMessage

  • 这延伸出另一个问题,就是为什么ts没有检查到这个错误? 看起来类型检查系统没有起作用,请再调整一下。

  • 1,2 改了以后,后端报错:
    2025-08-08 23:18:55.745 ERROR 79163 --- [nPool-worker-10] c.a.c.a.e.m.p.c.ManusController : Failed to execute plan

java.lang.IllegalArgumentException: conversationId cannot be null or empty
at org.springframework.util.Assert.hasText(Assert.java:253)

这让我意识到,你的ConvId是在前端生产的
这个在架构设计上不大合理 ,ConvId是需要在后端生产的:

  1. 前端:发起创建会话请求
  2. 后端:生成UUID + 初始化数据 + 返回ID
  3. 前端:使用后端返回的ID进行后续交互
  • pom的mysql 依赖有错误(我全部清空maven测试时候发现的)
    要改成下面这个

    com.mysql
    mysql-connector-j
    8.0.33
    runtime

先改这几个吧。然后我再测测

@970263611
Copy link
Contributor Author

at org.springframework.util.Assert.hasText(Assert.java:253)

好的佬

@rainerWJY
Copy link
Collaborator

image

@970263611
Copy link
Contributor Author

image

佬,这里的设计是需要点标题,考虑到有人可能想复制所以去除了大范围的点击选中。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/community SAA community module area/core SAA Core module area/jmanus SAA Jmanus module area/memory SAA Community chat memory module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants