Wiki source code of AKEL Pipeline Flow
Last modified by Robert Schaub on 2026/02/08 21:46
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | = AKEL Pipeline Flow = | ||
| 2 | |||
| 3 | === High-Level Flow === | ||
| 4 | |||
| 5 | {{mermaid}} | ||
| 6 | flowchart TB | ||
| 7 | subgraph Input["📥 Input Layer"] | ||
| 8 | URL[URL Input] | ||
| 9 | TEXT[Text Input] | ||
| 10 | end | ||
| 11 | |||
| 12 | subgraph Retrieval["🔍 Content Retrieval"] | ||
| 13 | FETCH[extractTextFromUrl] | ||
| 14 | PDF[PDF Parser<br/>pdf2json] | ||
| 15 | HTML[HTML Parser<br/>cheerio] | ||
| 16 | end | ||
| 17 | |||
| 18 | subgraph AKEL["🧠 AKEL Pipeline"] | ||
| 19 | direction TB | ||
| 20 | |||
| 21 | subgraph Step1["Step 1: Understand"] | ||
| 22 | UNDERSTAND[understandClaim<br/>━━━━━━━━━━━━━<br/>• Detect input type<br/>• Extract claims<br/>• Identify dependencies<br/>• Assign risk tiers] | ||
| 23 | LLM1[("🤖 LLM Call #1<br/>Claude/GPT/Gemini")] | ||
| 24 | end | ||
| 25 | |||
| 26 | subgraph Step2["Step 2: Research (Iterative)"] | ||
| 27 | DECIDE[decideNextResearch<br/>━━━━━━━━━━━━━<br/>• Generate queries<br/>• Focus areas] | ||
| 28 | |||
| 29 | SEARCH[("🌐 Web Search<br/>Google CSE / SerpAPI")] | ||
| 30 | |||
| 31 | FETCHSRC[fetchSourceContent<br/>━━━━━━━━━━━━━<br/>• Parallel fetching<br/>• Timeout handling] | ||
| 32 | |||
| 33 | EXTRACT[extractEvidence<br/>━━━━━━━━━━━━━<br/>• Parse sources<br/>• Extract evidence] | ||
| 34 | LLM2[("🤖 LLM Call #2-N<br/>Per source")] | ||
| 35 | end | ||
| 36 | |||
| 37 | subgraph Step3["Step 3: Verdict Generation"] | ||
| 38 | VERDICT[generateVerdicts<br/>━━━━━━━━━━━━━<br/>• Claim verdicts<br/>• Article verdict<br/>• Dependency propagation] | ||
| 39 | LLM3[("🤖 LLM Call #N+1<br/>Final synthesis")] | ||
| 40 | end | ||
| 41 | |||
| 42 | subgraph Step4["Step 4: Summary"] | ||
| 43 | SUMMARY[generateTwoPanelSummary<br/>━━━━━━━━━━━━━<br/>• Format results<br/>• Build two-panel summary] | ||
| 44 | end | ||
| 45 | |||
| 46 | subgraph Step5["Step 5: Report"] | ||
| 47 | REPORT[generateReport<br/>━━━━━━━━━━━━━<br/>• Generate markdown] | ||
| 48 | end | ||
| 49 | end | ||
| 50 | |||
| 51 | subgraph Output["📤 Output"] | ||
| 52 | RESULT[AnalysisResult JSON] | ||
| 53 | MARKDOWN[Report Markdown] | ||
| 54 | end | ||
| 55 | |||
| 56 | %% Flow connections | ||
| 57 | URL --> FETCH | ||
| 58 | TEXT --> UNDERSTAND | ||
| 59 | FETCH --> PDF | ||
| 60 | FETCH --> HTML | ||
| 61 | PDF --> UNDERSTAND | ||
| 62 | HTML --> UNDERSTAND | ||
| 63 | |||
| 64 | UNDERSTAND --> LLM1 | ||
| 65 | LLM1 --> DECIDE | ||
| 66 | |||
| 67 | DECIDE --> SEARCH | ||
| 68 | SEARCH --> FETCHSRC | ||
| 69 | FETCHSRC --> EXTRACT | ||
| 70 | EXTRACT --> LLM2 | ||
| 71 | LLM2 --> DECIDE | ||
| 72 | |||
| 73 | DECIDE -->|"Research Complete"| VERDICT | ||
| 74 | VERDICT --> LLM3 | ||
| 75 | LLM3 --> SUMMARY | ||
| 76 | SUMMARY --> REPORT | ||
| 77 | |||
| 78 | REPORT --> RESULT | ||
| 79 | REPORT --> MARKDOWN | ||
| 80 | {{/mermaid}} | ||
| 81 | |||
| 82 | === Pipeline Steps Detail === | ||
| 83 | |||
| 84 | **Step 1: Understand (understandClaim)** | ||
| 85 | * Detects input type: question | statement | article | ||
| 86 | * Extracts claims with dependencies | ||
| 87 | * Assigns risk tiers (A/B/C) | ||
| 88 | * Detects context(s) and temporal boundaries | ||
| 89 | * Discovers KeyFactors (optional decomposition questions) | ||
| 90 | * Applies Gate 1: Claim Validation | ||
| 91 | |||
| 92 | **Step 2: Research (decideNextResearch + extractEvidence)** | ||
| 93 | * Iterative research cycle (typically 2-3 rounds) | ||
| 94 | * Generates search queries targeting gaps | ||
| 95 | * Fetches and parses sources (HTML, PDF) | ||
| 96 | * Extracts evidence from each source | ||
| 97 | * Continues until research is complete or max rounds reached | ||
| 98 | |||
| 99 | **Step 3: Verdict Generation (generateVerdicts)** | ||
| 100 | * Generates verdicts for each claim | ||
| 101 | * Aggregates claim verdicts into KeyFactor verdicts | ||
| 102 | * Aggregates KeyFactor verdicts into context answers | ||
| 103 | * Generates overall article verdict | ||
| 104 | * Applies Gate 4: Verdict Confidence Assessment | ||
| 105 | |||
| 106 | **Step 4: Summary (generateTwoPanelSummary)** | ||
| 107 | * Builds two-panel summary (Overview + Key Findings) | ||
| 108 | * Formats verdict data for display | ||
| 109 | |||
| 110 | **Step 5: Report (generateReport)** | ||
| 111 | * Generates markdown report | ||
| 112 | * Includes all sections: Summary, Claims, Sources, Verdict | ||
| 113 | |||
| 114 | ---- | ||
| 115 | |||
| 116 | **Navigation:** [[Architecture Overview>>FactHarbor.Specification.Implementation.Architecture Overview.WebHome]] | Prev: [[Architecture Summary>>FactHarbor.Specification.Implementation.Architecture Overview.Architecture Summary.WebHome]] | Next: [[Data Models>>FactHarbor.Specification.Implementation.Architecture Overview.Data Models.WebHome]] |