Open Toolbox

Sales Call Analyzer — Clone Kit

Copy all the code below to recreate the Sales Call Analyzer tool in any Base44 app.

Setup Instructions
Follow these steps to set up the Sales Call Analyzer in your Base44 app
# Sales Call Analyzer - Clone Kit Setup Instructions

## Overview
An AI-powered sales call coaching tool for real estate agents. Upload or paste a call
transcript (buyer or seller discovery calls), and receive a detailed, scored analysis
across 5 key sections: Intro, Frame, Questions, Transitions, and Close.

## Architecture Summary
- Frontend: React page (SalesCallAnalyzer.jsx) with 3 views: Dashboard, New Call Form, Report
- Entity: SalesCall (stores all call data and AI analysis JSON)
- AI: Runs 5 parallel section analyses via InvokeLLM (Claude recommended)
- Audio: Optional MP3/WAV upload → OpenAI Whisper transcription
- PDF: jsPDF-powered downloadable coaching reports

---

## Step 1 — Create the Entity

Create file: entities/SalesCall.json
(copy the full schema from the "Entity Schema" tab)

Required fields: title, call_type, call_date
Key storage fields: transcript_text, ai_analysis_report, marketing_insights_report

---

## Step 2 — Add Calibration Fields to User Entity

Edit entities/User.json and add the 6 calibration number fields shown in the
"Entity Schema" tab under "User Entity Calibration Fields". These allow each agent to
customize how strictly the AI grades their calls.

---

## Step 3 — Create Backend Functions

### a) functions/transcribeAudio.js
- Purpose: Uploads audio and transcribes via OpenAI Whisper API
- Input: { file_url: string }
- Output: { transcript: string, duration, language }
- API Keys: OPENAI_API_KEY
- Max file size: 25MB (MP3, WAV, M4A, MP4)

### b) functions/enforceScoringRules.js (optional post-processor)
- Purpose: Post-processes AI scores for consistency
- Applies section multipliers and maxScore caps
- Prevents score inflation across sub-categories

### c) functions/generateSalesCallPDF.js
- Purpose: Generates a downloadable PDF coaching report
- Input: { call_data: object, analysis_data: object }
- Output: PDF binary (application/pdf)
- Uses: jsPDF + jspdf-autotable

### d) functions/getCallComparisonData.js (optional)
- Purpose: Compares current call scores vs. previous call
- Input: { callId: string }
- Output: { comparison_available: bool, comparison: object }

### e) functions/generateMarketingInsights.js (optional)
- Purpose: Extracts marketing intelligence from transcript
- Input: { transcript: string, call_type: string }
- Output: { pain_points, needs_desires, value_propositions, ... }

---

## Step 4 — Routing in App.jsx

import SalesCallAnalyzer from './pages/SalesCallAnalyzer';

// Add inside <Routes>:
<Route
  path="/SalesCallAnalyzer"
  element={<LayoutWrapper currentPageName="SalesCallAnalyzer"><SalesCallAnalyzer /></LayoutWrapper>}
/>

---

## Step 5 — Set Required Secrets

Go to your Base44 dashboard → Settings → Environment Variables:

Required:
- OPENAI_API_KEY  →  For Whisper transcription + fallback LLM
- ANTHROPIC_API_KEY  →  For Claude analysis (recommended for best results)

Optional:
- DEEPSEEK_API_KEY  →  Budget-friendly alternative model
- GROK_API_KEY  →  Alternative model

---

## Step 6 — Add to Navigation (optional)

In your layout.js, add to a nav category:
{
  title: "Sales Call Analyzer",
  pageName: "SalesCallAnalyzer",
  url: createPageUrl("SalesCallAnalyzer"),
  icon: Mic
}

---

## Step 7 — Key Features

✅ Audio Upload → Auto-Transcription (Whisper)
✅ Paste-Transcript mode
✅ Buyer & Seller lead types with context-aware analysis
✅ 5-Section Scoring: Intro, Frame, Questions, Transitions, Close
✅ 25 Sub-Category evaluations per call
✅ Verbatim transcript examples for each sub-category
✅ Actionable 3-point coach feedback per sub-category
✅ Suggested script examples for improvement
✅ Overall average + section scores
✅ Calibration panel (6 dimensions, saved per user)
✅ Call-to-Call progress comparison
✅ PDF export (full coaching report)
✅ Marketing Insights tab (pain points, messaging, content ideas)
✅ Claude / ChatGPT / Grok / DeepSeek model selection

---

## Step 8 — Workflow

1. Click "New Call"
2. Select lead type (Buyer / Seller)
3. Fill in prospect details and context
4. Upload audio file OR paste transcript
5. Select AI model (Claude recommended)
6. Click "Submit for Analysis"
7. AI runs 5 parallel section analyses (~60-120 seconds)
8. View detailed report with scores, examples, feedback, scripts
9. Export PDF coaching report

---

## Step 9 — Customization Tips

- Modify DISCOVERY_SECTIONS_CONFIG to add/remove sections or sub-categories
- Adjust CALIBRATION_RULES to change scoring multipliers and score caps
- Update the AI prompt in analyzeDiscoverySection() function
- Add SPICED/MEDDIC/BANT methodology-specific scoring logic
- Customize PDF layout in generateSalesCallPDF function
- Add email delivery of PDF reports

---

## Step 10 — Troubleshooting

Audio Upload Fails:
- Verify OPENAI_API_KEY is set
- File must be under 25MB
- Supported: mp3, wav, m4a, mp4, mpeg, flac, ogg, webm

Analysis Returns Incomplete:
- Claude is most reliable for structured JSON output
- Increase timeout if sections fail intermittently
- Check that transcript has clear speaker labels ("Rep:" / "Prospect:")

Scores Seem Too High:
- Adjust calibration sliders (higher = stricter)
- Reduce scoreMultiplier in CALIBRATION_RULES for specific sections

PDF Export Fails:
- Verify jspdf and jspdf-autotable packages are installed
- Check for non-ASCII characters in transcript (function cleans them automatically)

Quick Start

  1. 1. Copy the Entity Schema → Create entities/SalesCall.json
  2. 2. Add the 6 calibration fields from Entity Schema → User Entity to entities/User.json
  3. 3. Create the 4 backend functions from the Backend Functions tab
  4. 4. Set OPENAI_API_KEY and ANTHROPIC_API_KEY in Base44 → Environment Variables
  5. 5. Build the main page using the AI Prompt & Sections config as your guide
  6. 6. Add a route in App.jsx pointing to your new page

Key Features of this Tool:

  • • 5 parallel AI analyses per call (Intro, Frame, Questions, Transitions, Close)
  • • 25 sub-categories scored 0–10 with verbatim transcript evidence
  • • Calibration system — each agent sets their own grading strictness
  • • Audio upload with OpenAI Whisper auto-transcription (up to 25MB)
  • • Claude / ChatGPT / DeepSeek / Grok model selection
  • • Call-to-call progress comparison
  • • PDF coaching report export
  • • Marketing insights extraction from transcript
  • • Buyer AND Seller lead type support with context-aware scoring

HiveAI RE