Normalizer Agent
Purpose
Correlation computation requires clean, aligned numeric arrays. Real-world datasets frequently contain mixed types, missing values, and misaligned indices -- conditions under which mathematical correlation produces invalid or misleading results.
The Normalizer Agent performs the data preparation required for valid correlation analysis: extracting numeric values, dropping invalid entries, aligning arrays by index, and reporting the transformations applied.
Value Proposition
- Mathematical validity -- ensures correlation coefficients are computed on clean, aligned data
- Graceful handling of messy inputs -- manages gaps, mixed types, and missing values without pipeline failure
- Transparency -- provides a summary of all normalization actions (values dropped, alignment changes) for downstream awareness
Operations
| Operation | Description |
|---|---|
| Numeric extraction | Isolates numeric values from mixed-type arrays |
| Invalid entry removal | Drops "N/A", null, empty strings, and non-numeric values |
| Index alignment | Ensures corresponding positions across datasets refer to the same time period |
| Order preservation | Maintains original dataset sequence |
| Outcome reporting | Summarizes all transformations applied |
Example
Input (heterogeneous):
{
"datasets": [
{ "id": "stress", "label": "Stress", "data": [3.5, 4.0, "N/A", 3.2, 4.5, 3.8, 4.2] },
{ "id": "sleep", "label": "Sleep", "data": [7, 6, 5, 7, 5, 6, 5] }
]
}
Output (normalized):
{
"normalized": [
{ "id": "stress", "label": "Stress", "values": [3.5, 4.0, 3.2, 4.5, 3.8, 4.2], "dimensions": 1 },
{ "id": "sleep", "label": "Sleep", "values": [7, 6, 7, 5, 6, 5], "dimensions": 1 }
],
"summary": "Extracted 2 numeric series with 6 aligned values each (dropped 1 non-numeric value)"
}
The "N/A" at position 3 of the stress array was removed, and the corresponding sleep value at position 3 was also dropped to maintain index alignment.
Technical Reference
Identifiers
| Property | Value |
|---|---|
| Registry ID | reasoning-engine-correlation-normalizer-agent |
| Profile ID | correlation-tool-normalizer |
| Code | src/mastra/agents/reasoning-engine/correlation/normalizer.ts |
| Accessor | getCorrelationNormalizerAgent() |
Output Schema
{
"normalized": [
{
"id": "string - Dataset identifier",
"label": "string? - Display label",
"values": ["number[] - Clean numeric array"],
"dimensions": "number? - Dimensionality"
}
],
"summary": "string - Normalization outcome description"
}
Default Prompt
"You are the normalization agent for the reasoning-engine multi-factor correlation tool. Your job is to read the incoming request payload, extract and align numeric series for every declared dataset, and return only valid JSON. Return an object with shape
{ normalized: [{ id, label?, values, dimensions? }], summary: string }. Drop non-numeric values, preserve dataset order, align multivariate columns, and never include prose outside the JSON payload."
Configuration
Update the prompt via Admin tools, SQL, or API targeting the correlation-tool-normalizer profile.