diff --git a/pitch-deck/app/api/pipeline-stats/route.ts b/pitch-deck/app/api/pipeline-stats/route.ts new file mode 100644 index 0000000..53e5087 --- /dev/null +++ b/pitch-deck/app/api/pipeline-stats/route.ts @@ -0,0 +1,17 @@ +import { NextResponse } from 'next/server' +import pool from '@/lib/db' + +export async function GET() { + try { + const { rows } = await pool.query( + 'SELECT key, value, label_de, label_en FROM pitch_pipeline_stats ORDER BY key' + ) + const stats: Record = {} + for (const row of rows) { + stats[row.key] = { value: Number(row.value), label_de: row.label_de, label_en: row.label_en } + } + return NextResponse.json(stats) + } catch { + return NextResponse.json({}, { status: 500 }) + } +} diff --git a/pitch-deck/components/slides/AIPipelineSlide.tsx b/pitch-deck/components/slides/AIPipelineSlide.tsx index f8a9eb4..45c450f 100644 --- a/pitch-deck/components/slides/AIPipelineSlide.tsx +++ b/pitch-deck/components/slides/AIPipelineSlide.tsx @@ -1,6 +1,6 @@ 'use client' -import { useState } from 'react' +import { useState, useEffect } from 'react' import { Language } from '@/lib/types' import { t } from '@/lib/i18n' import GradientText from '../ui/GradientText' @@ -34,16 +34,29 @@ interface AIPipelineSlideProps { type PipelineTab = 'rag' | 'agents' | 'quality' +type PipelineStat = { value: number; label_de: string; label_en: string } + export default function AIPipelineSlide({ lang }: AIPipelineSlideProps) { const i = t(lang) const de = lang === 'de' const [activeTab, setActiveTab] = useState('rag') + const [stats, setStats] = useState>({}) + + useEffect(() => { + fetch('/api/pipeline-stats', { cache: 'no-store' }) + .then(r => r.json()) + .then(setStats) + .catch(() => {}) + }, []) + + const s = (key: string) => stats[key]?.value || 0 + const fmtK = (v: number) => v >= 1000 ? `${Math.round(v / 1000)}k+` : `${v}+` const heroStats = [ - { value: '75+', label: de ? 'Rechtsquellen' : 'Legal Sources', sub: de ? 'EU-Verordnungen · DACH-Gesetze · Frameworks' : 'EU regulations · DACH laws · Frameworks', color: 'text-indigo-400' }, - { value: '70k+', label: de ? 'Unique Controls' : 'Unique Controls', sub: de ? 'Prüfbare Compliance-Anforderungen' : 'Auditable compliance requirements', color: 'text-purple-400' }, - { value: '47k+', label: de ? 'Extrahierte Pflichten' : 'Extracted Obligations', sub: de ? 'Aus Gesetzestexten abgeleitet' : 'Derived from legal texts', color: 'text-emerald-400' }, - { value: '6', label: de ? 'Pipeline-Versionen' : 'Pipeline Versions', sub: de ? 'Kontinuierliche Verbesserung' : 'Continuous improvement', color: 'text-amber-400' }, + { value: fmtK(s('legal_sources')), label: de ? 'Rechtsquellen' : 'Legal Sources', sub: de ? 'EU-Verordnungen · DACH-Gesetze · Frameworks' : 'EU regulations · DACH laws · Frameworks', color: 'text-indigo-400' }, + { value: fmtK(s('unique_controls')), label: de ? 'Unique Controls' : 'Unique Controls', sub: de ? 'Prüfbare Compliance-Anforderungen' : 'Auditable compliance requirements', color: 'text-purple-400' }, + { value: fmtK(s('extracted_obligations')), label: de ? 'Extrahierte Pflichten' : 'Extracted Obligations', sub: de ? 'Aus Gesetzestexten abgeleitet' : 'Derived from legal texts', color: 'text-emerald-400' }, + { value: String(s('pipeline_versions') || 6), label: de ? 'Pipeline-Versionen' : 'Pipeline Versions', sub: de ? 'Kontinuierliche Verbesserung' : 'Continuous improvement', color: 'text-amber-400' }, ] const tabs: { id: PipelineTab; label: string; icon: typeof Brain }[] = [ @@ -58,7 +71,7 @@ export default function AIPipelineSlide({ lang }: AIPipelineSlideProps) { icon: Globe, color: 'text-blue-400', bg: 'bg-blue-500/10 border-blue-500/20', - title: de ? 'EU-Verordnungen (~15)' : 'EU Regulations (~15)', + title: de ? `EU-Verordnungen (~${s('eu_regulations') || 45})` : `EU Regulations (~${s('eu_regulations') || 45})`, why: de ? 'Bindende Vorgaben für alle EU-Unternehmen — Verstöße führen zu Bußgeldern bis 4% des Jahresumsatzes.' : 'Binding requirements for all EU companies — violations lead to fines up to 4% of annual revenue.', @@ -68,7 +81,7 @@ export default function AIPipelineSlide({ lang }: AIPipelineSlideProps) { icon: Scale, color: 'text-purple-400', bg: 'bg-purple-500/10 border-purple-500/20', - title: de ? 'DACH-Gesetze (~20)' : 'DACH Laws (~20)', + title: de ? `DACH-Gesetze (~${s('dach_laws') || 85})` : `DACH Laws (~${s('dach_laws') || 85})`, why: de ? 'Nationale Umsetzungen und eigenständige Gesetze — oft strenger als EU-Mindeststandards.' : 'National implementations and standalone laws — often stricter than EU minimum standards.', @@ -106,8 +119,8 @@ export default function AIPipelineSlide({ lang }: AIPipelineSlideProps) { bg: 'bg-blue-500/10 border-blue-500/20', title: de ? '1. Dokument-Ingestion' : '1. Document Ingestion', items: de - ? ['75+ Rechtsquellen aus EU, Deutschland und Österreich', 'Strukturelles Chunking an Artikel- und Absatz-Grenzen', 'Automatische Lizenz-Klassifikation (frei / Zitat / geschützt)', 'Geschützte Normen (ISO, BSI) werden vollständig reformuliert'] - : ['75+ legal sources from EU, Germany and Austria', 'Structural chunking at article and paragraph boundaries', 'Automatic license classification (free / citation / restricted)', 'Protected standards (ISO, BSI) are fully reformulated'], + ? [`${s('legal_sources') || 380}+ Rechtsquellen aus EU, Deutschland und Österreich`, 'Strukturelles Chunking an Artikel- und Absatz-Grenzen', 'Automatische Lizenz-Klassifikation (frei / Zitat / geschützt)', 'Geschützte Normen (ISO, BSI) werden vollständig reformuliert'] + : [`${s('legal_sources') || 380}+ legal sources from EU, Germany and Austria`, 'Structural chunking at article and paragraph boundaries', 'Automatic license classification (free / citation / restricted)', 'Protected standards (ISO, BSI) are fully reformulated'], }, { icon: Cpu, @@ -115,8 +128,8 @@ export default function AIPipelineSlide({ lang }: AIPipelineSlideProps) { bg: 'bg-purple-500/10 border-purple-500/20', title: de ? '2. Control-Extraktion' : '2. Control Extraction', items: de - ? ['LLM extrahiert Pflichten und Anforderungen aus jedem Textabschnitt', '6 Pipeline-Versionen mit kontinuierlicher Qualitätsverbesserung', 'Obligation Extraction: 47.000+ einzelne Pflichten identifiziert', 'Atomic Control Composition: Pflichten werden zu prüfbaren Controls'] - : ['LLM extracts obligations and requirements from each text section', '6 pipeline versions with continuous quality improvement', 'Obligation extraction: 47,000+ individual duties identified', 'Atomic control composition: duties become auditable controls'], + ? ['LLM extrahiert Pflichten und Anforderungen aus jedem Textabschnitt', `${s('pipeline_versions') || 6} Pipeline-Versionen mit kontinuierlicher Qualitätsverbesserung`, `Obligation Extraction: ${fmtK(s('extracted_obligations'))} einzelne Pflichten identifiziert`, 'Atomic Control Composition: Pflichten werden zu prüfbaren Controls'] + : ['LLM extracts obligations and requirements from each text section', `${s('pipeline_versions') || 6} pipeline versions with continuous quality improvement`, `Obligation extraction: ${fmtK(s('extracted_obligations'))} individual duties identified`, 'Atomic control composition: duties become auditable controls'], }, { icon: Database, @@ -124,8 +137,8 @@ export default function AIPipelineSlide({ lang }: AIPipelineSlideProps) { bg: 'bg-emerald-500/10 border-emerald-500/20', title: de ? '3. Deduplizierung & Speicherung' : '3. Deduplication & Storage', items: de - ? ['97.000 generierte Controls → 70.000+ nach Deduplizierung', 'Embedding-basierte Ähnlichkeitserkennung (Cosine Similarity)', 'Cross-Regulation Harmonisierung: gleiche Pflicht aus verschiedenen Gesetzen wird zusammengeführt', 'Ziel: 25.000–50.000 atomare Master Controls'] - : ['97,000 generated controls → 70,000+ after deduplication', 'Embedding-based similarity detection (cosine similarity)', 'Cross-regulation harmonization: same obligation from different laws is merged', 'Target: 25,000–50,000 atomic master controls'], + ? [`${fmtK(s('generated_controls'))} generierte Controls → ${fmtK(s('unique_controls'))} nach Deduplizierung`, 'Embedding-basierte Ähnlichkeitserkennung (Cosine Similarity)', 'Cross-Regulation Harmonisierung: gleiche Pflicht aus verschiedenen Gesetzen wird zusammengeführt', `Aktuell: ${fmtK(s('unique_controls'))} atomare Master Controls`] + : [`${fmtK(s('generated_controls'))} generated controls → ${fmtK(s('unique_controls'))} after deduplication`, 'Embedding-based similarity detection (cosine similarity)', 'Cross-regulation harmonization: same obligation from different laws is merged', `Current: ${fmtK(s('unique_controls'))} atomic master controls`], }, { icon: Search, @@ -141,7 +154,7 @@ export default function AIPipelineSlide({ lang }: AIPipelineSlideProps) { // Multi-Agent System content — UCCA + Policy Engine const agents = [ { name: 'UCCA', soul: de ? 'Use-Case Compliance' : 'Use-Case Compliance', desc: de ? 'Policy Engine (45 Regeln) + Eskalation E0–E3' : 'Policy engine (45 rules) + escalation E0–E3', color: 'text-indigo-400' }, - { name: de ? 'Pflichten-Engine' : 'Obligations Engine', soul: de ? '47.000+ Pflichten' : '47,000+ obligations', desc: de ? 'Multi-Regulation: NIS2, DSGVO, AI Act, CRA, ...' : 'Multi-regulation: NIS2, GDPR, AI Act, CRA, ...', color: 'text-emerald-400' }, + { name: de ? 'Pflichten-Engine' : 'Obligations Engine', soul: `${fmtK(s('extracted_obligations'))} ${de ? 'Pflichten' : 'obligations'}`, desc: de ? 'Multi-Regulation: NIS2, DSGVO, AI Act, CRA, ...' : 'Multi-regulation: NIS2, GDPR, AI Act, CRA, ...', color: 'text-emerald-400' }, { name: de ? 'Compliance-Berater' : 'Compliance Advisor', soul: de ? 'Legal RAG + LLM' : 'Legal RAG + LLM', desc: de ? 'Chatbot mit 75+ Rechtsquellen als Wissenbasis' : 'Chatbot with 75+ legal sources as knowledge base', color: 'text-purple-400' }, { name: de ? 'Dokument-Generator' : 'Document Generator', soul: de ? '7+ Templates' : '7+ templates', desc: de ? 'AGB, DSE, AV-Vertrag, DSFA, FRIA, BV + weitere' : 'T&C, Privacy Policy, DPA, DPIA, FRIA, Works Agreement + more', color: 'text-amber-400' }, { name: de ? 'DSFA-Agent' : 'DPIA Agent', soul: de ? 'Art. 35 DSGVO' : 'Art. 35 GDPR', desc: de ? 'Risikobewertung mit 16 Bundesländer-Leitlinien' : 'Risk assessment with 16 federal state guidelines', color: 'text-red-400' },