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>
This commit is contained in:
SerenNoble 2026-06-21 18:40:06 +08:00
parent 1516820dfe
commit ea5ccf5d40
2 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,16 @@
-- 注册 aipet 记忆实例并设为默认(FTS5 本地记忆,运行时由 core/providers/memory/aipet 自动加载 xiaozhi-memory 框架)
-- 先把其他 Memory 配置置为非默认
UPDATE `ai_model_config` SET `is_default` = 0 WHERE `model_type` = 'Memory';
-- 插入 aipet 实例(config_json 字段对齐 aipet.py:db_path / retrieval_mode)
INSERT INTO `ai_model_config`
(`id`, `model_type`, `model_code`, `model_name`, `is_default`, `is_enabled`, `config_json`, `sort`, `creator`, `create_date`, `updater`, `update_date`)
VALUES (
'Memory_aipet', 'Memory', 'aipet', 'AIPet本地记忆(FTS5)', 1, 1,
JSON_OBJECT('type', 'aipet', 'db_path', './data/xiaozhi_memory.db', 'retrieval_mode', 'fts5'),
10, 1, NOW(), 1, NOW()
)
ON DUPLICATE KEY UPDATE
`is_default` = VALUES(`is_default`),
`is_enabled` = VALUES(`is_enabled`),
`config_json` = VALUES(`config_json`);

View file

@ -655,3 +655,10 @@ databaseChangeLog:
- sqlFile: - sqlFile:
encoding: utf8 encoding: utf8
path: classpath:db/changelog/202606191200.sql path: classpath:db/changelog/202606191200.sql
- changeSet:
id: 202606211000
author: aipet
changes:
- sqlFile:
encoding: utf8
path: classpath:db/changelog/202606211000.sql