Files
whyrating-engine-legacy/migrations/versions/013_add_synthesis_to_executions.sql
Alejandro Gutiérrez 9b667e69a7 feat(pipeline): Add Stage 5 Synthesis for AI-generated narratives
- Add Stage5Synthesizer class that generates AI narratives and action plans
- Add generate() method to LLMClient for synthesis generation
- Integrate Stage 5 into pipeline runner after route stage
- Add synthesis JSONB column to pipeline.executions table
- Update reviewiq_analytics API to return synthesis data
- Synthesis includes: executive narrative, sentiment/category/timeline insights,
  action plan, marketing angles, and priority recommendations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 03:12:53 +00:00

13 lines
511 B
SQL

-- Migration: Add synthesis column to pipeline.executions
-- This stores the AI-generated synthesis from Stage 4
ALTER TABLE pipeline.executions
ADD COLUMN IF NOT EXISTS synthesis JSONB DEFAULT NULL;
-- Add index for querying executions with synthesis
CREATE INDEX IF NOT EXISTS idx_executions_has_synthesis
ON pipeline.executions ((synthesis IS NOT NULL));
-- Comment
COMMENT ON COLUMN pipeline.executions.synthesis IS 'AI-generated synthesis containing narratives, action plan, and insights from Stage 4';