Turn sales call recordings into actionable proposals, summaries, and audio briefs β powered by AI.
how_it_works.mp4
Upload a sales call recording β get an AI-generated analysis with:
- Diarized Transcript β who said what, with timestamps
- Speaker Role Detection β automatically identifies Sales Rep vs Client
- Executive Summary β concise call overview
- Pain Points β extracted customer challenges
- Action Items β next steps with owners & deadlines
- Draft Proposal β ready-to-send Markdown proposal
- Audio Brief β TTS summary you can listen to
- Export β PDF, Markdown, or Email
flowchart LR
subgraph Frontend["π₯οΈ Frontend β Next.js"]
UI["React UI\n(Upload, Transcript,\nReport, Export)"]
end
subgraph Backend["βοΈ Backend β FastAPI"]
API["FastAPI Server\n:8000"]
DG["Deepgram Client\n(STT + TTS)"]
GM["Gemini Client\n(Role ID + Report)"]
AP["Audio Processor\n(Normalize)"]
end
subgraph External["βοΈ External APIs"]
DGAPI["Deepgram API\nNova-2 / Aura"]
GMAPI["Google Gemini API\n3.1 Flash Lite"]
end
UI -->|"POST /api/analyze\n(audio file)"| API
UI -->|"POST /api/tts\n(text)"| API
UI -->|"POST /api/email-report\n(HTML)"| API
API --> DG
API --> GM
API --> AP
DG -->|"STT + Diarization"| DGAPI
DG -->|"Text-to-Speech"| DGAPI
GM -->|"Role Analysis"| GMAPI
GM -->|"Report Generation"| GMAPI
sequenceDiagram
participant U as User
participant FE as Frontend
participant BE as FastAPI
participant DG as Deepgram
participant GM as Gemini
U->>FE: Upload audio file
FE->>BE: POST /api/analyze (audio)
BE->>DG: Transcribe with diarization
DG-->>BE: Utterances + speakers
BE->>BE: Normalize utterances
BE->>GM: Identify speaker roles
GM-->>BE: Role map (Sales Rep / Client)
BE->>GM: Generate strategic report
GM-->>BE: Summary, pain points, actions, proposal
BE-->>FE: Complete analysis result
FE-->>U: Display transcript + report
opt Audio Brief
U->>FE: Click "Listen"
FE->>BE: POST /api/tts
BE->>DG: Text-to-Speech
DG-->>BE: Audio stream
BE-->>FE: MP3 file
FE-->>U: Play audio
end
opt Export
U->>FE: Download PDF / MD / Email
FE-->>U: Generated document
end
The pipeline explicitly separates transcription from semantic analysis to isolate failure domains:
- Deepgram is used exclusively for fast, accurate Speech-to-Text and speaker diarization.
- Gemini is used exclusively for role identification and strategic report generation.
By keeping these concerns separate, the system is more resilient. If the LLM provider experiences an outage, the system can still successfully generate and return the raw diarized transcript.
Raw diarization from STT providers typically labels speakers as "Speaker 0" and "Speaker 1". The pipeline introduces an audio_processor.py normalizer and an intermediate LLM call specifically to identify which speaker is the "Sales Rep" and which is the "Client" based on the first few conversational turns. This step ensures the final executive summary and proposal are properly contextualized.
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | Next.js 16, React 19, TailwindCSS 4 | UI with chat-style transcript, tabbed reports |
| Backend | FastAPI, Uvicorn, Python 3.12 | REST API server |
| Speech-to-Text | Deepgram Nova-2 | Transcription with diarization |
| Text-to-Speech | Deepgram Aura | Audio brief generation |
| LLM | Google Gemini 3.1 Flash Lite | Role identification & report generation |
| PDF Export | jsPDF (client-side) | One-click PDF download |
| Animations | Framer Motion | Smooth UI transitions |
Automated-Sales-Proposal-Engine/
βββ backend/
β βββ main.py # FastAPI app (3 endpoints)
β βββ utils/
β βββ deepgram_client.py # Deepgram STT & TTS
β βββ gemini_client.py # Gemini role ID & reports
β βββ audio_processor.py # Utterance normalization
βββ frontend/
β βββ src/
β β βββ app/
β β β βββ page.tsx # Main React UI
β β β βββ layout.tsx # App layout & metadata
β β β βββ globals.css # Global styles
β β βββ lib/
β β βββ utils.ts # cn() utility
β βββ package.json
β βββ tsconfig.json
βββ data/
β βββ transcripts/
β βββ sales_call_001.txt # Sample transcript
βββ output/ # Generated files directory
βββ .env.example # Environment variables template
βββ requirements.txt # Python dependencies
βββ Dockerfile # Backend container
βββ README.md
- Python 3.12+
- Node.js 18+
- Deepgram API Key β Get one free
- Google Gemini API Key β Get one free
git clone https://github.com/your-username/Automated-Sales-Proposal-Engine.git
cd Automated-Sales-Proposal-Engine
# Create Python virtual environment
python -m venv venv
# Activate venv
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activatecp .env.example .envEdit .env and add your keys:
DEEPGRAM_API_KEY=your_deepgram_api_key_here
GEMINI_API_KEY=your_gemini_api_key_herepip install -r requirements.txt
python backend/main.pyBackend runs at http://localhost:8000
cd frontend
npm install
npm run devFrontend runs at http://localhost:3000
- Open http://localhost:3000
- Upload a sales call recording (MP3, WAV, M4A β max 25MB)
- Click Start Analysis
- View transcript, summary, pain points, action items, and draft proposal
- Export as PDF, Markdown, or send via email
| Method | Endpoint | Description | Request | Response |
|---|---|---|---|---|
GET |
/api/health |
Health check | β | { "status": "ok" } |
POST |
/api/analyze |
Analyze audio file | multipart/form-data (file) |
Transcript + roles + report |
POST |
/api/tts |
Generate audio brief | { "text": "..." } |
MP3 audio file |
POST |
/api/email-report |
Email report | { "to_email", "subject", "report_html" } |
{ "success": true } |
{
"transcript": [
{ "speaker": 0, "text": "Thanks for meeting today...", "start": 0.0, "end": 3.2 }
],
"roles": { "0": "Sales Rep", "1": "Client" },
"report": {
"executive_summary": "...",
"pain_points": ["High ticket volume", "Slow response times"],
"action_items": [{ "task": "Send proposal", "owner": "Sales Rep", "by_date": "Friday" }],
"suggested_proposal_markdown": "# Proposal for...",
"tts_summary": "This call covered..."
},
"metadata": {
"filename": "call.mp3",
"duration_seconds": 120,
"speakers_count": 2
}
}# Build the backend image
docker build -t salesai-backend .
# Run with environment variables
docker run -p 8000:8000 \
-e DEEPGRAM_API_KEY=your_key \
-e GEMINI_API_KEY=your_key \
salesai-backend| Variable | Required | Description |
|---|---|---|
DEEPGRAM_API_KEY |
β | Deepgram API key for STT & TTS |
GEMINI_API_KEY |
β | Google Gemini API key for LLM |
SMTP_HOST |
β | SMTP server for email (default: smtp.gmail.com) |
SMTP_PORT |
β | SMTP port (default: 587) |
SMTP_USER |
β | SMTP username for sending emails |
SMTP_PASS |
β | SMTP password |
MIT
Built with β€οΈ using Deepgram + Gemini + Next.js + FastAPI


