Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/debugger404/rag-powered-gpt-4-chatbot
π Revolutionize your data interaction with a cutting-edge chatbot built on Retrieval-Augmented Generation (RAG) and OpenAIβs GPT-4. Upload documents, create custom knowledge bases, and get precise, contextual answers. Ideal for research, business operations, customer support, and more!
https://github.com/debugger404/rag-powered-gpt-4-chatbot
ai-chatbot ai-powered-chatbot azure-openai business-chatbot custom-knowledge-base customer-support-chatbot document-chatbot document-processing gpt-4 knowledge-management knowledge-retrieval machine-learning-chatbot natural-language-processing openai pdf-search rag research-chatbot retrieval-augmented-generation semantic-search vector-database
Last synced: 9 days ago
JSON representation
π Revolutionize your data interaction with a cutting-edge chatbot built on Retrieval-Augmented Generation (RAG) and OpenAIβs GPT-4. Upload documents, create custom knowledge bases, and get precise, contextual answers. Ideal for research, business operations, customer support, and more!
- Host: GitHub
- URL: https://github.com/debugger404/rag-powered-gpt-4-chatbot
- Owner: deBUGger404
- License: mit
- Created: 2024-09-06T16:03:01.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-11T18:37:17.000Z (2 months ago)
- Last Synced: 2024-09-12T04:54:32.404Z (2 months ago)
- Topics: ai-chatbot, ai-powered-chatbot, azure-openai, business-chatbot, custom-knowledge-base, customer-support-chatbot, document-chatbot, document-processing, gpt-4, knowledge-management, knowledge-retrieval, machine-learning-chatbot, natural-language-processing, openai, pdf-search, rag, research-chatbot, retrieval-augmented-generation, semantic-search, vector-database
- Language: HTML
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RAG-Powered GPT-4 Chatbot: AI-Based Knowledge Retrieval
π Revolutionize data interaction with a chatbot built using **Retrieval-Augmented Generation (RAG)** and **OpenAIβs GPT-4**. Upload documents, create custom knowledge bases, and get precise, contextual answers for research, business operations, and customer support.
## Table of Contents
1. [Introduction](#introduction)
2. [Key Features](#key-features)
3. [Use Cases](#use-cases)
4. [How It Works](#how-it-works)
5. [Getting Started](#getting-started)
6. [File Structure](#file-structure)
7. [Contributing](#contributing)
8. [License](#license)## Introduction
The RAG-powered chatbot combines retrieval and generative AI to help users access specific information from custom data sources. By uploading your documents, the chatbot can pull the most relevant data from your files, ensuring high accuracy and up-to-date answers.## Key Features
- **Upload Documents**: Add PDFs or other documents that will be chunked into manageable parts and stored as vectors in a database.
- **Custom Knowledge Base**: Create a searchable knowledge base from your uploaded files.
- **Persistent Database**: Save, retrieve, and reuse your knowledge base at any time.
- **Accurate Responses**: Get context-aware answers based on the data in your custom knowledge base.## Use Cases
- **Research**: Analyze large datasets, studies, and research papers by querying relevant information.
- **Business Operations**: Access internal documents and policies quickly for better decision-making.
- **Customer Support**: Create a chatbot that instantly pulls data from FAQs or product manuals.
- **Training & Onboarding**: Provide new hires with instant access to key internal documents and training materials.## How It Works
1. **Upload Documents**:
- Upload PDF or text files to the system.
- The files are automatically split into smaller sections and converted into vectors for efficient searching.
2. **Create Knowledge Base**:
- The system builds a custom knowledge base from the uploaded documents.
- This knowledge base can be searched using natural language queries.3. **Query Knowledge Base**:
- Use the chatbot interface to ask questions.
- The system retrieves the most relevant information from the knowledge base using semantic search.4. **Persistent Database**:
- Save your uploaded files and databases for future access.
- Reuse or modify the knowledge base without the need to re-upload files.## Getting Started
### Prerequisites
- **Python 3.x**
- **Azure OpenAI API Key** for GPT-4 integration### Installation
1. **Clone the repository**:
```bash
git clone https://github.com/your-username/rag-powered-gpt4-chatbot.git
cd rag-powered-gpt4-chatbot
```2. **Set up a virtual environment**:
```bash
python -m venv ragvenv
source ragvenv/bin/activate
```3. **Install dependencies**:
```bash
pip install -r requirements.txt
```4. **Configure Azure OpenAI Credentials**:
- Open the `config.env` file and add the following Azure OpenAI credentials:
```bash
AZURE_OPENAI_ENDPOINT="your-azure-openai-endpoint"
AZURE_OPENAI_API_KEY="your-azure-openai-api-key"
API_VERSION="2024-02-15-preview"
```5. **Run the application**:
```bash
python app.py
```6. **Access the application**:
- Open your browser and go to `http://localhost:8000`.### Using the Application
1. **Upload a file**:
- Navigate to the "Upload File" section of the app.
- Select a PDF or other document to upload.
2. **Create a knowledge base**:
- The uploaded document will be processed and split into chunks.
- A custom knowledge base is created from these chunks and stored for future queries.3. **Query the chatbot**:
- Type your questions in the chatbot input field.
- The chatbot will retrieve relevant information from the custom knowledge base based on your query.4. **Access previous databases**:
- Use the dropdown menu to access and query previously created databases.## File Structure
```plaintext
π rag-powered-gpt4-chatbot/
βββ app.py # Main application script
βββ config.env # Configuration file for API keys
βββ database/ # Folder for storing database files
βββ rag_app.log # Log file for tracking application events
βββ requirements.txt # Python dependencies
βββ static/ # Static files like CSS
β βββ styles.css # CSS file for basic styling
βββ templates/ # HTML templates for the app interface
β βββ index.html # Main page of the app
βββ upload_file/ # Directory for storing uploaded files
βββ utils.py # Utility functions```
Contributing
------------
Contributions are welcome! Please open an issue or submit a pull request if you'd like to add new features or fix bugs.License
-------
This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.---