This project implements a chat support application using React for the frontend and a Flask backend that processes queries using a Retrieval-Augmented Generation (RAG) pipeline. Users can select a language, send messages, and receive responses from a chatbot powered by machine learning. The application supports multiple document types and stores relevant data using Chroma as the database.
- Interactive Chatbot: Users can interact with a chatbot that responds to queries.
- Language Selection: Supports multiple languages, allowing users to receive answers in their preferred language.
- Dynamic Suggestions: Provides predefined suggestions to enhance user experience.
- RAG Pipeline: Utilizes a RAG pipeline to fetch and process relevant documents and generate responses.
- Link Extraction: Extracts URLs from the context for users to reference.
- Rate Limiting: Implements rate limiting on API requests to ensure fair use.
- Frontend: React
- Backend: Flask
- Database: Chroma
- Natural Language Processing: NLTK, LangChain, Google Generative AI
- Document Loaders: Supports PDF, CSV, and text files
- Deployment: Docker (if applicable)
- Node.js and npm (for the React frontend)
- Python 3.7 or higher (for the Flask backend)
- Virtual environment (recommended for Python)
pip
(Python package manager)
git clone https://github.com/yourusername/chat-support-app.git
cd chat-support-app
-
Navigate to the frontend directory:
cd frontend
-
Install the required npm packages:
npm install
-
Start the development server:
npm run dev
-
Navigate to the backend directory:
cd backend
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required Python packages:
pip install -r requirements.txt
-
Create a
.env
file in the backend directory and add your Google API key:GOOGLE_API_KEY=your_api_key_here
-
Run the Flask application:
python app.py
- Open your browser and go to
http://localhost:5173
(or the port specified by your frontend setup). - Select a language from the dropdown.
- Type your query in the input box and press the send button.
- View the chatbot's response along with any relevant links provided.
- GET /: Returns the main page (frontend).
- POST /predict: Accepts a JSON request with a
message
field to generate a response based on the provided query.
{
"message": "Tell me about Mann Ki Baat | >English"
}
- Users can make a maximum of 10 requests per minute to the
/predict
endpoint.
Contributions are welcome! Please open an issue or submit a pull request for any enhancements or fixes.
This project is licensed under the MIT License. See the LICENSE file for details.
- LangChain for providing the tools for document processing and embeddings.
- NLTK for natural language processing utilities.
- React and Flask for building the frontend and backend.