Skip to content

shashank-cs/Real-Time-Sales-Agent-Assist-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time Sales Agent Assist System

A production-grade, full-stack AI system designed to act as a real-time copilot for sales agents. This system streams live audio from a sales call to Deepgram for real-time transcription, processes it through a LangChain RAG pipeline with an underlying FAISS vector store, and generates context-aware, actionable hints via a fast LLM (OpenAI or Groq) directly onto a React dashboard.


🏗 System Architecture

 ┌─────────────────┐        WebSocket Stream     ┌───────────────────┐
 │                 │  --- Audio (PCM16) --->     │                   │
 │ React Frontend  │                             │  FastAPI Backend  │
 │ (Web Audio API) │  <--- Transcripts/Hints --- │  (WebSocket API)  │
 │                 │                             │                   │
 └────────┬────────┘                             └───────┬─▲─────────┘
          │                                              │ │ Audio / Transcripts
        React                                         Deepgram
          │                                              │ │
          ▼                                          ┌───▼─┴───┐
 ┌─────────────────┐                                 │         │  <--- Product Knowledge
 │ Agent Dashboard │                                 │   RAG   │       (FAISS Vector Store)
 │ (Tailwind CSS)  │                                 │ Pipeline│
 └─────────────────┘                                 │         │  <--- GenAI Hints
                                                     └───────┬─┘       (OpenAI / Groq)

✨ Core Features

  • Real-Time Microphone Streaming: Utilizes the modern Web Audio API to capture raw microphone PCM audio directly in the browser and forward it over WebSocket to the backend.
  • Deepgram Live Transcriptions: Integrates seamlessly with Deepgram's streaming endpoints to achieve exceptionally low latency live text transcription.
  • RAG-Powered AI Copilot: Uses a highly cohesive LangChain abstraction to match streaming transcript chunks with relevant sales playbooks or product knowledge locally using FAISS.
  • Dynamic Hints UI: The frontend immediately displays incoming transcript chunks alongside smart, contextually-aware conversational hints and suggested objections via a modern, clean Tailwind CSS interface.

🚀 Setup & Installation

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • API Keys: Deepgram, OpenAI (or Groq)

1. Backend Setup

Open a terminal and navigate to the backend directory:

cd backend

# Create a virtual environment (optional but recommended)
python -m venv venv
# Windows: venv\\Scripts\\activate
# Mac/Linux: source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

Environment Configuration

Create a .env file in the backend/ directory (you can copy .env.example):

OPENAI_API_KEY=your_openai_api_key
DEEPGRAM_API_KEY=your_deepgram_api_key
GROQ_API_KEY=your_groq_api_key
LLM_PROVIDER=openai # Set to 'groq' if you prefer Groq LLaMA models

Data Ingestion (Vector Database setup)

To populate the FAISS knowledge store so the AI has context, run the ingestion script mapping product_knowledge.txt to vector embeddings:

python ingest.py

This generates a faiss_index/ directory in the backend.

Start the Backend Server

uvicorn app.main:app --reload

The WebSocket API will now listen on ws://localhost:8000/ws/call

2. Frontend Setup

Open a new terminal and navigate to the frontend directory:

cd frontend

# Install package dependencies
npm install

# Start the Vite development server
npm run dev

The UI will launch on http://localhost:5173.


⚙️ How To Use

  1. Ensure the Backend Server (uvicorn) and Frontend Server (vite) are running.
  2. Ensure you have run python ingest.py at least once so the RAG vector store is built.
  3. Open the UI at http://localhost:5173.
  4. Click Start Call and grant microphone permissions in your browser.
  5. Begin talking! Simulate a sales call ("We are worried about price...").
  6. The left panel will populate with live transcripts, and the right panel will dynamically push generated agent hints based on product knowledge retrieved via RAG!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors