mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
feat: add compaction ratio setting to control partial context compaction
Allow users to configure what percentage of older messages to compact, keeping the most recent portion intact. Default ratio is 80%, meaning the oldest 80% of uncompacted messages are summarized while the newest 20% remain as-is for full-fidelity context.
This commit is contained in:
@@ -174,6 +174,7 @@ CREATE TABLE IF NOT EXISTS bots (
|
||||
heartbeat_model_id UUID REFERENCES models(id) ON DELETE SET NULL,
|
||||
compaction_enabled BOOLEAN NOT NULL DEFAULT false,
|
||||
compaction_threshold INTEGER NOT NULL DEFAULT 100000,
|
||||
compaction_ratio INTEGER NOT NULL DEFAULT 80,
|
||||
compaction_model_id UUID REFERENCES models(id) ON DELETE SET NULL,
|
||||
title_model_id UUID REFERENCES models(id) ON DELETE SET NULL,
|
||||
tts_model_id UUID REFERENCES tts_models(id) ON DELETE SET NULL,
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
-- 0052_compaction_ratio (rollback)
|
||||
-- Remove compaction_ratio column from bots table.
|
||||
|
||||
ALTER TABLE bots DROP COLUMN IF EXISTS compaction_ratio;
|
||||
@@ -0,0 +1,4 @@
|
||||
-- 0052_compaction_ratio
|
||||
-- Add compaction_ratio column to bots table for controlling what percentage of messages to compact.
|
||||
|
||||
ALTER TABLE bots ADD COLUMN IF NOT EXISTS compaction_ratio INTEGER NOT NULL DEFAULT 80;
|
||||
Reference in New Issue
Block a user