Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | 1x 1x 3x 3x 3x 3x 3x 3x 3x 3x | import { getPinnedInsights } from '@/lib/evolution/history.pins';
export function generateAISummary() {
const pins = getPinnedInsights();
if (!pins.length) return 'No pinned insights available for analysis.';
const total = pins.length;
const reformCount = pins.filter((p) => p.trend === 'Reform').length;
const integrateCount = pins.filter((p) => p.trend === 'Integrate').length;
const resetCount = pins.filter((p) => p.trend === 'Reset').length;
const avgConfidence = pins.reduce((sum, p) => sum + (p.confidence || 0), 0) / total;
const dominantTrend =
reformCount >= integrateCount && reformCount >= resetCount
? 'Reform'
: integrateCount >= resetCount
? 'Integrate'
: 'Reset';
let summary = `š§ **AI Predictive Summary**
Total Insights: ${total}
Average Confidence: ${(avgConfidence * 100).toFixed(1)}%
Dominant Trend: ${dominantTrend}`;
if (dominantTrend === 'Reform')
summary += `\nā The system exhibits adaptive restructuring patterns. Stability maintained with moderate confidence.`;
if (dominantTrend === 'Integrate')
summary += `\nā Integration signals are increasing ā potential system unification detected.`;
if (dominantTrend === 'Reset')
summary += `\nā System reset phase indicators present. Evaluate consistency and recovery cycle.`;
return summary;
}
|