# CSA AI Value & ROI Studio — Enterprise User Guide & Operational Manual

> **Welcome to the CSA AI Value & ROI Studio!**  
> This guide walks you through every module in the application, explaining how to use its capabilities for customer value realization, token cost engineering, Microsoft Graph live tenant audits, and autonomous agent design.

---

## 🧭 Navigation Map & Module Index

```
CSA AI Value & ROI Studio
├── 1. Prompt Optimization Studio ────► 5-tier grounded prompt generator with quality scoring
├── 2. Enterprise Prompt Library ─────► 8 vertical templates, search, custom prompt storage, export
├── 3. Tokenomics 201 Labs ───────────► 11 interactive diagnostic labs + 13-Lever Playbook
├── 4. Cost Calculator (Core Lab 2) ──► Workload modeler & Frontier/Standard/Mini tier arbitrage
├── 5. Enterprise Tokenomics ─────────► Department spend distribution, caching discounts & arbitrage
├── 6. Productivity ROI Calculator ───► Sliders for FTE gains, payback period, 12-month trajectory
├── 7. AI Readiness Assessment ───────► People/Process/Tech maturity evaluation & radar chart
├── 8. Gap Analyzer (Graph API) ──────► Live Microsoft 365 tenant audit & value leakage matrix
├── 9. Tenant Telemetry & Users ──────► 12-week trends, heatmap & per-user consumption with CSV
├── 10. Use Case Scenario Catalog ────► 8 enterprise prebuilt workload blueprints
├── 11. Autonomous Agent Factory ─────► System directives, XML guardrails, REST skills schema
└── 12. Executive Board Dashboard ────► Persona storytelling (CIO/CISO/COO) & board briefing report
```

---

## 🛠️ Step-by-Step Module Walkthrough

### Module 1: Prompt Optimization Studio
**Purpose**: Transforms unstructured customer requests into 5 production-ready prompt tiers with automated tokenomics calculations.

1. **Enter Workload Context**:
   - **Business Goal / Objective**: Describe what the AI needs to accomplish (e.g. *Synthesize clinical encounter audio into structured EHR SOAP notes*).
   - **Industry Vertical & Department**: (e.g., *Healthcare & Life Sciences*, *Clinical Operations*).
   - **Role / Persona**: (e.g., *Clinical Documentation Specialist*).
   - **Detailed Task Description**: Specify requirements, output constraints, and required fields.
2. **Review Generated 5 Tiers**:
   - **Tier 1 (Baseline)**: Raw unoptimized prompt showing potential fluff.
   - **Tier 2 (Microsoft 4-Part Grounded)**: Best practice format with `[Goal]`, `[Context]`, `[Grounding]`, and `[Format]`.
   - **Tier 3 (Token-Compressed)**: Strip all polite conversational filler for high-throughput batch pipelines.
   - **Tier 4 (XML-Structured)**: Tagged structure (`<instructions>`, `<constraints>`) ideal for complex multi-step reasoning.
   - **Tier 5 (Few-Shot Grounded)**: High-precision template with explicit positive and negative boundary examples.
3. **Actions**: Click **`Copy`** to copy any tier directly to your clipboard with cost and token footprint metadata.

---

### Module 2: Enterprise Prompt Library
**Purpose**: Search, filter, copy, and customize production-grade prompt templates across 8 enterprise verticals.

- **Filter by Industry**: Click on pills: *Healthcare*, *Finance*, *Security & IT*, *Executive*, *Sales & CS*, *HR*, or *DevOps*.
- **Search**: Type keywords into the search box to find specific prompt templates.
- **Add Custom Prompt**: Click **`+ Add Custom Prompt`** to save proprietary templates to your local browser storage (`localStorage`).
- **One-Click Hand-offs**:
  - Click **`Load in Studio`** to push any template into Module 1 for real-time tier synthesis.
  - Click **`Build Agent`** to push the template into Module 11 (Agent Factory) to generate an autonomous agent directive.
- **Export**: Click **`Export Markdown`** to download the complete prompt cheat-sheet as a `.md` file.

---

### Module 3: Tokenomics 201 Hands-On Labs (11 Labs)
**Purpose**: Interactive hands-on diagnostic suite inspired by Hackathon 2026 for token engineering and cost reduction.

