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) | Classification | Typical Interpretation |
|---|---|---|
| 0.7 to 1.0 | Strong positive | Metrics move together consistently |
| 0.4 to 0.7 | Moderate positive | Notable co-movement pattern |
| 0.0 to 0.4 | Weak positive | Limited relationship |
| -0.4 to 0.0 | Weak negative | Slight inverse tendency |
| -0.7 to -0.4 | Moderate negative | Notable inverse co-movement |
| -1.0 to -0.7 | Strong negative | Strongly 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
| Property | Value |
|---|---|
| Registry ID | reasoning-engine-correlation-analysis-agent |
| Profile ID | correlation-tool-analysis |
| Code | src/mastra/agents/reasoning-engine/correlation/analysis.ts |
| Accessor | getCorrelationAnalysisAgent() |
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.