feat: run memory extraction in the background

This commit is contained in:
Acbox
2026-02-15 14:15:55 +08:00
parent 641a5c2d71
commit 3d575e031e
+3 -1
View File
@@ -778,7 +778,9 @@ func (r *Resolver) storeRound(ctx context.Context, req conversation.ChatRequest,
}
r.storeMessages(ctx, req, fullRound)
r.storeMemory(ctx, req.BotID, fullRound)
// Run memory extraction in the background so that the SSE stream can
// finish immediately after messages are persisted.
go r.storeMemory(context.WithoutCancel(ctx), req.BotID, fullRound)
return nil
}