| Lab | Name | How to Use |
|---|---|---|
| **Lab 1** | **Live Token Counter** | Paste any text or load sample prompts to see characters, words, tokens, and input cost update in real time. |
| **Lab 3** | **Conversation Creep** | Adjust number of chat turns and select Prompt Caching discounts (50% or 80%) to observe how caching prevents quadratic cost escalation. |
| **Lab 4** | **Prompt Pruning** | Load the bloated sample directive, click **`Optimize Prompt Now`**, and see 20–40% token reductions from stripping pleasantries and whitespace. |
| **Lab 5** | **Intent Model Routing** | Type user requests (e.g. *Extract dates* vs *Plan migration*) to watch the intent classifier automatically route to Mini ($0.15) or Frontier ($5.00). |
| **Lab 6** | **Semantic FAQ Cache** | Type common questions to trigger instant **0-token responses (12ms)** from the pre-warmed cache vs full LLM latency. |
| **Lab 7** | **Format Shootout** | Click between *Raw PDF*, *Markdown+PNG*, *Markdown+Mermaid*, and *Pure Text* to see the **50x token gap** between raster OCR and text. |
| **Lab 8** | **Lost in the Middle** | Toggle context size (8K, 32K, 128K) and needle fact position (Start, Middle, End) to observe accuracy dropping when facts are buried in the middle. |
| **Lab 9** | **Right-Size Model Dial** | Click tasks (Plan, Execute, Read) and watch the dial gauge point to the recommended tier with up to 97% savings over flagship defaults. |
| **Lab 10** | **Agent Token Odometer** | Select Guardrails `ON`/`OFF` and click **`Start Agent Run`** to watch the glowing digital odometer and observe auto-compaction reclaiming memory. |
| **Lab 11** | **Syntax Tax Showdown** | Toggle JSON Pretty, Minified, YAML, Markdown, and XML to compare structured data token costs. |
| **Playbook** | **The 13-Lever Playbook** | Reference the complete matrix mapping every lever to targeted waste, demo lab, and expected enterprise savings. |

---

### Module 4: Workload Cost Calculator (Core Lab 2)
**Purpose**: Model real production workloads with custom token counts and volume calls.

1. Set **Input Tokens / Call** (e.g., `1,200`), **Output Tokens / Call** (e.g., `400`), and **Calls per Day** (e.g., `5,000`).
2. Select your **Model Tier**: *Mini / Flash*, *Standard*, *Frontier*, or *Smart Hybrid (80/20)*.
3. Review Results:
   - **Est. Daily Cost** (e.g., `$2.10`)
   - **Est. Monthly Cost** (e.g., `$63.00`)
   - **Monthly Savings vs. Always-Frontier** (e.g., **`+$1,737.00 / mo`**).
4. View the side-by-side **Chart.js Bar Chart** comparing monthly spend across all 4 tiers.

---

### Module 5: Enterprise Tokenomics Analyzer
**Purpose**: Quantify monthly token consumption, departmental cost distribution, and Azure OpenAI caching savings.

- **Department Breakdown Table**: See user counts, monthly token burn, total spend, and cost per user across Engineering, Clinical Ops, Sales, Finance, Executive, HR, and Legal.
- **Department Donut Chart**: Visualize departmental consumption percentages.
- **Multi-Model Routing Arbitrage**: Compare 100% Flagship vs 80/20 Smart Hybrid vs 100% High-Efficiency (saving up to 92%).

---

### Module 6: Productivity Value & ROI Calculator
**Purpose**: Translate time saved into validated financial returns and payback metrics.

- **Interactive Sliders**:
  - *Number of Employees*: 100 to 25,000 users.
  - *Daily Time Saved*: 10 to 120 minutes/day.
  - *Average Hourly Cost*: $25 to $250/hour.
- **Calculated Outcomes**:
  - **Annual Hours Saved**: Total enterprise hours recovered.
  - **FTE Capacity Equivalent**: Full-Time Equivalent employees gained.
  - **Net Annual ROI**: Gross economic gain minus Copilot license costs ($30/user/mo).
  - **ROI Percentage & Multiplier**: e.g., `2,427% (25.3x)`.
  - **Payback Period**: e.g., `0.5 Months`.
  - **12-Month Cumulative Trajectory Chart**: Shows cumulative investment vs gross productivity value curve.

---

### Module 7: AI Deployment Readiness Assessment
**Purpose**: Evaluate customer organizational maturity across People, Process, and Technology.

- **Readiness Score Display**: Overall maturity score out of 100 with maturity tier badge (*Foundational*, *Emerging*, *Advanced*, *Optimized*).
- **Pillar Progress Bars**: Individual scores for People & Adoption, Process & Governance, and Technology & Security.
- **Spider / Radar Chart**: 9-axis diagnostic covering Champions Network, Skills, Change Management, Responsible AI, Purview DLP, AI Council, SharePoint Hygiene, Zero Trust, and M365 Channel.
- **Prescriptive CSA Action Plan**: Immediate milestone and prioritized 30/60/90-day technical recommendations.

