(cfg config.Config, baseRegistry *coretools.ToolRegistry, extractionConfig ...ExtractionConfig)
| 63 | } |
| 64 | return &ExtractionController{Config: cfg, ExtractionConfig: ec} |
| 65 | } |
| 66 | |
| 67 | func (c *ExtractionController) ShouldExtract(state *AgentState) bool { |
| 68 | return state != nil && c.Config.LongTermMemoryEnabled && isFabricMemoryBackend(c.Config) && |
| 69 | c.Engine != nil && state.MemoryExtractionCursor < len(state.Messages) |
| 70 | } |
| 71 | |
| 72 | func (c *ExtractionController) Schedule(_ context.Context, state *AgentState, _ string) bool { |
| 73 | if !c.ShouldExtract(state) { |
| 74 | return false |