mem

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MemoryTools

func MemoryTools(opts MemoryToolOptions) []types.Tool

func RunIngestLoop

func RunIngestLoop(ctx context.Context, opts IngestLoopOptions)

func SharedSQLiteManager

func SharedSQLiteManager(persistDir, sqliteFile string) (memkit.Manager, error)

Types

type IngestContentFilter

type IngestContentFilter struct {
	TrivialPhrases      []string
	MinContentLength    int
	EnableContentFilter bool
}

type IngestExtractItem

type IngestExtractItem struct {
	Content  string   `json:"content"`
	Category string   `json:"category"`
	Tags     []string `json:"tags"`
}

func ParseIngestItemsTab

func ParseIngestItemsTab(s string) ([]IngestExtractItem, error)

type IngestLoopOptions

type IngestLoopOptions struct {
	WaitReady   func(ctx context.Context) error
	StartParams func() (persistDir, sqliteFile string, interval time.Duration, err error)
	TickParams  func() (enabled bool, batchMax, minNew int, rt IngestRuntime)
	Log         *slog.Logger
	NewLLM      func(ctx context.Context, rt IngestRuntime) (types.LLMProvider, error)
}

type IngestRule

type IngestRule struct {
	Name            string
	Action          string
	MaxTotalChars   int
	MinTotalChars   int
	PhrasesAny      []string
	MaxUserMessages int
}

type IngestRuntime

type IngestRuntime struct {
	Rules         []IngestRule
	SystemExtra   string
	ContentFilter IngestContentFilter
}

type MemoryToolOptions

type MemoryToolOptions struct {
	SessionID         string
	PersistDir        string
	SQLiteFile        string
	Log               *slog.Logger
	ToolName          string
	WriteKnowledgeTag string
	Description       string
	OmitTimeTool      bool
}

Jump to

Keyboard shortcuts

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