Skip to main content

Analysis Agent

Purpose

A Pearson correlation coefficient is a statistical measure; it becomes useful only when interpreted in context. The Analysis Agent translates computed correlation results into plain-language observations and actionable recommendations, classifying relationship strength, identifying cascade effects, and producing up to three prioritized next steps.

Value Proposition

  • Accessible interpretation -- translates statistical coefficients into observations that inform decisions
  • Cascade detection -- identifies chain effects (e.g., stress -> sleep -> energy) that reveal high-leverage intervention points
  • Bounded output -- limits insights and recommendations to three each, maintaining focus and avoiding information overload
  • Directional clarity -- distinguishes positive correlation (co-movement) from negative correlation (inverse relationship) with appropriate context

Interpretation Scale

Coefficient (r)ClassificationTypical Interpretation
0.7 to 1.0Strong positiveMetrics move together consistently
0.4 to 0.7Moderate positiveNotable co-movement pattern
0.0 to 0.4Weak positiveLimited relationship
-0.4 to 0.0Weak negativeSlight inverse tendency
-0.7 to -0.4Moderate negativeNotable inverse co-movement
-1.0 to -0.7Strong negativeStrongly inverse -- improving one metric likely benefits the other

Example

Input:

{
"correlations": [
{ "pair": ["stress_level", "sleep_quality"], "coefficient": -0.82 },
{ "pair": ["energy", "sleep_quality"], "coefficient": 0.71 }
]
}

Output:

{
"summary": "Strong negative correlation (r=-0.82) between stress and sleep quality indicates that elevated stress significantly disrupts sleep. Energy shows strong positive correlation (r=0.71) with sleep quality.",
"insights": [
"Elevated stress days consistently correspond to reduced sleep quality",
"Improved sleep is a strong predictor of higher energy the following day",
"Addressing stress may produce cascading benefits: reduced stress -> improved sleep -> higher energy"
],
"nextSteps": [
"Monitor the impact of stress management interventions on sleep quality",
"Prioritize sleep hygiene practices during high-stress periods",
"Track energy levels as sleep quality improves to validate the cascade hypothesis"
]
}

The third insight identifies a cascade effect -- stress, sleep, and energy form a chain where addressing the upstream factor (stress) produces downstream benefits across multiple metrics.


Technical Reference

Identifiers

PropertyValue
Registry IDreasoning-engine-correlation-analysis-agent
Profile IDcorrelation-tool-analysis
Codesrc/mastra/agents/reasoning-engine/correlation/analysis.ts
AccessorgetCorrelationAnalysisAgent()

Output Schema

{
"summary": "string - Concise interpretation of correlation results",
"insights": ["string[]? - Up to 3 key observations"],
"nextSteps": ["string[]? - Up to 3 actionable recommendations"]
}

Default Prompt

"You are the analysis agent for the reasoning-engine multi-factor correlation tool. You receive the original request, the normalized datasets, and the computed correlations. Your goal is to draw a conclusion, highlight signals, and outline actionable next steps. Return only JSON structured as { summary: string, insights?: string[], nextSteps?: string[] }. Keep the summary concise, mention whether correlations suggest alignment or divergence, and highlight at most three insights or actions."

Configuration

Update the prompt via Admin tools, SQL, or API targeting the correlation-tool-analysis profile.


Next Steps