simple

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider implements a minimal sliding-window memory provider. It stores messages in the same schema as LCM but does not write summaries or context items. Assemble returns the last N messages that fit within the token budget.

func New

func New(db *sql.DB) *Provider

New creates a new simple provider backed by the given database.

func (*Provider) Append

func (p *Provider) Append(ctx context.Context, session memory.Session, msgs ...ai.Message) error

Append implements memory.Provider.

func (*Provider) Assemble

func (p *Provider) Assemble(ctx context.Context, session memory.Session, budget, freshTail int) ([]ai.Message, error)

Assemble implements memory.Provider. Returns the last N messages that fit within budget, always honouring freshTail.

func (*Provider) Bootstrap

func (p *Provider) Bootstrap(ctx context.Context, session memory.Session) error

Bootstrap implements memory.Provider.

func (*Provider) Close

func (p *Provider) Close() error

Close implements memory.Provider.

func (*Provider) GetAgentSoul

func (p *Provider) GetAgentSoul(ctx context.Context, userID int64, agentID string) (string, error)

func (*Provider) GetProfile

func (p *Provider) GetProfile(ctx context.Context, userID int64, agentID string) (string, error)

func (*Provider) ListInfo

func (p *Provider) ListInfo(ctx context.Context, opts memory.ListOptions) ([]memory.SessionInfo, error)

ListInfo implements memory.SessionManager.

func (*Provider) LoadHistory

func (p *Provider) LoadHistory(ctx context.Context, sessionID string) ([]ai.Message, error)

LoadHistory implements memory.SessionManager.

func (*Provider) LoadInfo

func (p *Provider) LoadInfo(ctx context.Context, sessionID string) (memory.SessionInfo, error)

LoadInfo implements memory.SessionManager.

func (*Provider) Name

func (p *Provider) Name() string

Name implements memory.Provider.

func (*Provider) SaveInfo

func (p *Provider) SaveInfo(ctx context.Context, info memory.SessionInfo) error

SaveInfo implements memory.SessionManager.

func (*Provider) SetAgentSoul

func (p *Provider) SetAgentSoul(ctx context.Context, userID int64, agentID string, content string) error

func (*Provider) SetProfile

func (p *Provider) SetProfile(ctx context.Context, userID int64, agentID string, content string) error

func (*Provider) Stats

func (p *Provider) Stats(ctx context.Context, session memory.Session) (memory.SessionStats, error)

Stats implements memory.Provider.

Jump to

Keyboard shortcuts

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