Reprocess AI Analysis SOP
Standard Operating Procedure for re-triggering AI analysis on calls that have already been processed or failed.
Prerequisites
- AWS CLI configured with appropriate profile (e.g.,
--profile rc) - Access to DynamoDB and S3 in the target region
Environment Configuration
How AI Analysis Reprocessing Works
The ai-analysis-processor Lambda checks for existing analysis before processing:
- Queries
call-analysistable bytelephonySessionId - If
s3AnalysisPathexists and is non-empty → SKIP (already processed) - If
s3AnalysisPathis missing or empty → PROCESS (continue with analysis)
To reprocess a call, you must:
- Remove
s3AnalysisPathfrom DynamoDB - Re-upload the transcript file to S3 (triggers EventBridge → SQS → Lambda)
Step-by-Step Procedure
Step 1: Verify Call Status
Check these fields:
callResult- If "Missed", call has no recording and cannot be analyzedrecordingAvailable- Must betruefor analysis to works3TranscriptPath- Must exist to reprocesss3AnalysisPath- If present, analysis already exists
Step 2: Remove s3AnalysisPath
Step 3: Re-upload Transcript to Trigger EventBridge
Step 4: Monitor Processing
EventBridge has a ~1 minute delay before the SQS message is delivered.
Step 5: Verify Completion
Expected result:
Batch Reprocessing
For multiple calls, create a script:
Troubleshooting
Error: "Missing required DynamoDB fields: inference_config"
The client config is missing inference_config. Add it:
Error: "Kimi JSON truncation / Unexpected end of JSON input"
maxTokens is too low for Kimi thinking model. Update to 16000:
Error: "not authorized to perform: bedrock:InvokeModel"
IAM permissions missing for the region. Check lib/stacks/iam-stack.ts for Bedrock permissions.
Call has callResult="Missed" or recordingAvailable=false
Missed calls have no recording and cannot be analyzed. This is expected behavior.
SQS message stuck (ApproximateNumberOfMessagesNotVisible > 0)
Check visibility timeout (default: 960s / 16 minutes). Wait for timeout to expire or check DLQ for failed messages.