Skip to main content

sdac-explain-validation-assistant

Purpose

Provides conversational explanations for validation questions using rule and record context.

Tool type

AI-assisted (LLM; non-deterministic)

Tool ID

sdac-explain-validation-assistant

Inputs

  • report_id (string)
  • user_id (string)
  • question (string)
  • session_id (string, optional)
  • record_id (number, optional)
  • rule_id (string, optional)

Outputs

  • response (plain English)
  • conversation_summary with session details

Example output

{
"response": "The report has one blocking source-code issue and one replacement linkage warning. The blocking issue should be returned to the district before validation.",
"conversation_summary": {
"conversation_id": "conv-7f2c",
"report_id": "SDAC-2024-Q2-001",
"turns_used": 4,
"referenced_rules": [
"SOURCE_CODE_FEDERAL_CLAIMED"
]
}
}

Functional details

  • Combines rule context with record metadata to answer reviewer questions.
  • Maintains lightweight session state for multi-turn conversations.
  • Generates explanations tailored to the specific report and row.

Implementation details

  • Pulls rule context from SDAC.dim_ValidationRules and record context from SDAC.data_PersonnelRecords.
  • If no rule_id or record_id is provided, returns a generic guidance response.
  • Tracks a lightweight session summary with token and turn counts.
  • Uses a generated sess_{timestamp} when session_id is omitted.

Code Location: packages/domain-sdac/src/tools/explain-validation-assistant.tool.ts