memory

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ScopeGlobal  = "global"
	ScopeProject = "project"
)
View Source
const Guidance = "You have two persistent memory scopes. Save user preferences and environment details to global memory; " +
	"save facts that only apply to the current project to project memory. Use the scope argument with the " + ToolName + " tool. " +
	"Save short, self-contained facts; don't save things obvious from the code, or secrets. " +
	"Don't re-save facts already in the selected memory."
View Source
const ToolName = "save_memory"

Variables

This section is empty.

Functions

func Add

func Add(dir, text string) (bool, error)

Stores a fact and reports false if it already exists.

func Content

func Content(dir, scope string) string

Renders the stored facts for the system prompt.

func Format

func Format(entries []string) string

Renders facts numbered as Remove expects.

func List

func List(dir string) []string

Returns the stored facts.

func Remove

func Remove(dir, query string) (string, error)

Deletes one fact selected by its 1-based number or a unique case-insensitive substring.

Types

type Tool

type Tool struct {
	GlobalDir  string
	ProjectDir string
}

func (Tool) Definition

func (t Tool) Definition() openai.ChatCompletionToolUnionParam

func (Tool) Execute

func (t Tool) Execute(_ context.Context, args map[string]any) (any, error)

func (Tool) Name

func (Tool) Name() string

Jump to

Keyboard shortcuts

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