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.
┌─────────────────┐ 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)
- 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.
- Python 3.10+
- Node.js 18+
- API Keys: Deepgram, OpenAI (or Groq)
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.txtCreate 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 modelsTo populate the FAISS knowledge store so the AI has context, run the ingestion script mapping product_knowledge.txt to vector embeddings:
python ingest.pyThis generates a faiss_index/ directory in the backend.
uvicorn app.main:app --reloadThe WebSocket API will now listen on ws://localhost:8000/ws/call
Open a new terminal and navigate to the frontend directory:
cd frontend
# Install package dependencies
npm install
# Start the Vite development server
npm run devThe UI will launch on http://localhost:5173.
- Ensure the Backend Server (
uvicorn) and Frontend Server (vite) are running. - Ensure you have run python
ingest.pyat least once so the RAG vector store is built. - Open the UI at http://localhost:5173.
- Click Start Call and grant microphone permissions in your browser.
- Begin talking! Simulate a sales call ("We are worried about price...").
- 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!