memorytools

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	ID         string            `json:"id"`
	Content    string            `json:"content"`
	Tags       []string          `json:"tags"`
	Importance float64           `json:"importance"`
	SessionID  string            `json:"session_id,omitempty"`
	CreatedAt  time.Time         `json:"created_at"`
	UpdatedAt  time.Time         `json:"updated_at"`
	Metadata   map[string]string `json:"metadata,omitempty"`
}

Entry is a single unit of agent-managed memory.

type ForgetTool

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

func NewForgetTool

func NewForgetTool(store Store) *ForgetTool

func (*ForgetTool) Description

func (t *ForgetTool) Description() string

func (*ForgetTool) Execute

func (t *ForgetTool) Execute(ctx context.Context, args json.RawMessage) (json.RawMessage, error)

func (*ForgetTool) Name

func (t *ForgetTool) Name() string

func (*ForgetTool) Schema

func (t *ForgetTool) Schema() json.RawMessage

func (ForgetTool) Spec

func (t ForgetTool) Spec() toolmeta.OperationSpec

func (*ForgetTool) Timeout

func (t *ForgetTool) Timeout() time.Duration

type ImportanceUpdater

type ImportanceUpdater interface {
	UpdateImportance(ctx context.Context, id string, importance float64) error
}

type RetrieveTool

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

func NewRetrieveTool

func NewRetrieveTool(store Store) *RetrieveTool

func (*RetrieveTool) Description

func (t *RetrieveTool) Description() string

func (*RetrieveTool) Execute

func (t *RetrieveTool) Execute(ctx context.Context, args json.RawMessage) (json.RawMessage, error)

func (*RetrieveTool) Name

func (t *RetrieveTool) Name() string

func (*RetrieveTool) Schema

func (t *RetrieveTool) Schema() json.RawMessage

func (RetrieveTool) Spec

func (t RetrieveTool) Spec() toolmeta.OperationSpec

func (*RetrieveTool) Timeout

func (t *RetrieveTool) Timeout() time.Duration

type Store

type Store interface {
	Store(ctx context.Context, entry Entry) error
	Retrieve(ctx context.Context, query string, limit int) ([]Entry, error)
	Update(ctx context.Context, id string, content string) error
	Forget(ctx context.Context, id string) error
}

Store abstracts the storage backend for agent-controlled memory tool calls.

type StoreTool

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

func NewStoreTool

func NewStoreTool(store Store) *StoreTool

func (*StoreTool) Description

func (t *StoreTool) Description() string

func (*StoreTool) Execute

func (t *StoreTool) Execute(ctx context.Context, args json.RawMessage) (json.RawMessage, error)

func (*StoreTool) Name

func (t *StoreTool) Name() string

func (*StoreTool) Schema

func (t *StoreTool) Schema() json.RawMessage

func (StoreTool) Spec

func (t StoreTool) Spec() toolmeta.OperationSpec

func (*StoreTool) Timeout

func (t *StoreTool) Timeout() time.Duration

type SummarizeTool

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

func NewSummarizeTool

func NewSummarizeTool(store Store) *SummarizeTool

func (*SummarizeTool) Description

func (t *SummarizeTool) Description() string

func (*SummarizeTool) Execute

func (t *SummarizeTool) Execute(ctx context.Context, args json.RawMessage) (json.RawMessage, error)

func (*SummarizeTool) Name

func (t *SummarizeTool) Name() string

func (*SummarizeTool) Schema

func (t *SummarizeTool) Schema() json.RawMessage

func (SummarizeTool) Spec

func (t SummarizeTool) Spec() toolmeta.OperationSpec

func (*SummarizeTool) Timeout

func (t *SummarizeTool) Timeout() time.Duration

type UpdateTool

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

func NewUpdateTool

func NewUpdateTool(store Store) *UpdateTool

func (*UpdateTool) Description

func (t *UpdateTool) Description() string

func (*UpdateTool) Execute

func (t *UpdateTool) Execute(ctx context.Context, args json.RawMessage) (json.RawMessage, error)

func (*UpdateTool) Name

func (t *UpdateTool) Name() string

func (*UpdateTool) Schema

func (t *UpdateTool) Schema() json.RawMessage

func (UpdateTool) Spec

func (t UpdateTool) Spec() toolmeta.OperationSpec

func (*UpdateTool) Timeout

func (t *UpdateTool) Timeout() time.Duration

Jump to

Keyboard shortcuts

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