memory

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Store store.Store
	Type  string
}

func DefaultConfig

func DefaultConfig() *Config

type LongTerm

type LongTerm struct {
	Store store.Store
	Type  string
}

func (*LongTerm) Deinit

func (l *LongTerm) Deinit(ctx context.Context) error

func (*LongTerm) Init

func (l *LongTerm) Init(ctx context.Context) error

func (*LongTerm) Reset

func (l *LongTerm) Reset(ctx context.Context) error

func (*LongTerm) Save

func (l *LongTerm) Save(ctx context.Context, text string, meta map[string]interface{}, agent string) error

func (*LongTerm) Search

func (l *LongTerm) Search(ctx context.Context, query string, limit int32, threshold float32) ([]interface{}, error)

type Memory

type Memory interface {
	Init(context.Context) error
	Deinit(context.Context) error
	Reset(context.Context) error
	Save(context.Context, string, map[string]interface{}, string) error
	Search(context.Context, string, int32, float32) ([]interface{}, error)
}

func New

func New(_ context.Context, cfg *Config) Memory

type ShortTerm

type ShortTerm struct {
	Store store.Store
	Type  string
}

func (*ShortTerm) Deinit

func (s *ShortTerm) Deinit(ctx context.Context) error

func (*ShortTerm) Init

func (s *ShortTerm) Init(ctx context.Context) error

func (*ShortTerm) Reset

func (s *ShortTerm) Reset(ctx context.Context) error

func (*ShortTerm) Save

func (s *ShortTerm) Save(ctx context.Context, text string, meta map[string]interface{}, agent string) error

func (*ShortTerm) Search

func (s *ShortTerm) Search(ctx context.Context, query string, limit int32, threshold float32) ([]interface{}, error)

Jump to

Keyboard shortcuts

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