${doc.name}
+${doc.size}
+Select documents to load quick summaries.
'; + return; + } + try { + const results = []; + for (const filename of selected) { + const response = await fetch('/api/data/summarize', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ filename }), + }); + const data = await response.json(); + if (!response.ok) throw new Error(data.error || `Unable to summarize ${filename}`); + results.push({ filename, summary: data.summary, tags: data.tags }); + } + advisorContextSummary.innerHTML = results + .map( + (item) => ` +${item.summary || 'No summary'}
+No items available.
'; + } + return ( + '${item[secondaryKey] || ''}
+No recommendations provided.
'; + } + return ( + 'No documents yet. Upload a file to populate the catalog.
'; + } + return documents + .map( + (doc) => ` +${doc.size}
+Grounded in uploaded context with AI-generated highlights.
+Summaries will appear here once generated.
'; + updateQualityDial(0); + return; + } + summaryOutput.innerHTML = ''; + try { + const response = await fetch('/api/data/summarize', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ filename }), + }); + const payload = await response.json(); + if (!response.ok) throw new Error(payload.error || 'Unable to summarize document'); + renderSummary(payload); + } catch (error) { + summaryOutput.innerHTML = `No impact metrics provided.
'; + return; + } + impactGrid.innerHTML = labels + .map((label, index) => { + const value = Number.parseFloat(series[index]) || 0; + const bounded = Math.max(0, Math.min(value, 100)); + return ` + + `; + }) + .join(''); +} + +function updateOutlook(score) { + if (!outlookDial) return; + const numeric = Number.parseInt(score, 10) || 0; + const bounded = Math.max(0, Math.min(numeric, 100)); + outlookDial.dataset.score = bounded; + outlookDial.style.setProperty('--score', bounded); + if (outlookValue) { + outlookValue.textContent = Number.isFinite(bounded) ? bounded : '—'; + } + if (!runwayIndicator || !metricHealth) return; + if (bounded >= 70) { + runwayIndicator.textContent = 'Accelerate'; + metricHealth.textContent = 'Momentum suggests aggressive plays.'; + } else if (bounded >= 40) { + runwayIndicator.textContent = 'Stabilize'; + metricHealth.textContent = 'Blend growth with retention safeguards.'; + } else { + runwayIndicator.textContent = 'Recalibrate'; + metricHealth.textContent = 'Revisit fundamentals and cost structure.'; + } +} + +function renderInsightCards(cards = []) { + if (!cards.length) { + insightCards.innerHTML = 'No insights yet.
'; + return; + } + insightCards.innerHTML = cards + .map( + (card) => ` +${card.detail || ''}
+No exposure distribution provided.
'; + return; + } + exposureGrid.innerHTML = labels + .map((label, index) => { + const value = Number.parseFloat(series[index]) || 0; + const bounded = Math.max(0, Math.min(value, 100)); + return ` + + `; + }) + .join(''); +} + +function renderMatrix(items = []) { + if (!items.length) { + riskMatrix.innerHTML = 'No risks surfaced yet.
'; + return; + } + riskMatrix.innerHTML = items + .map((item) => { + const mitigation = item.mitigation ? `${item.mitigation}` : ''; + return ` +Likelihood ${item.likelihood ?? '—'} · Impact ${item.impact ?? '—'}
+${item.detail || ''}
+ ${mitigation} +Chat with the embedded strategist for pitch angles, rollout plans, and follow-up actions. Add document context to ground the guidance.
+Local model orchestrates every reply.
+Summaries will appear here after loading documents.
+
+ {% if api_ready %}
+ Running inference from your GPU-hosted model.
+ {% else %}
+ Launch Ollama and configure LLM_MODEL in your .env file.
+ {% endif %}
+
{{ catalog_summary.total_size if catalog_summary else '0 B' }} indexed footprint
+Coverage across {{ catalog_summary.coverage|length if catalog_summary else 0 }} sources
+Focus mode toggles with Ctrl + B. Refresh catalog with Ctrl + Alt + R.
+Select any two catalogued documents to pinpoint alignment, divergence, and recommended remediation – all computed locally.
+GPU-powered differential analysis on your machine.
+Higher is better alignment
+High-level summary
+Select two files to run a deep comparison.
++ Upload structured notes, CSV exports, enablement decks, or customer research. Everything stays local while the GPU-backed + model builds richer predictions, risks, and advisor summaries. +
+
+ {% if api_ready %}
+ Model streaming from your 4090 – no external API calls required.
+ {% else %}
+ Start ollama and set LLM_MODEL to a pulled model such as llama3.2:latest.
+ {% endif %}
+
Supported formats: TXT, MD, CSV, JSON. Files remain on disk inside the uploads folder.
Catalog
+Select a file to generate a synopsis, tags, and opportunity prompts powered by the local model.
+ +Quality score
+Summaries will appear here once generated.
++ Bring pipeline exports, field research, and operator notes together. Aurora synthesizes every upload into prediction arcs, + mitigation blueprints, advisor-grade briefings, and deep comparisons – entirely on your RTX-powered workstation. +
+ {% if not api_ready %} +ollama, run ollama pull llama3.2, and set LLM_MODEL in your .env
+ to unlock the intelligence modules.
+ {{ doc.size }}
+Add discovery notes, renewal playbooks, or pipeline exports to activate the cockpit.
+Prediction studio · Risk command · Advisor lounge · Comparison lab · Data steward
+Sized for rapid GPU inference and comparison.
+Round-trip response target for on-box chat.
+Workflow coverage
+Feed documents, evolve strategy, evaluate risk, and brief stakeholders in one place.
+Sync weekly execution and quarterly planning off the same digital twin.
+Ground every customer conversation with comparative context and advisor prompts.
+Coverage spans {{ catalog_summary.coverage|length }} archetypes totalling {{ catalog_summary.total_size }}.
+ + {% else %} +Upload files to unlock coverage analytics and metadata insights.
+ {% endif %} +Model multi-horizon forecasts, detect inflection points, and surface initiatives that move the needle.
+Translate telemetry into mitigation playbooks with automated triage, scoring, and early warning systems.
+Prompt the embedded strategist for pitch angles, rollout plans, and board-ready narratives.
+Upload two files to receive redline-style differentials, SWOT signals, and alignment recommendations.
+{{ doc.size }}
+No documents yet. Upload a file to populate the catalog.
+{% endif %} diff --git a/app/templates/prediction.html b/app/templates/prediction.html new file mode 100644 index 0000000..c741969 --- /dev/null +++ b/app/templates/prediction.html @@ -0,0 +1,108 @@ +{% extends 'base.html' %} +{% block title %}Predictive Strategy · Aurora CRM{% endblock %} +{% block content %} +Blend qualitative assumptions with catalogued evidence to receive quantified growth outlooks, confidence signals, and initiative guidance.
+Powered by your configured GGUF model for fully local forecasting.
+Composite momentum score
+Model-rated scenario certainty
+Awaiting forecast
+Run a scenario to populate insights and priorities.
+ +Submit scenario details and optionally connect documents from the catalog. The local model quantifies exposure, recommends mitigations, and surfaces early warnings.
+GPU-accelerated risk synthesis without cloud latency.
+Composite exposure
+Highest impact risk
+Signals requiring monitoring
+Run an assessment to populate risk narratives.
+ +