Skip to main content

sdac-analyze-duplicates-context

Purpose

Analyzes duplicate salary/fringe patterns and assigns risk levels (LOW/MEDIUM/HIGH).

Tool type

AI-assisted (LLM; non-deterministic)

Tool ID

sdac-analyze-duplicates-context

Inputs

  • report_id (string)
  • min_occurrences (number, optional, default: 3)
  • fields (array of salary/fringe, optional)

Outputs

  • Duplicate groups with risk level and recommendations
  • Summary statistics

Example output

{
"success": true,
"report_id": "SDAC-2024-Q2-001",
"duplicate_groups_analyzed": 1,
"high_risk_groups": 1,
"groups": [
{
"group_id": "dup-001",
"record_ids": [
101,
102
],
"row_numbers": [
12,
13
],
"duplicate_type": "SAME_PERSON_SAME_COSTS",
"risk_level": "HIGH",
"explanation": "The same employee appears on adjacent rows with identical salary and fringe amounts.",
"recommendation": "Confirm whether one row should be removed or whether the rows represent separate assignments."
}
],
"summary": {
"total_groups": 1,
"high_risk_groups": 1,
"medium_risk_groups": 0,
"low_risk_groups": 0
}
}

Functional details

  • Uses the SDAC Duplicates Analyzer agent to contextualize duplicate patterns.
  • Produces explanations and remediation recommendations.
  • Highlights streaks and repeated values with risk scoring.

Implementation details

  • Groups salary/fringe values across the report and checks consecutive rows.
  • Sends grouped patterns to the Duplicates Analyzer agent.
  • Risk levels and explanations come from LLM analysis.
  • Considers only positive values when grouping duplicates.

Code Location: packages/domain-sdac/src/tools/analyze-duplicates-context.tool.ts