memory_summarizer

package
v1.306.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartSummarizeDraftsSession

func StartSummarizeDraftsSession(
	ctx context.Context,
	sessionManager portrepos.SessionManager,
	sourceSessionID string,
	scope entities.ResourceScope,
	teamID string,
	ownerID string,
) error

StartSummarizeDraftsSession starts a oneshot summarize-drafts session for the given source session. It performs a deduplication check before creating the session to avoid running multiple summarize sessions for the same source session concurrently.

Types

type Worker

type Worker struct {
	// contains filtered or unexported fields
}

Worker periodically lists all draft memories and starts summarize-drafts sessions for those whose source session no longer exists.

func NewWorker

func NewWorker(
	memoryRepo portrepos.MemoryRepository,
	sessionManager portrepos.SessionManager,
	config WorkerConfig,
) *Worker

NewWorker creates a new memory draft summarizer Worker.

func (*Worker) Start

func (w *Worker) Start(ctx context.Context) error

Start begins the worker loop. It is safe to call from multiple goroutines.

func (*Worker) Stop

func (w *Worker) Stop()

Stop gracefully stops the worker.

type WorkerConfig

type WorkerConfig struct {
	// CheckInterval is how often the worker scans for orphaned draft memories.
	// Default: 5m
	CheckInterval time.Duration
	// Enabled controls whether the worker actually runs.
	Enabled bool
}

WorkerConfig holds configuration for the memory draft summarizer worker.

func DefaultWorkerConfig

func DefaultWorkerConfig() WorkerConfig

DefaultWorkerConfig returns the default worker configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL