# RAGify
## Overview
RAGify is a powerful framework for implementing Retrieval-Augmented Generation (RAG) systems using OpenAI's models and ChromaDB for embedding storage and retrieval. This approach combines the strengths of large language models (LLMs) with a retrieval system, allowing the model to generate informed responses based on specific data or knowledge bases.
## What is Retrieval-Augmented Generation?
Retrieval-Augmented Generation is a method that enhances the capabilities of generative models by integrating an external knowledge retrieval mechanism. This allows the model to access up-to-date and relevant information during the response generation process, significantly improving the quality and accuracy of the outputs.
### Key Features
- **Dynamic Knowledge Retrieval:** Access and utilize specific datasets or documents to inform responses.
- **Seamless Integration:** Built-in support for OpenAI's language models and embedding functions.
- **User-Friendly Interface:** An intuitive Streamlit application for easy interaction.
## Use Cases
RAG is particularly useful for various applications, including:
- **Question & Answer Systems:** Answer user queries with specific, domain-related information. This is ideal for knowledge bases, customer support systems, and educational platforms.
- **Intelligent Search:** Provide users with enhanced search capabilities that return contextually relevant answers rather than just document links.
## Getting Started
### Prerequisites
- Python 3.8 or higher
- Access to OpenAI API (an API key)
- ChromaDB for embedding storage
### Installation
1. Clone the repository:
```bash
git clone https://github.com/bdeva1975/RAGify.git
cd RAGify-
Install the required packages:
pip install -r requirements.txt
-
Set up your environment variables: Create a
.envfile in the root directory of the project and add your OpenAI API key:OPENAI_API_KEY=your_openai_api_key
-
Launch the Streamlit application:
streamlit run rag_app.py
-
Open your web browser and go to
http://localhost:8501to interact with the RAGify application.
-
rag_lib.py: This module contains the core logic for RAG, including functions for managing collections, querying embeddings, and generating responses using OpenAI. -
rag_app.py: The Streamlit application that serves as the user interface for interacting with the RAG system.
-
Input Your Query: Type a question in the provided text area.
-
Generate Response: Click the "Go" button to retrieve an answer. The system will fetch relevant documents and provide an answer based on the retrieved information.
-
View Search Results: Expand the section to see the documents used to generate the answer.
We welcome contributions to enhance RAGify! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature). - Make your changes and commit them (
git commit -m 'Add your feature'). - Push to your branch (
git push origin feature/YourFeature). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for their powerful language models.
- ChromaDB for providing an excellent embedding storage solution.
Feel free to modify any sections to better fit your project's specifics or add any additional information you think is necessary!