SerenNoble
3b75520a9b
fix: 撤掉崩溃的扩展字段编辑器 + 去掉「换角色/恢复自动匹配」按钮
...
- roleConfig.vue/agent.js 还原到 ext 编辑器之前(编辑器运行时崩页面,先撤)
- DeviceItem.vue 去掉换角色/恢复自动匹配按钮及处理函数(用户不要)
- ext 后端(表/API/{{ext.key}} 替换)保留,家长期望仍在乐宝生效
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-02 19:59:06 +08:00
SerenNoble
b0b1b10bbf
feat: 智控台 roleConfig 加扩展字段编辑器
...
- agent.js 加 getExt / saveExt
- roleConfig.vue 加键值对列表编辑器 + 加载/保存钩子
- 模板里字面量 {{ext.字段名}} 用 HTML 实体避免 Vue2 编译冲突
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-02 15:59:59 +08:00
SerenNoble
7a8e5fc08a
feat: ConfigServiceImpl 接入 ext 替换 + 生效 agent 重构
...
- resolveUserPersonaPrompt → resolveEffectiveAgent(返回 AgentEntity)
- 新增 applyExtToPrompt:{{ext.key}} 替换成生效 agent 的 ext 值,残留占位符清空
- getAgentModels 用生效 agent 的 prompt + ext(matcher 覆盖时用匹配角色 ext)
- buildModuleConfig 不变({{assistant_name}} 仍用设备 agent 名)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-02 15:51:04 +08:00
SerenNoble
b31b0a714f
feat: AgentExtController GET/PUT /agent/{id}/ext
...
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-02 15:46:42 +08:00
SerenNoble
0859285174
feat: AgentExt service(getByAgentId / saveOrUpdate)
...
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-02 15:45:09 +08:00
SerenNoble
d02c783629
feat: AgentExt entity + dao
...
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-02 15:43:30 +08:00
SerenNoble
aca1518af5
feat: 新建 ai_agent_ext 表(agent 扩展字段 JSON)
...
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-02 15:42:03 +08:00
SerenNoble
c65a4fba96
docs: agent 扩展字段实现计划
...
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-02 10:32:15 +08:00
SerenNoble
235fcd76b1
docs: agent 扩展字段(键值对→system_prompt 模板变量)设计 spec
...
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-01 20:37:13 +08:00
SerenNoble
2ebe42b78d
fix: Dockerfile-web 基础镜像换 eclipse-temurin:21-jre-alpine
...
bellsoft/liberica-runtime-container:jre-21-glibc 拉取不稳定(transient 404),
换 Docker Hub 主流的 eclipse-temurin:21-jre-alpine(apk 兼容,musl 实测可用),
让别的机器 docker build 能稳定成功 → 可移植部署。
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-29 21:09:35 +08:00
SerenNoble
0e229dffa6
fix: matcher 提示词补 {conversation} 占位符
...
generateSummary 只替换 {conversation} 占位符,而 buildInstruction 没有它,
导致拼好的「聊天内容+候选角色」从没发给 LLM,全程幻觉。
补上占位符 + 收一下调试日志(不记录聊天原文)。
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-28 20:33:31 +08:00
SerenNoble
7b2b520cf5
fix: matcher 用编号选择取代 LLM 抄 id; manual 列反引号转义
...
运行时 E2E 测试发现:
1) ChatGLM 抄不准 32 位 hex id(返回 候选id/candidate_2/id=12345 等幻觉),
改让 LLM 返回编号 1..N,代码按编号映射真实 id。
2) manual 是 MySQL 8 保留字,SELECT manual 报语法错,@TableField 反引号转义。
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-28 19:29:04 +08:00
SerenNoble
5786f64b47
fix: matcher 遍历有设备的用户(修空表永不 seed 新用户 bug)
...
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-28 19:08:20 +08:00
SerenNoble
674f47ad27
fix: 角色池改用全局,下拉框列全部候选角色
2026-06-28 18:32:46 +08:00
SerenNoble
6ef80fd76f
fix: getAgentModels 删除/非法 agent 回退不抛异常; parse 拒绝越界 score
...
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-28 18:23:57 +08:00
SerenNoble
b94536fe7a
feat: 智控台加「换角色/恢复自动匹配」按钮
...
DeviceItem 用户侧设备卡操作区新增:
- 换角色(el-dropdown): 列出候选 agent,选中调 POST /persona/switch {agentId}
- 恢复自动匹配(按钮): 调 POST /persona/auto
成功后 $emit persona-changed,home.vue 刷新 agent 列表。
新增 apis/module/persona.js 并在 api.js 注册,沿用既有 RequestService 封装(自动带 token)。
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-28 17:28:52 +08:00
SerenNoble
be72b14650
feat: 家长手动切换/恢复自动匹配角色接口
...
新增 UserPersonaController:
- POST /persona/switch {agentId} 调用 setManual,标 manual=1,自动任务不再覆盖
- POST /persona/auto 调用 resetAuto,恢复自动匹配
均需 sys:role:normal 权限,按当前登录用户 SecurityUser.getUser().getId() 取 userId
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-28 17:22:41 +08:00
SerenNoble
9135d02f84
feat: getAgentModels 按用户匹配角色覆盖 system_prompt
...
在 ConfigServiceImpl 注入 UserPersonaAssignmentService,新增
resolveUserPersonaPrompt(device, fallbackAgent):若设备所属用户存在
有效的 persona 映射且映射角色 system_prompt 非空,则覆盖 prompt,
否则回退设备绑定 agent。仅修改 getAgentModels 内的 buildModuleConfig
调用,getConfig 默认模板路径不变。
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-28 17:18:56 +08:00
SerenNoble
f71b4c3aac
feat: PersonaMatchTask 每周自动匹配角色
2026-06-28 17:10:50 +08:00
SerenNoble
c1de5a3475
fix: PersonaMatcher manual 用户跳过(不覆盖手动设定)
2026-06-28 17:06:06 +08:00
SerenNoble
54eecb1601
feat: PersonaMatcher 主题匹配(高阈值保守切换)
...
拉取用户设备近期孩子聊天+候选角色→调 LLM→仅当新角色置信度高出当前 ≥0.20 才切换;
历史不足/无候选/解析失败均保守不动。AgentService/DeviceService 因继承 BaseService
(非 IService) 改用对应 Dao.selectList,逻辑不变。
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-28 16:59:01 +08:00
SerenNoble
2fb2ddef4c
feat: UserPersonaAssignment service(upsert/manual/reset)
...
Task 3: 读写映射 Service
- UserPersonaAssignmentService 接口(getByUserId/upsertAuto/setManual/resetAuto)
- UserPersonaAssignmentServiceImpl(LambdaQueryWrapper + saveOrUpdate)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-28 16:50:22 +08:00
SerenNoble
3df8cd7b8d
feat: UserPersonaAssignment entity + dao
...
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-28 16:45:14 +08:00
SerenNoble
4460a8d805
feat: 新建 ai_user_persona_assignment 表(陪伴角色匹配映射)
...
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-28 16:35:32 +08:00
SerenNoble
298f264e1d
docs: 儿童陪伴角色匹配 spec + 实现计划
...
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-28 16:28:00 +08:00
SerenNoble
54b9ca18b5
fix: aipet 记忆不设为默认(保持可用,默认恢复 nomem)
...
202606211000.sql:aipet 实例 is_default=0(is_enabled=1 仍可在智控台选用),
去掉「把所有 Memory 置为非默认」的全局 UPDATE,保留各部署自己的默认选择。
默认记忆回到 nomem,需要 aipet 时在智控台手动切换。
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-21 19:00:48 +08:00
SerenNoble
ea5ccf5d40
feat: aipet 记忆设为默认(changelog 自动注册,换机直接生效)
...
新增 202606211000.sql:往 ai_model_config 插入 Memory_aipet 实例
(type=aipet, db_path=./data/xiaozhi_memory.db, retrieval_mode=fts5)
并设为默认记忆,其余 Memory 配置置为非默认。
aipet provider 运行时自动加载 xiaozhi-memory 框架(FTS5 检索)。
Liquibase 随 web 镜像启动自动执行,新部署无需手动配置记忆。
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-21 18:40:06 +08:00
SerenNoble
1516820dfe
fix: 缓存开关仅 qwen/豆包显示,消除 openai provider 的按钮泄漏
...
缓存字段挂在共享的 openai provider 上,导致智谱/DeepSeek/讯飞/LMStudio/
火山网关等所有 openai 兼容模型都带出了「是否开启缓存」按钮,但它们并不支持。
ModelEditDialog.vue / AddModelDialog.vue:openai provider 下 cache 字段仅当
base_url 含 aliyuncs(即 qwen)时渲染;豆包走 doubao_cache provider,不受影响。
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-21 18:24:16 +08:00
SerenNoble
330d3a20ca
docs: 新增自构建部署指南(换机 clone 后照此启动)
...
仓库根 部署指南.md:前置条件、首次准备(config.yaml/model.pt)、一键启动、
验证、数据库、更新重建、常见问题(CRLF/build context/403缓存)、端口凭据速查。
对应 docker-compose-selfbuild.yml。
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-21 00:12:23 +08:00
SerenNoble
c9c8324cc8
feat: 自构建部署可移植化 + aipet/缓存注册 + 记忆系统定制
...
可移植性(换机 git clone + docker compose -f docker-compose-selfbuild.yml up --build 即用):
- Dockerfile-server: server-base 改 ARG 引用(默认 NJU 镜像,国内自包含;海外可 --build-arg 覆盖)
- docker-compose-selfbuild.yml: 新增自构建 compose(server/web build:,mysql/redis image:)
- .dockerignore: 排除运行时数据目录(**/mysql/、*.db、**/data/),修复 build context 权限错误
- Dockerfile-web: start.sh CRLF→LF(修 exec "no such file or directory")
智控台 provider 注册(纯数据库驱动,前端无白名单):
- 202606191200.sql: 注册 SYSTEM_Memory_aipet 记忆 provider
- 202606120930.sql: 修列名 bug(is_custom→creator/updater)+ cache 改 boolean 开关
- db.changelog-master.yaml: 注册 202606191200
- AddModelDialog.vue: boolean 字段渲染为 el-switch 开关
server 端核心定制入库(此前未提交,换机会缺失):
- core/connection.py: 当天日程注入半稳定系统提示词
- core/providers/memory/aipet/aipet.py: FTS5 检索增强
- xiaozhi-memory/*: memory_manager / fts / sqlite_store / tokenizer / time_parser 检索修复
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-20 23:25:43 +08:00
mkp
f8222c8461
Merge pull request #1 from SerenNoble/feat/llm-cache-control
...
feat: LLM缓存控制与对话分层优化
2026-06-13 10:53:34 +08:00
SerenNoble
346b78b1f4
feat: LLM缓存控制与对话分层优化
...
- LLM Provider 支持 cache boolean 开关(前端可控)
- 对话拆分为静态/半稳定/实时三层,优化缓存前缀命中率
- 新增 doubao_cache Provider(豆包 Session 缓存)
- 修复 ModelEditDialog boolean 类型被 String() 转换的 bug
- 数据库迁移:openai provider 增加 cache 字段
- xiaozhi-memory: FTS5 tokenizer 安全修复、改用 ChatGLM
- aipet: 修复 async 调用和 search 方法
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 20:57:44 +08:00
mkp
07b9f20da0
fix: 将默认记忆模块从aipet改为mem_local_short
...
Docker镜像中未包含aipet记忆模块的实现,导致启动报错。
mem_local_short是本地记忆模块,通过LLM总结,数据保存在本地服务器。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 20:13:09 +08:00
mkp
9a86b80b9d
Refactor code structure for improved readability and maintainability
2026-06-03 18:20:41 +08:00
mkp
0b4d5f594a
feat: add LLM memory extraction functionality with OpenAI support
...
- Implemented a new test script for LLM memory extraction in `test_llm_extraction.py`.
- Created LLM client module with base class `LLMClient` and OpenAI-specific implementation.
- Added fact extraction prompt template for structured memory extraction.
- Integrated memory management with retrieval and intention extraction capabilities.
2026-05-27 22:35:08 +08:00
mkp
9d0a1f7a13
feat: 添加 aipet 记忆模块和 xiaozhi-memory 框架
...
- 新增 xiaozhi-memory 轻量级记忆框架
- 支持 SQLite + FTS5 全文检索
- 支持中文分词 (jieba)
- 支持多种记忆类型:事实、意图、偏好、用户画像
- 支持时间解析和计划管理
- 新增 aipet MemoryProvider
- 集成 xiaozhi-memory 到 xiaozhi-esp32-server
- 支持本地存储,无需外部服务
- 添加分析文档
- mem0ai vs PowerMem 对比分析
- AI 记忆系统对比
- 小智记忆设计方案
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 18:43:33 +08:00
wengzh
5aeb55fffd
Merge pull request #3155 from xinnan-tech/perf-tool-call-optimization
...
perf:优化工具调用问题、调整后端智能体搜索条件逻辑
2026-05-06 17:01:15 +08:00
DaGou12138
c33ee9442e
perf:
...
1、优化小智后端智能体搜索条件逻辑
2、优化工具调用准确率问题,修改工具提示词,去除非必要的few-shot逻辑
3、优化工具描述内容
2026-05-06 16:53:06 +08:00
wengzh
036b89f24e
Merge pull request #3151 from xinnan-tech/py-refactor-asr-tts
...
调整配置
2026-04-30 11:42:36 +08:00
Sakura-RanChen
354280d430
调整配置
2026-04-30 11:41:16 +08:00
hrz
e2d16ec8d4
Merge pull request #3150 from Mirrorium227/main
...
Closes #Issue3149 修复文档序号
2026-04-30 11:27:15 +08:00
Radar Song
6a0192de27
Closes #Issue3149 修复文档序号
2026-04-29 20:18:17 +08:00
hrz
ac6eeb5c1f
Merge pull request #3145 from haixinke/fix-bug_prompt_cache_key_wrong
...
Fix:【设备快速提示词缓存key错误】
2026-04-29 14:32:42 +08:00
minwang
23e213f6ea
修复设备快速提示词缓存key错误
2026-04-28 15:52:23 +08:00
wengzh
382c948482
Merge pull request #3144 from xinnan-tech/fix-memory-config
...
fix:修复记忆模型配置保存字段未删除问题
2026-04-28 15:25:49 +08:00
DaGou12138
a67d938523
fix:修复记忆模型配置保存字段未删除问题
2026-04-28 15:23:57 +08:00
wengzh
26aca54f4b
Merge pull request #3141 from xinnan-tech/add-correct-word
...
fix修复 asyncio.gather 吞掉业务异常的问题
2026-04-27 17:31:47 +08:00
rainv123
4717b8beac
fix修复 asyncio.gather 吞掉业务异常的问题
2026-04-27 17:29:41 +08:00
wengzh
cd580b6f81
Merge pull request #3139 from xinnan-tech/py-fix-mem0ai
...
fix: 修复Mem0AI记忆模式工具调用时保存记忆400错误
2026-04-27 16:57:26 +08:00
3030332422
70740af7a6
fix: 修复Mem0AI记忆模式工具调用时保存记忆400错误
2026-04-27 16:25:05 +08:00