---

### Module 8: Gap Analyzer (with Live Microsoft Graph API)
**Purpose**: Diagnose enterprise gaps, calculate annual value leakage, and query real Microsoft 365 tenants via Graph API.

1. **Connect Real Microsoft 365 Tenant**:
   - Enter **Microsoft Entra Tenant ID** (GUID), **Client ID**, and a **Bearer Access Token** (or click **`Simulate Live Probe (Demo)`**).
   - Click **`Connect Real Tenant`**.
2. **Review Live Telemetry Probes**:
   - Inactive Copilot seats from `/subscribedSkus` calculate exact **License Sunk Cost ($)**.
   - Unlabeled sites from `/sites` calculate **SharePoint Oversharing Exposure**.
   - Security alerts from `/security/alerts_v2` identify **Shadow AI** consumer chatbot usage.
3. **Review Diagnosed Gap Matrix**:
   - Examine Current State vs Target State, Financial Waste estimate, Effort, and Prescriptive Remediation Actions.

---

### Module 9: Tenant Telemetry & Per-User Consumption
**Purpose**: Deep-dive into user persona adoption, prompt volumes, token burn, and efficiency grades.

- **Tenant Switcher**: Toggle between Healthcare and Financial Services datasets.
- **12-Week Time-Series Line Chart**: Weekly Active Users (WAU) vs Token Burn Volume (Millions).
- **Feature Adoption Donut Chart**: Usage breakdown across Teams Meetings, Word Drafting, Outlook Summarization, Excel Analysis, and Autonomous Agents.
- **Per-User Consumption Table**: Filter by Department or search by UPN/Name to view Monthly Prompts, Token Burn, Spend, Cache Hit Rate, Persona Tag (*Power Prompt Champion*, *Moderate Adopter*, *Inactive Seat*), and Efficiency Grade (*A+* to *F*).
- **Export**: Click **`Export CSV`** to download user telemetry.

---

### Module 10: Use Case Scenario Catalog
**Purpose**: 8 prebuilt enterprise scenarios across M365 Executive Briefings, Prior-Auth Processing, Financial Audit, SecOps Incident Triage, Customer Support, Contract Compliance, HR Onboarding, and Cloud Migration.

- Click on any card to instantly load its business goals, token profile, and persona into Module 1 (Prompt Studio) and Module 11 (Agent Factory).

---

### Module 11: Autonomous Agent Factory
**Purpose**: Generate production-ready autonomous agent architectures for Microsoft Copilot Studio and Azure AI Foundry.

- **Inputs**: Agent Name, Objective & Workflow, Connected APIs (e.g. *Epic FHIR, SAP, ServiceNow*), Execution Trigger, and Responsible Team.
- **Outputs**:
  - Generated **System Directive & XML Guardrails** with anti-hallucination rules and escalation triggers.
  - **Tools & Skills JSON Schema** for external REST API connectors.
  - **Value Profile**: Monthly run cost, hours saved, and SLA compression metrics.
- Click **`Export Agent`** to download the complete `.md` blueprint.

---

### Module 12: Executive Board Dashboard & Storytelling
**Purpose**: Deliver board-level presentations and executive narrative pitches.

- **Persona Storytelling Tabs**: Tailored strategic storylines for:
  - **CIO**: Strategic productivity, competitive acceleration, and workforce enablement.
  - **CISO**: Zero Trust, Microsoft Purview DLP, Commercial Data Protection, and Shadow AI elimination.
  - **COO / Operations**: SLA compression, clinician/worker burnout relief, and business unit payback.
- **Executive Board Briefing Dossier**: Complete, publication-ready report formatted in clean Markdown.
- **Actions**:
  - Click **`Print Briefing`** to trigger browser print with print-optimized CSS.
  - Click **`Download Markdown`** to save the executive report to disk.

---

### Killer Feature: CSA Value Copilot AI Advisor
**Purpose**: Floating, always-available proactive AI assistant located at the bottom-right corner of the screen.

- Click the floating **`✨ CSA Value Copilot`** button to open the advisor drawer.
- **Live Proactive Insights**: Streams proactive advice based on current slider values and active scenarios.
- **Interactive Chat**: Ask questions such as:
  - *"How do I justify this $30/user license to the CFO?"*
  - *"What are the top 3 deployment risks for healthcare?"*
  - *"Generate a 90-day champion scale roadmap."*
