MCPcopy Create free account
hub / github.com/astercloud/aster / NewManager

Function NewManager

pkg/memory/logic/manager.go:48–70  ·  view source on GitHub ↗

NewManager 创建 Logic Memory Manager

(config *ManagerConfig)

Source from the content-addressed store, hash-verified

46
47// NewManager 创建 Logic Memory Manager
48func NewManager(config *ManagerConfig) (*Manager, error) {
49 if config == nil {
50 return nil, errors.New("config is required")
51 }
52
53 if config.Store == nil {
54 return nil, errors.New("store is required")
55 }
56
57 // 设置默认值
58 if config.ConsolidationThreshold == 0 {
59 config.ConsolidationThreshold = 0.85
60 }
61 if config.ConfidenceBoost == 0 {
62 config.ConfidenceBoost = 0.05
63 }
64
65 return &Manager{
66 store: config.Store,
67 matchers: config.Matchers,
68 config: config,
69 }, nil
70}
71
72// RecordMemory 主动记录 Memory(应用层手动调用)
73func (m *Manager) RecordMemory(ctx context.Context, memory *LogicMemory) error {

Calls

no outgoing calls