CREATE TABLE `spring_ai_chat_memory` ( `conversation_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '会话ID', `content` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息内容', `type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息类型: USER, ASSISTANT, SYSTEM, TOOL', `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '时间戳', KEY `idx_conversation_id` (`conversation_id`), KEY `idx_timestamp` (`timestamp`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='AI聊天记忆表';