Help us shape the future of Go! Take the 2026 Go Developer Survey

simple

package
v0.35.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: AGPL-3.0 Imports: 13 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) AddConstraint

func (p *Provider) AddConstraint(ctx context.Context, userID string, agentID string, text string) ([]memory.ConstraintEntry, error)

AddConstraint implements memory.ConstraintStore.

func (*Provider) AdvanceSessionSnapshot

func (p *Provider) AdvanceSessionSnapshot(ctx context.Context, sessionID string, userID string, agentID string) error

AdvanceSessionSnapshot implements memory.SessionSnapshotStore.

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 string, agentID string) (string, error)

func (*Provider) GetAgentSoulAt

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

GetAgentSoulAt implements memory.VersionedProfileStore.

func (*Provider) GetConstraints

func (p *Provider) GetConstraints(ctx context.Context, userID string, agentID string) ([]memory.ConstraintEntry, error)

GetConstraints implements memory.ConstraintStore.

func (*Provider) GetConstraintsAt

func (p *Provider) GetConstraintsAt(ctx context.Context, userID string, agentID string, version int64) ([]memory.ConstraintEntry, error)

GetConstraintsAt implements memory.VersionedConstraintStore.

func (*Provider) GetOrCreateSessionSnapshot

func (p *Provider) GetOrCreateSessionSnapshot(ctx context.Context, sessionID string, userID string, agentID string) (memory.SessionSnapshot, error)

GetOrCreateSessionSnapshot implements memory.SessionSnapshotStore.

func (*Provider) GetProfile

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

func (*Provider) GetProfileAt

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

GetProfileAt implements memory.VersionedProfileStore.

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) ReadChangelog

func (p *Provider) ReadChangelog(ctx context.Context, userID string, agentID string, scope string, limit int) ([]memory.ChangeEntry, error)

ReadChangelog implements memory.ChangelogReader.

func (*Provider) RemoveConstraint

func (p *Provider) RemoveConstraint(ctx context.Context, userID string, agentID string, id string) ([]memory.ConstraintEntry, error)

RemoveConstraint implements memory.ConstraintStore.

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 string, agentID string, content string) error

func (*Provider) SetProfile

func (p *Provider) SetProfile(ctx context.Context, userID string, 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.

func (*Provider) WriteChangelog

func (p *Provider) WriteChangelog(ctx context.Context, entry memory.ChangeEntry) error

WriteChangelog implements memory.ChangelogWriter.

Jump to

Keyboard shortcuts

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