mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-18 02:27:30 +08:00
prioritize startup memory context to today+yesterday notes before long-term
This commit is contained in:
@@ -143,18 +143,18 @@ func (ms *MemoryStore) GetRecentDailyNotes(days int) string {
|
|||||||
func (ms *MemoryStore) GetMemoryContext() string {
|
func (ms *MemoryStore) GetMemoryContext() string {
|
||||||
var parts []string
|
var parts []string
|
||||||
|
|
||||||
|
// Recent daily notes first (today + yesterday), to prioritize fresh context
|
||||||
|
recentNotes := ms.GetRecentDailyNotes(2)
|
||||||
|
if recentNotes != "" {
|
||||||
|
parts = append(parts, "## Recent Daily Notes\n\n"+recentNotes)
|
||||||
|
}
|
||||||
|
|
||||||
// Long-term memory
|
// Long-term memory
|
||||||
longTerm := ms.ReadLongTerm()
|
longTerm := ms.ReadLongTerm()
|
||||||
if longTerm != "" {
|
if longTerm != "" {
|
||||||
parts = append(parts, "## Long-term Memory\n\n"+longTerm)
|
parts = append(parts, "## Long-term Memory\n\n"+longTerm)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recent daily notes (last 3 days)
|
|
||||||
recentNotes := ms.GetRecentDailyNotes(3)
|
|
||||||
if recentNotes != "" {
|
|
||||||
parts = append(parts, "## Recent Daily Notes\n\n"+recentNotes)
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(parts) == 0 {
|
if len(parts) == 0 {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user