-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Summary
Add a memory_save tool that allows the LLM to persist important information to Ghost's memory system. Follows the same tool.Tool interface pattern as search.go.
Details
New files:
internal/tool/memory_save.gointernal/tool/memory_save_test.go
Type:
type MemorySave struct {
Store *memory.Store
}Tool definition:
- Name:
memory_save - Description:
"save important information to persistent memory for future reference" - Parameters:
content(string, required): the information to savetarget(string, optional):"daily"(default) or"long_term"
Execute:
- Parse args JSON (same pattern as
search.go) - Route to
Store.SaveToDaily()orStore.SaveToLongTerm()based on target - Return confirmation:
"Saved to daily log (2026-02-07.md)"or"Saved to long-term memory (MEMORY.md)"
Errors:
ErrMemorySaveArgs— failed to parse argumentsErrMemorySaveFail— save operation failedErrInvalidTarget— target not "daily" or "long_term"
Testing:
- Table-driven tests following
search_test.gopattern - Use real
memory.Storewith temp dir and mockEmbedFunc
Note: This tool is not registered in the registry yet — that happens in the integration issue.
Dependencies
- Add memory storage engine #236 (memory storage engine)
Acceptance Criteria
- Implements
tool.Toolinterface (Definition()+Execute()) - Saves to daily log by default
- Saves to MEMORY.md when target is "long_term"
- Returns clear confirmation message
- Proper error handling for invalid args and save failures
- Table-driven tests pass
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Projects
Status
Backlog