Iteration 1: Analyse documents and produce an initial AnalysisResult. Extracts document types, detected policy domains, entities, and assembles initial SWOT entries from document titles and available metadata.
Iteration 2: Refine the initial analysis using full document text. Replaces generic SWOT entries with content-derived insights when enriched document text is available. Adds additional watch points and strengthens confidence scores.
When no documents are enriched, the analysis content (SWOT, watch
points, etc.) remains unchanged but metadata fields
(iterationsCompleted, completedAt) are always updated.
Iteration 3: Validate completeness of the analysis. Checks that all three stakeholder perspectives have substantive entries, that policy domains are correctly identified, and that confidence thresholds are met.
Returns a ValidationResult with a score and improvement suggestions.
Does not modify the AnalysisResult — call refineAnalysis again if
the score is below threshold.
The AI analysis pipeline contract.
Lifecycle for a
deepanalysis:analyzeDocuments— iteration 1: initial extraction from document metadata + contentrefineAnalysis— iteration 2: enrich SWOT entries using full document textvalidateCompleteness— iteration 3: check stakeholder coverage and confidenceFor
standarddepth, only iterations 1-2 run. Forquickdepth, only iteration 1 runs.