23 lines
1.2 KiB
SQL
23 lines
1.2 KiB
SQL
-- pipeline_user_memory: 跨会话记忆表(v2 新增)
|
||
-- 对照 Hermes Agent 的 memory 系统
|
||
|
||
CREATE TABLE IF NOT EXISTS `pipeline_user_memory` (
|
||
`id` varchar(32) NOT NULL COMMENT '主键',
|
||
`memory_key` varchar(64) NOT NULL COMMENT '记忆唯一标识(内容MD5)',
|
||
`content` text NOT NULL COMMENT '记忆内容',
|
||
`category` varchar(32) NOT NULL DEFAULT 'memory' COMMENT '分类: user/memory',
|
||
`priority` int NOT NULL DEFAULT 0 COMMENT '优先级(越高越重要)',
|
||
`access_count` int NOT NULL DEFAULT 0 COMMENT '被引用次数',
|
||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||
PRIMARY KEY (`id`),
|
||
UNIQUE KEY `uk_memory` (`memory_key`, `category`),
|
||
KEY `idx_category_priority` (`category`, `priority` DESC)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Agent 跨会话记忆';
|
||
|
||
-- pipeline_agent_config: 产线级 Agent 配置(可选,JSON 字段)
|
||
ALTER TABLE `pipelines` ADD COLUMN IF NOT EXISTS `agent_config` text COMMENT 'Agent配置JSON';
|
||
|
||
-- sd_org_settings 增加 agent_config 字段
|
||
ALTER TABLE `sd_org_settings` ADD COLUMN IF NOT EXISTS `agent_config` text COMMENT '项目级Agent配置JSON';
|