ConvoPro is an innovative conversational platform designed to enhance communication and engagement through intelligent dialogue systems. With a focus on user-centric design, ConvoPro enables seamless interactions, making it ideal for businesses looking to improve customer service, automate responses, schedule appointments and facilitate meaningful conversations.
This project supports both text and call services, utilizing the OpenAI Chat Completions model for text interactions and the OpenAI RealTime API Beta for voice communication. Unlike traditional voice agents that rely on a speech-to-text-to-text-speech approach, ConvoPro leverages advanced speech-to-speech capabilities, providing a more natural and efficient conversational experience.
ConvoPro empowers developers and organizations to build robust conversational agents that can adapt to various contexts and user needs, ultimately driving better outcomes and satisfaction.
- Real-time voice communication using WebSocket and OpenAI RealTime API Beta
- Text-based chat functionality using OpenAI Chat Completions model
- Intelligent appointment scheduling system
- Vector store integration for knowledge base management
- Session management with timeout handling
- Rate limiting and error handling
- Comprehensive logging system
- CORS support for cross-origin requests
The application is structured into several key components:
main_app.py
- Application entry point and configurationapp_call.py
- Voice communication handlingapp_text.py
- Text communication handlingstorage.py
- Vector store and data persistenceai_output.py
- AI model integrationappointment_call.py
- Appointment scheduling logic
graph TB
subgraph Client
WA[WhatsApp Client]
VC[Voice Client]
end
subgraph FastAPI_Backend["FastAPI Backend"]
subgraph Controllers
MA[Main App]
TC[Text Controller]
CC[Call Controller]
end
subgraph Core_Services
AW[Appointment Workflow]
VS[Vector Store]
AI[AI Output]
end
%% Controller connections
MA --> TC
MA --> CC
%% Service connections
TC --> AW
CC --> AW
TC --> VS
CC --> VS
TC --> AI
CC --> AI
end
subgraph External_Services["External Services"]
subgraph OpenAI["OpenAI Services"]
CM[Chat Model]
EM[Embeddings Model]
RT[Real-time API]
end
subgraph Communication
TW[Twilio Service]
end
subgraph Storage_Services
DL[DeepLake]
end
subgraph Automation
MK[Make.com Workflow]
end
end
subgraph Data_Storage["Data Storage"]
VDB[(Vector Database)]
CD[(Company Details)]
end
%% Client to Backend connections
WA -->|WhatsApp Messages| TC
VC -->|Voice Calls| CC
%% Backend to OpenAI
TC -->|Text Processing| CM
CC -->|Voice Processing| RT
VS -->|Generate Embeddings| EM
%% Backend to Other Services
VS -->|Store Embeddings| DL
AW -->|Schedule Appointment| MK
%% Storage connections
VS --> VDB
TC --> CD
CC --> CD
%% External service connections
TW --> TC
TW --> CC
DL --> VDB
%% Styling
classDef clientStyle fill:#ffe6e6,stroke:#333,stroke-width:2px
classDef backendStyle fill:#e6f3ff,stroke:#333,stroke-width:2px
classDef externalStyle fill:#f0fff0,stroke:#333,stroke-width:2px
classDef storageStyle fill:#fff0f5,stroke:#333,stroke-width:2px
classDef controllerStyle fill:#f5f5f5,stroke:#333,stroke-width:2px
classDef serviceStyle fill:#f0f8ff,stroke:#333,stroke-width:2px
class Client clientStyle
class FastAPI_Backend backendStyle
class External_Services externalStyle
class Data_Storage storageStyle
class Controllers controllerStyle
class Core_Services serviceStyle
- Python 3.9+
- FastAPI (for API endpoints)
- OpenAI (for LLM and Embeddings)
- Langchain (for LLM integration)
- Activeloop Token (for DeepLake vector store)
- Twilio account (for WhatsApp and Voice functionality)
- Ngrok (for local server hosting)
- Make.com (for scheduling appointments workflow)
git clone https://github.com/yourusername/ConvoPro.git
cd ConvoPro
python -m venv convo-pro-env
source convo-pro-env/bin/activate
pip install -r requirements.txt
Activeloop provides vector databse to storage embeddings from the data gathered. This will be retrieved by the underlying LLM (in this case GPT-4o) to retrieve relevant information for user queries.
Create your ActiveLoop account by going tothis link : https://app.activeloop.ai/
Create an ActiveLoop Token and paste it securely in a file, this will be useful to connect your app with the databse.
Further you need to create an organization (a project like structure where all you dataset will be store) on activeloop and copy the name of the organization you created
Go to this link https://openai.com/index/openai-api/
To access the Embeddings and GPT model in the app, you'll need to add some OpenAI credits. For personal use, it doesn't require much—you can start with as little as $5-$10, which should be enough to last 2-3 months depending on your usage.
Sign up and create your OpenAI API Key. Copy the api key and store it securely.
Setup a Twilio account and get your Twilio Account SID and Auth Token from the Twilio dashboard.
Sign up for a phone number under the Phone Numbers section which should cost around $1-$1.5 per month. Save the phone number in a file securely.
Setup WhatsApp Sandbox environment for testing or upgrade to paid plan under the Messaging section.
Go to this link https://make.com/
Create an account and go to the scenario section and create a new scenario.
Look for the more icon in the control sections and select export scenario. Browse the blueprint provided in the repository name as make_blueprint.json and import it into your scenario.
Once the scenario is imported, you shoudl be able to see the a webhook url when you click on the webhook module. Copy the webhook url and store it securely in a file.
Open the .env file replace the respective place holders with your API keys
.env
ACTIVELOOP_TOKEN="<YOUR_ACTIVELOOP_TOKEN>"
OPENAI_API_KEY="<YOUR_OPENAI_API_KEY>"
TWILIO_ACCOUNT_SID="<YOUR_TWILIO_ACCOUNT_SID>"
TWILIO_AUTH_TOKEN="<YOUR_TWILIO_AUTH_TOKEN>"
TWILIO_PHONE_NUMBER="<YOUR_TWILIO_PHONE_NUMBER>"
WEBHOOK_URL="<YOUR_MAKE_COM_WEBHOOK_URL>"
Open vectordb.py script and replace the organization name placeholder with the one you created and the dataset name placeholder with the name of the deeplake dataset you want to create.
Note: You only need to create the organization on ActiveLoop, the dataset will be created at the runtime with the name you provided on it own.
storage.py
self.activeloop_org = "<YOUR_ACTIVELOOP_ORGANISATION_NAME>" # replace with your ActiveLoop organisation name
self.activeloop_dataset = "<DATASET_NAME>" # replace with your ActiveLoop dataset name you want to be created
Go to this link https://ngrok.com/
Download and install ngrok and get the authtoken.
There is an exmaple_knowledge_base file that exists. You can use that for trial purpose or update it with your own
Run the storage.py file
python storage.py
python main_app.py
Run ngrok by typing ngrok http 8000
in the terminal.
Copy the https url provided by ngrok and go to the Twilio console.
In the WhatsApp sandbox, go to the settings section and select the edit option for the sandbox number.
Paste the https url in the whatsapp sandbox setting in thsi format:
In the Phone Number settings, find the active number and paste the https url in the webhook section in this format:
You can now test the app by sending a message to the WhatsApp sandbox number or making a call to the active number. Have a conversation about the products or service or try booking an appointment.
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project makes use of several open-source libraries and services:
Special thanks to all contributors who have helped shape this project.
This project is licensed under the MIT License - see the LICENSE file for details.