memory

package
v0.2.8-alpha.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package memory hosts the auto-memory tools: update_user_profile and update_project_memory. They are the write counterparts to the read helpers in internal/memdir. The tools merge structured section updates into fixed markdown shapes:

  • <APP_HOME>/USER_PROFILE.md global user notes
  • <APP_HOME>/projects/<key>/MEMORY.md project-scoped notes

The schemas constrain the section keys so updates always land in a known shape — the model cannot accidentally create new section names or clobber unrelated content. Anything not provided in `sections` is preserved verbatim by memdir.MergeSections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Names

func Names() []tools.ToolName

Names lists every tool this package contributes.

Types

type MemoryDiff

type MemoryDiff struct {
	Path            string   // absolute path of the file that was written
	SectionsUpdated []string // headings whose bodies were replaced this call
	WasCreated      bool     // true when the file did not exist before this call
}

MemoryDiff is the UI-facing metadata carried on the tool Result. It mirrors the spirit of fs.FileDiff but stays in this package to avoid dragging the fs diff renderer into a tool that does not produce a line-level patch.

type UpdateProjectMemoryTool

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

UpdateProjectMemoryTool implements the update_project_memory tool.

func NewUpdateProjectMemory

func NewUpdateProjectMemory(cfg *config.Config, workdir string) *UpdateProjectMemoryTool

NewUpdateProjectMemory constructs the tool. workdir is captured at agent construction so the project key is stable across the session even if the user runs `cd` from a tool call.

func (*UpdateProjectMemoryTool) Description

func (t *UpdateProjectMemoryTool) Description() string

func (*UpdateProjectMemoryTool) Execute

func (*UpdateProjectMemoryTool) Name

func (t *UpdateProjectMemoryTool) Name() string

func (*UpdateProjectMemoryTool) Schema

type UpdateUserProfileTool

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

UpdateUserProfileTool implements the update_user_profile tool.

func NewUpdateUserProfile

func NewUpdateUserProfile(cfg *config.Config) *UpdateUserProfileTool

NewUpdateUserProfile constructs the tool. cfg may be nil in tests; in that case the tool reports a config-missing error at Execute time.

func (*UpdateUserProfileTool) Description

func (t *UpdateUserProfileTool) Description() string

func (*UpdateUserProfileTool) Execute

func (*UpdateUserProfileTool) Name

func (t *UpdateUserProfileTool) Name() string

func (*UpdateUserProfileTool) Schema

Jump to

Keyboard shortcuts

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