Riksdagsmonitor Intelligence Platform โ€” API Documentation - v0.8.15
    Preparing search index...

    The AI analysis pipeline contract.

    Lifecycle for a deep analysis:

    1. analyzeDocuments โ€” iteration 1: initial extraction from document metadata + content
    2. refineAnalysis โ€” iteration 2: enrich SWOT entries using full document text
    3. validateCompleteness โ€” iteration 3: check stakeholder coverage and confidence

    For standard depth, only iterations 1-2 run. For quick depth, only iteration 1 runs.

    interface AnalysisPipeline {
    ย ย ย ย analyzeDocuments(
    ย ย ย ย ย ย ย ย docs: RawDocument[],
    ย ย ย ย ย ย ย ย options: AnalysisPipelineOptions,
    ย ย ย ย ): Promise<AnalysisResult>;
    ย ย ย ย refineAnalysis(
    ย ย ย ย ย ย ย ย initial: AnalysisResult,
    ย ย ย ย ย ย ย ย docs: RawDocument[],
    ย ย ย ย ย ย ย ย options: AnalysisPipelineOptions,
    ย ย ย ย ): Promise<AnalysisResult>;
    ย ย ย ย validateCompleteness(
    ย ย ย ย ย ย ย ย analysis: AnalysisResult,
    ย ย ย ย ย ย ย ย docs: RawDocument[],
    ย ย ย ย ): Promise<ValidationResult>;
    }
    Index

    Methods

    • 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.

      Parameters

      Returns Promise<ValidationResult>