feat: V1记忆系统支持、管理员记忆编辑及对话记忆注入开关
- 新增 V1 记忆系统(memory.json)支持:提取结果强制中文、历史字段修复为增量累积日志 - 用户设置页面:V1 模式下新增 agent 选择器,可查看各 agent 的私有记忆 - 管理员记忆页面:区分 V1/V2 渲染,V1 支持完整 CRUD(用户画像/历史摘要/事实记录) - 后端新增 V1 记忆 CRUD API(sections/facts),前端同步添加对应 hooks 和 API 调用 - 新建专家页面:标记 bootstrap 线程类型,跳过记忆保存,侧边栏过滤该类线程 - 输入框工具栏新增「记忆」开关:关闭时 V1/V2 均不注入,开启时按 config.yaml 版本正常注入 - 修复 agent 目录不存在时的 FileNotFoundError,回退至默认配置 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
d59e0514b3
commit
b3a39cbdf7
27 files changed
+2725
-92
No files matched your search
@@ -1,7 +1,23 @@
|
||||
// Memory V2 数据模型。对应后端 /api/memory/v2 系列端点。
|
||||
// Memory 数据模型。对应后端 /api/memory/v2 系列端点。支持 V1 / V2 两个版本。
|
||||
|
||||
/** builtin 本地记忆数据视图 (USER.md / MEMORY.md)。 */
|
||||
/** V1 记忆中的单条事实。 */
|
||||
export interface MemoryFact {
|
||||
id: string;
|
||||
content: string;
|
||||
category: string;
|
||||
confidence: number;
|
||||
createdAt: string;
|
||||
/** 纠错类事实:被纠正的原错误描述(category=correction 时可能有值)。 */
|
||||
sourceError?: string;
|
||||
}
|
||||
|
||||
/** 记忆数据视图 —— V1/V2 共用结构。
|
||||
*
|
||||
* - V2 模式: user_entries / memory_entries / user_usage / memory_usage 有值
|
||||
* - V1 模式: facts / user_context / memory_usage 有值
|
||||
*/
|
||||
export interface MemoryV2Data {
|
||||
// V2 字段
|
||||
/** USER.md 条目 —— 用户画像,跨 agent 共享。 */
|
||||
user_entries: string[];
|
||||
/** MEMORY.md 条目 —— 当前 agent 的工作笔记。 */
|
||||
@@ -10,17 +26,27 @@ export interface MemoryV2Data {
|
||||
user_usage: string;
|
||||
/** MEMORY.md 字符用量。 */
|
||||
memory_usage: string;
|
||||
|
||||
// V1 字段
|
||||
/** V1 facts 列表,按置信度降序。 */
|
||||
facts: MemoryFact[];
|
||||
/** V1 userContext 摘要。 */
|
||||
user_context: Record<string, string>;
|
||||
/** V1 history 历史摘要。 */
|
||||
history: Record<string, string>;
|
||||
}
|
||||
|
||||
/** 记忆条目所属类别。 */
|
||||
export type MemoryTarget = "user" | "memory";
|
||||
|
||||
/** 生效记忆配置 + 用户可改字段白名单。 */
|
||||
/** 生效记忆配置 + 用户可改字段白名单 + 版本号。 */
|
||||
export interface MemoryV2ConfigResponse {
|
||||
/** 按 per-user 覆盖合并后的生效配置 (嵌套 dict)。 */
|
||||
config: MemoryV2Config;
|
||||
/** 用户可在运行时覆盖的字段 (点号路径)。 */
|
||||
writable_fields: string[];
|
||||
/** 当前记忆版本:v1 或 v2。 */
|
||||
version: "v1" | "v2";
|
||||
}
|
||||
|
||||
/** 生效记忆配置的关注字段 (后端 dict 的子集)。 */
|
||||
|
||||
Reference in new issue
Block a user