memory

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 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 Entry

type Entry struct {
	// Text is the content of the memory
	Text string `json:"text"`
	// Author is who created this memory (user or agent)
	Author string `json:"author"`
	// Timestamp is when this memory was created
	Timestamp string `json:"timestamp"`
}

Entry represents a single memory entry returned by search.

type MemoryService

type MemoryService interface {
	AddSession(ctx context.Context, s session.Session) error
	Search(ctx context.Context, req *memory.SearchRequest) (*memory.SearchResponse, error)
}

MemoryService defines the interface for a memory backend. This matches google.golang.org/adk/memory.Service

type SaveArgs

type SaveArgs struct {
	// Content is the information to save to memory
	Content string `json:"content"`
	// Category is an optional category for the memory (e.g., 'preference', 'fact', 'reminder')
	Category string `json:"category,omitempty"`
}

SaveArgs are the arguments for the save_to_memory tool.

type SaveResult

type SaveResult struct {
	// Success indicates if the save was successful
	Success bool `json:"success"`
	// Message provides additional information
	Message string `json:"message"`
}

SaveResult is the result of the save_to_memory tool.

type SearchArgs

type SearchArgs struct {
	// Query is the search query to find relevant memories
	Query string `json:"query"`
}

SearchArgs are the arguments for the search_memory tool.

type SearchResult

type SearchResult struct {
	// Memories contains the found memories
	Memories []Entry `json:"memories"`
	// Count is the number of memories found
	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)
	MemoryService MemoryService
	// AppName is used to scope memory operations
	AppName string
}

ToolsetConfig holds configuration for the memory toolset.

Jump to

Keyboard shortcuts

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