@@ -16,32 +16,38 @@ import (
1616
1717// Config controls the Extended Memory subsystem.
1818type Config struct {
19- Enabled * bool `json:"enabled,omitempty"`
20- MaxSizeMB int `json:"max_size_mb,omitempty"`
21- SemanticSearchTopK int `json:"semantic_search_top_k,omitempty"`
22- SemanticSearchOverfetch int `json:"semantic_search_overfetch,omitempty"`
23- SemanticSearchMinScore float32 `json:"semantic_search_min_score,omitempty"`
24- SemanticSearchRerank * bool `json:"semantic_search_rerank,omitempty"`
25- AtomMaxChars int `json:"atom_max_chars,omitempty"`
26- MemoryBudgetChars int `json:"memory_budget_chars,omitempty"`
27- DecayHalfLifeDays int `json:"decay_half_life_days,omitempty"`
28- QuarantineTTLDays int `json:"quarantine_ttl_days,omitempty"`
29- EvictionPolicy string `json:"eviction_policy,omitempty"`
30- PredictiveIntents int `json:"predictive_intents,omitempty"`
31- AutoExtractPerTurn * bool `json:"auto_extract_per_turn,omitempty"`
32- InferUserState * bool `json:"infer_user_state,omitempty"`
33- UserStateTurnInterval int `json:"user_state_turn_interval,omitempty"`
34- UserStateMaxPending int `json:"user_state_max_pending,omitempty"`
35- AssociationsEnabled * bool `json:"associations_enabled,omitempty"`
36- AssociationSemanticTopK int `json:"association_semantic_top_k,omitempty"`
37- SemanticDedupThreshold * float32 `json:"semantic_dedup_threshold,omitempty"`
38- ConsolidateSimilarityThreshold float32 `json:"consolidate_similarity_threshold,omitempty"`
39- ProactiveReturnAfterBreak * bool `json:"proactive_return_after_break,omitempty"`
40- StyleMirroringEnabled * bool `json:"style_mirroring_enabled,omitempty"`
41- AnaphoraResolutionEnabled * bool `json:"anaphora_resolution_enabled,omitempty"`
42- FollowUpAnticipationEnabled * bool `json:"follow_up_anticipation_enabled,omitempty"`
43- LLM * LLMConfig `json:"llm,omitempty"`
44- Embedding * embedding.Config `json:"embedding,omitempty"`
19+ Enabled * bool `json:"enabled,omitempty"`
20+ MaxSizeMB int `json:"max_size_mb,omitempty"`
21+ SemanticSearchTopK int `json:"semantic_search_top_k,omitempty"`
22+ SemanticSearchOverfetch int `json:"semantic_search_overfetch,omitempty"`
23+ SemanticSearchMinScore float32 `json:"semantic_search_min_score,omitempty"`
24+ SemanticSearchRerank * bool `json:"semantic_search_rerank,omitempty"`
25+ AtomMaxChars int `json:"atom_max_chars,omitempty"`
26+ MemoryBudgetChars int `json:"memory_budget_chars,omitempty"`
27+ DecayHalfLifeDays int `json:"decay_half_life_days,omitempty"`
28+ QuarantineTTLDays int `json:"quarantine_ttl_days,omitempty"`
29+ EvictionPolicy string `json:"eviction_policy,omitempty"`
30+ PredictiveIntents int `json:"predictive_intents,omitempty"`
31+ AutoExtractPerTurn * bool `json:"auto_extract_per_turn,omitempty"`
32+ InferUserState * bool `json:"infer_user_state,omitempty"`
33+ UserStateTurnInterval int `json:"user_state_turn_interval,omitempty"`
34+ UserStateMaxPending int `json:"user_state_max_pending,omitempty"`
35+ AssociationsEnabled * bool `json:"associations_enabled,omitempty"`
36+ AssociationSemanticTopK int `json:"association_semantic_top_k,omitempty"`
37+ SemanticDedupThreshold * float32 `json:"semantic_dedup_threshold,omitempty"`
38+ ConsolidateSimilarityThreshold float32 `json:"consolidate_similarity_threshold,omitempty"`
39+ ProactiveReturnAfterBreak * bool `json:"proactive_return_after_break,omitempty"`
40+ StyleMirroringEnabled * bool `json:"style_mirroring_enabled,omitempty"`
41+ AnaphoraResolutionEnabled * bool `json:"anaphora_resolution_enabled,omitempty"`
42+ FollowUpAnticipationEnabled * bool `json:"follow_up_anticipation_enabled,omitempty"`
43+ FollowUpSuggestionsEnabled * bool `json:"follow_up_suggestions_enabled,omitempty"`
44+ FollowUpSuggestionMinConfidence float32 `json:"follow_up_suggestion_min_confidence,omitempty"`
45+ ProactiveNudgesEnabled * bool `json:"proactive_nudges_enabled,omitempty"`
46+ NudgeMaxPerDay int `json:"nudge_max_per_day,omitempty"`
47+ NudgeCooldownHours int `json:"nudge_cooldown_hours,omitempty"`
48+ NudgeStaleGoalDays int `json:"nudge_stale_goal_days,omitempty"`
49+ LLM * LLMConfig `json:"llm,omitempty"`
50+ Embedding * embedding.Config `json:"embedding,omitempty"`
4551}
4652
4753// LLMConfig selects a dedicated LLM for Extended Memory extraction and
@@ -66,30 +72,36 @@ func floatPtr(f float32) *float32 { return &f }
6672// Extended Memory is opt-in: Enabled defaults to false.
6773func DefaultConfig () Config {
6874 return Config {
69- Enabled : boolPtr (false ),
70- MaxSizeMB : 100 ,
71- SemanticSearchTopK : 10 ,
72- SemanticSearchOverfetch : 4 ,
73- SemanticSearchMinScore : 0.55 ,
74- SemanticSearchRerank : boolPtr (true ),
75- AtomMaxChars : 300 ,
76- MemoryBudgetChars : 2000 ,
77- DecayHalfLifeDays : 30 ,
78- QuarantineTTLDays : 7 ,
79- EvictionPolicy : "retention_decay" ,
80- PredictiveIntents : 3 ,
81- AutoExtractPerTurn : boolPtr (true ),
82- InferUserState : boolPtr (true ),
83- UserStateTurnInterval : 5 ,
84- UserStateMaxPending : 20 ,
85- AssociationsEnabled : boolPtr (true ),
86- AssociationSemanticTopK : 3 ,
87- SemanticDedupThreshold : floatPtr (0.92 ),
88- ConsolidateSimilarityThreshold : 0.9 ,
89- ProactiveReturnAfterBreak : boolPtr (true ),
90- StyleMirroringEnabled : boolPtr (true ),
91- AnaphoraResolutionEnabled : boolPtr (true ),
92- FollowUpAnticipationEnabled : boolPtr (true ),
75+ Enabled : boolPtr (false ),
76+ MaxSizeMB : 100 ,
77+ SemanticSearchTopK : 10 ,
78+ SemanticSearchOverfetch : 4 ,
79+ SemanticSearchMinScore : 0.55 ,
80+ SemanticSearchRerank : boolPtr (true ),
81+ AtomMaxChars : 300 ,
82+ MemoryBudgetChars : 2000 ,
83+ DecayHalfLifeDays : 30 ,
84+ QuarantineTTLDays : 7 ,
85+ EvictionPolicy : "retention_decay" ,
86+ PredictiveIntents : 3 ,
87+ AutoExtractPerTurn : boolPtr (true ),
88+ InferUserState : boolPtr (true ),
89+ UserStateTurnInterval : 5 ,
90+ UserStateMaxPending : 20 ,
91+ AssociationsEnabled : boolPtr (true ),
92+ AssociationSemanticTopK : 3 ,
93+ SemanticDedupThreshold : floatPtr (0.92 ),
94+ ConsolidateSimilarityThreshold : 0.9 ,
95+ ProactiveReturnAfterBreak : boolPtr (true ),
96+ StyleMirroringEnabled : boolPtr (true ),
97+ AnaphoraResolutionEnabled : boolPtr (true ),
98+ FollowUpAnticipationEnabled : boolPtr (true ),
99+ FollowUpSuggestionsEnabled : boolPtr (true ),
100+ FollowUpSuggestionMinConfidence : 0.6 ,
101+ ProactiveNudgesEnabled : boolPtr (false ), // opt-in: proactive features never fire uninvited
102+ NudgeMaxPerDay : 1 ,
103+ NudgeCooldownHours : 24 ,
104+ NudgeStaleGoalDays : 7 ,
93105 }
94106}
95107
@@ -168,6 +180,24 @@ func Resolve(cfg Config) Config {
168180 if cfg .FollowUpAnticipationEnabled != nil {
169181 def .FollowUpAnticipationEnabled = cfg .FollowUpAnticipationEnabled
170182 }
183+ if cfg .FollowUpSuggestionsEnabled != nil {
184+ def .FollowUpSuggestionsEnabled = cfg .FollowUpSuggestionsEnabled
185+ }
186+ if cfg .FollowUpSuggestionMinConfidence > 0 && cfg .FollowUpSuggestionMinConfidence <= 1 {
187+ def .FollowUpSuggestionMinConfidence = cfg .FollowUpSuggestionMinConfidence
188+ }
189+ if cfg .ProactiveNudgesEnabled != nil {
190+ def .ProactiveNudgesEnabled = cfg .ProactiveNudgesEnabled
191+ }
192+ if cfg .NudgeMaxPerDay > 0 {
193+ def .NudgeMaxPerDay = cfg .NudgeMaxPerDay
194+ }
195+ if cfg .NudgeCooldownHours > 0 {
196+ def .NudgeCooldownHours = cfg .NudgeCooldownHours
197+ }
198+ if cfg .NudgeStaleGoalDays > 0 {
199+ def .NudgeStaleGoalDays = cfg .NudgeStaleGoalDays
200+ }
171201 if cfg .LLM != nil {
172202 def .LLM = cfg .LLM
173203 }
0 commit comments