memory

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package memory exposes Leros built-in memory as a runtime tool.

Index

Constants

View Source
const (
	// ToolNameMemory is the stable runtime tool name for built-in memory.
	ToolNameMemory = "memory"
)

Variables

This section is empty.

Functions

func NewTools

func NewTools() []tools.Tool

NewTools returns all built-in memory tools.

func Register

func Register(registry *tools.Registry) error

Register adds built-in memory tools to the runtime registry.

func RegisterWithStore added in v0.1.17

func RegisterWithStore(registry *tools.Registry, store *localmemory.Store) error

RegisterWithStore adds memory tools backed by the injected store.

Types

type Tool

type Tool struct {
	tools.BaseTool
	// contains filtered or unexported fields
}

Tool lets the agent manage built-in USER.md and MEMORY.md files.

func NewTool

func NewTool() *Tool

NewTool creates the built-in memory tool with the default local store.

func NewToolWithStore

func NewToolWithStore(store *localmemory.Store) *Tool

NewToolWithStore creates the built-in memory tool with an explicit store.

func (*Tool) Execute

func (t *Tool) Execute(ctx context.Context, raw json.RawMessage) (string, error)

Execute performs the memory operation.

func (*Tool) Validate

func (t *Tool) Validate(raw json.RawMessage) error

Validate checks memory tool input before execution.

Jump to

Keyboard shortcuts

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