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 ¶
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 (t *UpdateProjectMemoryTool) Execute(_ context.Context, logger *slog.Logger, raw json.RawMessage) (tools.Result, error)
func (*UpdateProjectMemoryTool) Name ¶
func (t *UpdateProjectMemoryTool) Name() string
func (*UpdateProjectMemoryTool) Schema ¶
func (t *UpdateProjectMemoryTool) Schema() json.RawMessage
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 (t *UpdateUserProfileTool) Execute(_ context.Context, logger *slog.Logger, raw json.RawMessage) (tools.Result, error)
func (*UpdateUserProfileTool) Name ¶
func (t *UpdateUserProfileTool) Name() string
func (*UpdateUserProfileTool) Schema ¶
func (t *UpdateUserProfileTool) Schema() json.RawMessage