feat(memory): 长记忆 store(SQLite+persona 隔离)/工作记忆滑动窗口/检索注入/手工提取钩子

This commit is contained in:
Aska committed 2026-09-06 05:12:42 +08:00
1 parent 285e1e9911
commit aa697c385f
10 files changed
+1705

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
package memory
import (
"strings"
"git.yeij.top/AskaEth/Cyrene_v2/internal/runtime/model"
)
// messageText returns the concatenated plain-text payload of a message. Image
// parts are skipped; text parts are joined with a single space. It is the
// shared text view used by the working-memory summary and the manual extractor.
func messageText(m model.Message) string {
var b strings.Builder
for _, part := range m.Content {
if part.Type != model.ContentTypeText {
continue
}
if b.Len() > 0 {
b.WriteByte(' ')
}
b.WriteString(part.Text)
}
return b.String()
}