feat: Add agent configuration and cleanup scripts for database migrations

This commit is contained in:
wizardchen
2025-11-05 23:18:44 +08:00
parent ae9d0778e9
commit 4fa3adbf3b
126 changed files with 22506 additions and 629 deletions
+4
View File
@@ -16,6 +16,7 @@ CREATE TABLE tenants (
business VARCHAR(255) NOT NULL,
storage_quota BIGINT NOT NULL DEFAULT 10737418240,
storage_used BIGINT NOT NULL DEFAULT 0,
agent_config JSON DEFAULT NULL COMMENT 'Tenant-level agent configuration in JSON format',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
deleted_at TIMESTAMP NULL DEFAULT NULL
@@ -104,6 +105,8 @@ CREATE TABLE sessions (
rerank_threshold FLOAT NOT NULL DEFAULT 0.65,
summary_model_id VARCHAR(64),
summary_parameters JSON NOT NULL,
agent_config JSON DEFAULT NULL COMMENT 'Session-level agent configuration in JSON format',
context_config JSON DEFAULT NULL COMMENT 'LLM context management configuration (separate from message storage)',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
deleted_at TIMESTAMP NULL DEFAULT NULL
@@ -118,6 +121,7 @@ CREATE TABLE messages (
role VARCHAR(50) NOT NULL,
content TEXT NOT NULL,
knowledge_references JSON NOT NULL,
agent_steps JSON DEFAULT NULL COMMENT 'Agent execution steps (reasoning process and tool calls)',
is_completed BOOLEAN NOT NULL DEFAULT FALSE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,