Skip to content

About

An Agentic call bot for various company purposes.

Resources

Stars

1 star

Watchers

0 watching

Forks

 
 

Latest commit

 

History

45 Commits

Folders and files

Repository files navigation

Virtual Telecaller

An AI-powered conversational telecalling assistant that automates and handles voice call workflows in real-time. It integrates a Next.js web application with a Flask voice-processing server to initiate automated calls, query business knowledge bases, and log transcripts directly to a MongoDB database.


1. Project Overview

Virtual Telecaller acts as an autonomous support representative. When a call is placed, it establishes a two-way audio stream via Twilio, processes voice input using speech-to-text, queries an LLM configured with custom business context, and converts the LLM's response back to audio for the caller.

Key Features

  • Interactive Dashboard: Initiate voice calls, configure system prompts, and manage call queues directly from the UI.
  • Retrieval-Augmented Generation (RAG): Uses LangChain/LangGraph and Pinecone vector database to supply the AI with accurate, real-time business context.
  • Real-time Call Analytics: Stores call logs, status events, and complete transcripts in MongoDB.
  • Production-Ready Webhooks: Ready for local development with ngrok or production deployment on platforms like Render.

Technology Stack

  • Frontend: Next.js (TypeScript, Tailwind CSS, Clerk Authentication)
  • Backend: Flask, Gunicorn, Gevent
  • AI & Orchestration: LangChain, LangGraph, Groq (Llama-3.3-70b-versatile)
  • Databases: Pinecone (Vector database for RAG context), MongoDB (Call analytics & history)
  • Communication APIs: Twilio Voice API

2. Installation Steps

Prerequisites

Make sure you have the following installed:


Backend Setup

  1. Navigate to the backend/ directory:

    cd backend
    
  2. Create and activate a Python virtual environment:

    python3 -m venv venv
    source venv/bin/activate
    
  3. Install the required dependencies:

    pip install -r requirements.txt
    
  4. Configure the environment variables:

    • Copy the .env.example file to .env:
      cp .env.example .env
      
    • Open .env and fill in your API credentials:
      • MongoDB Note: If your password contains special characters (like @), make sure to URL-encode them (e.g., replace @ with %40).

Frontend Setup

  1. Navigate to the frontend/ directory:

    cd frontend
    
  2. Install the Node packages:

    npm install
    
  3. Configure the environment variables:

    • Copy the .env.example file to .env:
      cp .env.example .env
      
    • Fill in your Clerk keys, MongoDB URI, and set the backend URL pointing to your local Flask server:
      NEXT_PUBLIC_BACKEND_URL=http://localhost:5000
      

3. Starting the Project

Follow these steps to run the application locally for testing:

Step 1: Start the Local Tunnel (ngrok)

Since Twilio needs to send HTTP requests (Webhooks) back to your local machine when the call connects, you must expose your local port 5000 to the internet.

  1. Open a new terminal and run:
    ngrok http 5000
    
  2. Copy the forwarding HTTPS URL generated by ngrok (e.g., https://xxxx-xxxx.ngrok-free.dev).
  3. Update backend/voice_call.py (lines 45–46) to point to your new ngrok endpoints:
    hosted_url_call = "https://xxxx-xxxx.ngrok-free.dev/voice"
    hosted_url_call_status = "https://xxxx-xxxx.ngrok-free.dev/call_status"
    

(Note: Whenever you restart ngrok on a free plan, you will get a new URL and must update these lines.)

Step 2: Start the Backend Server

  1. Switch to your backend terminal (ensure the virtual environment is active).
  2. Run the application using the WSGI server:
    gunicorn -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 -b 0.0.0.0:5000 voice_call:app
    

Step 3: Start the Frontend Application

  1. Switch to your frontend terminal.
  2. Run the Next.js development server:
    npm run dev
    
  3. Open your browser and navigate to http://localhost:3000.

4. How to Test

  1. Log in via Clerk on the frontend.
  2. Head to the Dashboard / Make Call section.
  3. Input your target customer context:
    • Business Name & Business Info (for the AI context).
    • System Prompt (how the AI should introduce itself and respond).
    • Source Phone Number (your Twilio number, formatted as +1XXXXXXXXXX).
    • Destination Phone Number (your mobile number to receive the call, formatted as +91XXXXXXXXXX).
  4. Click Initiate Calls.
  5. Receive the call on your phone, talk to the virtual assistant, and watch the conversation transcripts update in real-time in the web UI!

About

An Agentic call bot for various company purposes.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages