Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine handles memory recall operations
func NewEngine ¶
func NewEngine(memoryService *memory.Service, evidenceService *evidence.Service, cfg *config.Config, logger *zap.Logger, db *sql.DB) *Engine
NewEngine creates a new recall engine
func (*Engine) Close ¶
func (e *Engine) Close()
Close gracefully shuts down the engine and its resources.
func (*Engine) Recall ¶
func (e *Engine) Recall(options RecallOptions) ([]RecallResult, error)
Recall performs memory recall based on the query
type MetricsWriter ¶
type MetricsWriter struct {
// contains filtered or unexported fields
}
MetricsWriter handles async writing of recall metrics to the database.
func NewMetricsWriter ¶
func NewMetricsWriter(db *sql.DB, logger *zap.Logger) *MetricsWriter
NewMetricsWriter creates a new async metrics writer. Pass nil for db to disable metrics writing.
func (*MetricsWriter) Close ¶
func (mw *MetricsWriter) Close()
Close gracefully shuts down the metrics writer, flushing pending writes.
func (*MetricsWriter) Write ¶
func (mw *MetricsWriter) Write(metric RecallMetric)
Write queues a metric for async writing. Non-blocking; drops if buffer full.
type RecallMetric ¶
type RecallMetric struct {
ProjectID string
Query string
QueryType string // "empty" or "search"
MemoryIDs []int64
MemoryCount int
TotalTokens int
TierBreakdown TierStats
DurationMs int64
CreatedAt time.Time
}
RecallMetric represents a single recall operation's metrics.
type RecallOptions ¶
type RecallOptions struct {
ProjectID string
Query string
MaxItems int
MaxTokens int
Types []memory.Type
ExcludeSuperseded bool
}
RecallOptions specifies options for the recall operation
type RecallResult ¶
RecallResult represents a recalled memory with relevance score
type Recaller ¶
type Recaller interface {
Recall(options RecallOptions) ([]RecallResult, error)
Close()
}
Recaller defines the interface for memory recall engines.