-
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_search tool that allows the LLM to search Ghost's persistent memory using hybrid retrieval. Follows the same tool.Tool interface pattern as search.go.
Details
New files:
internal/tool/memory_search.gointernal/tool/memory_search_test.go
Type:
type MemorySearch struct {
Store *memory.Store
}Tool definition:
- Name:
memory_search - Description:
"search your persistent memory for relevant information from past conversations and saved knowledge" - Parameters:
query(string, required): the search querymax_results(integer, optional): maximum results to return (default 5)
Execute:
- Parse args JSON (same pattern as
search.go) - Call
Store.Search(ctx, query, maxResults) - Format results:
Memory Result 1: [source: daily/2026-02-07.md] <chunk content> Memory Result 2: [source: MEMORY.md] <chunk content>
Errors:
ErrMemorySearchArgs— failed to parse argumentsErrMemorySearchFail— search operation failed
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()) - Returns formatted search results with source attribution
- Defaults to 5 results when max_results not specified
- Handles empty results gracefully
- Proper error handling for invalid args and search failures
- Table-driven tests pass
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Projects
Status
Backlog