This project integrates a WhatsApp bot with Langchain and OpenAI's GPT-4o-mini to provide intelligent responses to user messages. It leverages WhatsApp Web for messaging and utilizes GPT-4o-mini for generating AI-powered responses.
This project integrates a WhatsApp bot with Langchain and OpenAI gpt-4o-mini to provide intelligent responses to user messages. It uses the WhatsApp Web for messaging and it uses GPT-4o-mini for generating responses.
First, clone the repository to your local machine using the following command:
git clone https://github.com/RaheesAhmed/Personal-WhatsApp-Assistant.git
cd Personal-WhatsApp-Assistant
Install the required npm packages:
npm i
Ensure you have the necessary API keys and configuration set up for the OpenAI API and WhatsApp Web client. These settings can typically be added in an environment configuration file (e.g., `.env`).
OPENAI_API_KEY=add your api key here
To start the application, run:
node index.js
Scan the generated QR code with your WhatsApp mobile app to authenticate.
Once authenticated, the bot will respond to incoming messages with AI-generated responses.
index.js
: Main entry point for the WhatsApp botchat_with_assistant.js
: AI model integration and document processingdata/
: Directory for storing documents used for AI contextData.index
: Persistent vector store for improved performancechat_with_assistant.js
DirectoryLoader
configuration in chat_with_assistant.js
If you encounter any issues:
Contributions are welcome! Please fork the repository and create a pull request with your changes.