memory

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteArgs added in v0.2.0

type DeleteArgs struct {
	ID int `json:"id"`
}

DeleteArgs are the arguments for the delete_memory tool.

type DeleteResult added in v0.2.0

type DeleteResult struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

DeleteResult is the result of the delete_memory tool.

type Entry

type Entry struct {
	ID        int    `json:"id"`
	Text      string `json:"text"`
	Author    string `json:"author"`
	Timestamp string `json:"timestamp"`
}

Entry represents a single memory entry returned by search.

type SaveArgs

type SaveArgs struct {
	Content  string `json:"content"`
	Category string `json:"category,omitempty"`
}

SaveArgs are the arguments for the save_to_memory tool.

type SaveResult

type SaveResult struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

SaveResult is the result of the save_to_memory tool.

type SearchArgs

type SearchArgs struct {
	Query string `json:"query"`
}

SearchArgs are the arguments for the search_memory tool.

type SearchResult

type SearchResult struct {
	Memories []Entry `json:"memories"`
	Count    int     `json:"count"`
}

SearchResult is the result of the search_memory tool.

type Toolset

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

Toolset provides tools for the agent to interact with long-term memory.

func NewToolset

func NewToolset(cfg ToolsetConfig) (*Toolset, error)

NewToolset creates a new toolset for memory operations.

func (*Toolset) Name

func (ts *Toolset) Name() string

Name returns the name of the toolset.

func (*Toolset) Tools

func (ts *Toolset) Tools(ctx agent.ReadonlyContext) ([]tool.Tool, error)

Tools returns the list of memory tools.

type ToolsetConfig

type ToolsetConfig struct {
	// MemoryService is the memory service to use (can be any implementation).
	// If it also implements memorytypes.ExtendedMemoryService, update and delete tools will be available.
	MemoryService memorytypes.MemoryService
	// AppName is used to scope memory operations
	AppName string
	// DisableExtendedTools prevents registration of update_memory and delete_memory
	// even when the MemoryService supports them.
	DisableExtendedTools bool
}

ToolsetConfig holds configuration for the memory toolset.

type UpdateArgs added in v0.2.0

type UpdateArgs struct {
	ID      int    `json:"id"`
	Content string `json:"content"`
}

UpdateArgs are the arguments for the update_memory tool.

type UpdateResult added in v0.2.0

type UpdateResult struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

UpdateResult is the result of the update_memory tool.

Jump to

Keyboard shortcuts

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