From 818fbffd666365fbca5af6e9fdbeee7fc7f58c2d Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sun, 21 Dec 2025 22:24:02 +0000 Subject: [PATCH] fix: increase MetricSamples to 24 points for hourly resolution 12 samples was too coarse (2-hour intervals could miss spikes). 24 samples gives ~hourly resolution while still being compact. --- internal/ai/context/builder.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/ai/context/builder.go b/internal/ai/context/builder.go index 5944486..e2e7b60 100644 --- a/internal/ai/context/builder.go +++ b/internal/ai/context/builder.go @@ -486,9 +486,9 @@ func (b *Builder) computeGuestMetricSamples(guestID string) map[string][]MetricP if len(points) < 3 { continue } - // Downsample to ~12 points (roughly every 2 hours over 24h) - // This gives the LLM a compact view of recent trends - sampled := DownsampleMetrics(points, 12) + // Downsample to ~24 points (roughly hourly over 24h) + // This gives the LLM good resolution to spot patterns and spikes + sampled := DownsampleMetrics(points, 24) if len(sampled) >= 3 { samples[metric] = sampled }