Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions data/schemas/20260707000000_memory_tier_decay.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE convo_memory ADD COLUMN IF NOT EXISTS tier text NOT NULL DEFAULT 'working';
ALTER TABLE convo_memory ADD COLUMN IF NOT EXISTS importance_score float NOT NULL DEFAULT 0.5;
ALTER TABLE convo_memory ADD COLUMN IF NOT EXISTS last_accessed_at timestamptz NOT NULL DEFAULT now();
ALTER TABLE convo_memory ADD COLUMN IF NOT EXISTS access_count int NOT NULL DEFAULT 0;
ALTER TABLE convo_memory ADD COLUMN IF NOT EXISTS decay_rate float NOT NULL DEFAULT 1.0;
27 changes: 27 additions & 0 deletions docs/convo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
depends:
comm: 'github.com/cupogo/andvari/models/comm'
oid: 'github.com/cupogo/andvari/models/oid'
time: 'time'

enums:

Expand Down Expand Up @@ -226,6 +227,32 @@ models:
type: string
tags: {json: 'content', pg: ',notnull,type:text'}
isset: true
- comment: 分层 (working/short-term/long-term)
name: Tier
type: string
tags: {json: 'tier', pg: ',notnull,type:text,default:working'}
isset: true
query: 'match'
- comment: 重要性评分 (0-1)
name: ImportanceScore
type: float64
tags: {json: 'importanceScore', pg: 'importance_score,notnull,type:float,default:0.5'}
isset: true
- comment: 最近访问时间
name: LastAccessedAt
type: "time.Time"
tags: {json: 'lastAccessedAt', pg: 'last_accessed_at,notnull,type:timestamptz,default:now()'}
isset: true
- comment: 访问计数
name: AccessCount
type: int
tags: {json: 'accessCount', pg: 'access_count,notnull,type:int,default:0'}
isset: true
- comment: 衰减率
name: DecayRate
type: float64
tags: {json: 'decayRate', pg: 'decay_rate,notnull,type:float,default:1.0'}
isset: true
- type: comm.MetaField
oidcat: event
specNs: convo
Expand Down
Loading
Loading