This project aims to build a chatbot & Voice Assistant that responds to the custom data. The Chatbot works with a specific domain related to the IT Industry. The interface is built with React and styled using Tailwind CSS. The backend is powered by Django, and it integrates with Google Generative AI for processing PDF documents to provide responses.
- Handles user input and displays bot responses
- Shows a loading indicator while waiting for a response
- Integrates with a Django backend
- Utilizes Google Generative AI for processing and responding based on PDF document content
- Faiss-cpu as the Vector DB.
- React
- react-speech-recognition
- Tailwind CSS
- Django
- Google Generative AI(Gemini)
- PyPDF2
- LangChain
- FAISS
- LangChain-Google-GenAI
- Node.js (v14 or later)
- Python (v3.8 or later)
- pip
- Django (v3.2 or later)
- A Google API Key for Google Generative AI
-
Clone the repository:
git clone https://github.com/chandima2000/custom-chatbot-with-langchain-gemini.git cd frontend
-
Install the dependencies:
npm install
-
Run the project
npm run dev
-
Run the development server:
Open your browser and go to
http://localhost:5173/
- Navigate to the backend folder
cd backend
- Create a virtual environment: (windows)
python -m venv venv
- Activate the virtual environment: (windows)
venv\Scripts\activate
- Install the dependencies:
pip install -r requirements.txt
- Set up environment variables:
- Create a .env file in the backend directory with the following content:
GOOGLE_API_KEY=your_google_api_key
- Start the Django development server:
python manage.py runserver
- Open your browser and go to http://localhost:5173/ for the frontend.
- Type a message in the chat input and press Send.
- The chatbot will respond after fetching the answer from the backend.
The backend is implemented using Django and integrates Google Generative AI for processing. Here's an overview of the core functionality:
- PDF Processing: The backend reads a PDF document and splits it into chunks.
- Vector Store: It creates a vector store using FAISS to perform similarity searches.
- Google Generative AI: It utilizes Google Generative AI for embeddings and conversational chains.
- LangChain: Simplify the process of building applications that utilize language models
- API Endpoint: The backend exposes an endpoint to handle chat requests and provide responses based on the PDF content.
All contributions are welcome. Feel free to open issues or submit pull requests.