From 49fc86c70bc671d834fc5ef6cee3780e1b4e4c4b Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sun, 21 Dec 2025 22:25:54 +0000 Subject: [PATCH] feat: increase MetricSamples to 100 points (~15 min resolution) Modern LLMs have 100k+ token contexts. 100 samples over 24h gives ~15 minute resolution while adding minimal token overhead. This lets the LLM see fine-grained patterns, short spikes, and accurately distinguish anomalies from normal behavior. --- 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 e2e7b60..1be2fc1 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 ~24 points (roughly hourly over 24h) - // This gives the LLM good resolution to spot patterns and spikes - sampled := DownsampleMetrics(points, 24) + // Downsample to ~100 points (~15 min resolution over 24h) + // Modern LLMs have 100k+ token contexts - we can afford detailed history + sampled := DownsampleMetrics(points, 100) if len(sampled) >= 3 { samples[metric] = sampled }