SDAC Agents
Overview
SDAC agents are specialized copilots tailored to review, widget, evaluation,
and feedback-automation tasks. Prompts are stored in Core.AgentProfiles and
loaded dynamically at runtime. buildSdacAgents() currently registers 11
profile-backed agents with versioned prompt overrides.
Agent Catalog
Validation Agents (one page per agent)
- Source Code Reviewer -- Validates source code assignments
- Comment Analyzer -- Evaluates justification comment quality
- Job Title Classifier -- Classifies and validates job titles
- Duplicates Analyzer -- Detects and analyzes duplicate entries
- Replacement Linker -- Links replacement positions to their original personnel records
- Validation Assistant -- Explains validation errors in plain language
- Review Coordinator -- Orchestrates comprehensive multi-category review
AI Widget Agent
- Coordinator Release -- Primary agent powering the SDAC AI Widget (
POST /sdac/chatbehind the widget proxy)
Optimization Agent
- Prompt Tuner -- Feedback-driven prompt optimization (analysis-only, used within the Prompt Tuning Workflow)
Feedback Planning And Evaluation Agents
- Feedback Planner (
sdac-feedback-planner, registrysdac_feedback-planner-agent) -- Groups append-only feedback into actionable evidence packages and issue drafts for the scheduled Linear automation. It does not mutate prompts. - Widget Conversation Evaluator (
sdac-widget-conversation-evaluator, registrysdac_widget-conversation-evaluator-agent) -- Scores recorded widget scenarios and request traces for deterministic test/evaluation runs. It has no production chat tools.
Source: packages/domain-sdac/src/agents.ts.
AI Widget Integration
The SDAC AI Widget supports dynamic agent routing via the agentId field in the chat request. The chat endpoint uses an AGENT_BUILDERS registry to dispatch requests to the correct agent builder. If agentId is omitted, the server falls back to the SDAC_DEFAULT_AGENT_ID environment variable, then to sdac-coordinator-release.
Currently registered agents:
- Coordinator Release (
sdac-coordinator-release) -- Primary widget agent for cost report Q&A - Review Coordinator (
sdac-review-coordinator) -- Orchestrates comprehensive multi-category review
All widget agents share these capabilities:
- SSE streaming -- Real-time response streaming via direct runtime
POST /sdac/chator widget proxyPOST /api/ingestion/sdac/chat - Context-aware validation -- Uses
sdac-get-report-info,sdac-validate-fringe,sdac-compare-quarters, andsdac-cross-reference-replacements - Session management -- Server-side conversation persistence with 90-day retention
- Token tracking -- Logs model usage (prompt/completion tokens) per turn
API Endpoint:
POST /sdac/chat
Content-Type: application/json
{
"reportId": "8201EDC2-2EDE-4CA1-AF44-D0F5AA185CDB",
"message": "What is the fringe variance?",
"userId": "auditor@state.gov",
"sessionId": "browser-session-123",
"conversationId": null,
"agentId": "sdac-coordinator-release"
}
| Field | Description |
|---|---|
agentId | Optional. Agent to handle the request. Defaults to SDAC_DEFAULT_AGENT_ID env var, then sdac-coordinator-release. Returns 400 for unknown agent IDs. |
Response: Server-Sent Events with metadata, delta, usage, and done events. See Streaming Responses for details.
Feedback Loop
The Prompt Tuner Agent works within the Prompt Tuning Workflow to propose or apply agent prompt changes:
- User feedback captured via direct runtime
POST /sdac/feedbackor widget proxyPOST /api/ingestion/sdac/feedback - Feedback aggregated and analyzed by the Prompt Tuner Agent
- Revised prompts applied with 5 safety gates (minimum confidence, content validation, idempotency)
- All runs logged to
SDAC.log_PromptTuningRunsfor audit - SCD Type 2 versioning in
Core.AgentProfilesprovides rollback safety
Separately, sdac-feedback-linear-automation uses the Feedback Planner to
group unprocessed feedback and create Linear issues when the integration is
enabled. It writes an audit run and only then marks consumed feedback rows.
Agent Communication Style
All SDAC agents follow structured reporting patterns:
- Overview -- "I found 3 errors in the source codes"
- Detailed list -- Each error with row number, specific issue, and context
- Offer help -- "Would you like me to explain any of these errors?"
- Corrections -- Step-by-step fix instructions with guideline references