---
# RAG-X Library
## Overview
RAG-X is a comprehensive library designed to optimize Retrieval-Augmented Generation (RAG) processes. It provides a suite of tools to automatically determine the best parameters for processing specific documents. This includes selecting appropriate chunking techniques, embedding models, vector databases, and Language Model (LLM) configurations.
### Key Features:
- **Adaptive Chunking:** Incorporates four advanced text chunking methodologies to enhance the handling of diverse document structures.
- Specific Text Splitting
- Recursive Text Splitting
- Sentence Window Splitting
- Semantic Window Splitting
- **Expandability:** Future versions will introduce additional chunking strategies and enhancements based on user feedback and ongoing research.
- **Compatibility:** Designed to seamlessly integrate with a wide range of embedding models and vector databases.
## Getting Started
### Prerequisites
Due to existing dependency conflicts, it is crucial to install the required dependencies before using the RAG-X library. We are actively working on a resolution and appreciate your understanding.
```bash
pip install tiktoken chromadb trulens-eval 'unstructured[pdf]' openai -q
```
### Installation
After resolving the dependencies, install the RAG-X library using the following command:
```bash
pip install -i https://test.pypi.org/simple/ RAG-X -q
```
To verify the installation and view library details, execute:
```bash
pip show RAG-X
```
### Setting Up Your Environment
Before diving into the functionality of RAG-X, ensure that your environment variables are properly configured with your OpenAI API key and your Hugging Face token:
```python
import os
os.environ['OPENAI_API_KEY'] = "YOUR_OPENAI_API_KEY"
os.environ['HF_TOKEN'] = "YOUR_HUGGINGFACE_TOKEN"
```
## Usage
The following steps guide you through the process of utilizing the RAG-X library to optimize your RAG parameters:
```python
from RAG_X.prag import parent_class
# Specify the path to your PDF document
file_path = "PATH_TO_YOUR_PDF_FILE"
# Initialize the RAG-X instance
my_instance = parent_class(file_path)
# Generate the optimal RAG parameters for your document
score_card = my_instance.get_best_param()
# Output the results
print(score_card)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/hidevscommunity/gen-ai-library/tree/main/Ankit",
"name": "RAG-X",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Ankit",
"author_email": "a.baliyan008@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/14/aa/10e814425a3e830084edce2d49a3ce3f10ce354a3357e008a403bbc4b95f/RAG_X-0.0.1.12.tar.gz",
"platform": null,
"description": "\r\n---\r\n\r\n# RAG-X Library\r\n\r\n## Overview\r\n\r\nRAG-X is a comprehensive library designed to optimize Retrieval-Augmented Generation (RAG) processes. It provides a suite of tools to automatically determine the best parameters for processing specific documents. This includes selecting appropriate chunking techniques, embedding models, vector databases, and Language Model (LLM) configurations.\r\n\r\n### Key Features:\r\n- **Adaptive Chunking:** Incorporates four advanced text chunking methodologies to enhance the handling of diverse document structures.\r\n - Specific Text Splitting\r\n - Recursive Text Splitting\r\n - Sentence Window Splitting\r\n - Semantic Window Splitting\r\n- **Expandability:** Future versions will introduce additional chunking strategies and enhancements based on user feedback and ongoing research.\r\n- **Compatibility:** Designed to seamlessly integrate with a wide range of embedding models and vector databases.\r\n\r\n## Getting Started\r\n\r\n### Prerequisites\r\n\r\nDue to existing dependency conflicts, it is crucial to install the required dependencies before using the RAG-X library. We are actively working on a resolution and appreciate your understanding.\r\n\r\n```bash\r\npip install tiktoken chromadb trulens-eval 'unstructured[pdf]' openai -q\r\n```\r\n\r\n### Installation\r\n\r\nAfter resolving the dependencies, install the RAG-X library using the following command:\r\n\r\n```bash\r\npip install -i https://test.pypi.org/simple/ RAG-X -q\r\n```\r\n\r\nTo verify the installation and view library details, execute:\r\n\r\n```bash\r\npip show RAG-X\r\n```\r\n\r\n### Setting Up Your Environment\r\n\r\nBefore diving into the functionality of RAG-X, ensure that your environment variables are properly configured with your OpenAI API key and your Hugging Face token:\r\n\r\n```python\r\nimport os\r\n\r\nos.environ['OPENAI_API_KEY'] = \"YOUR_OPENAI_API_KEY\"\r\nos.environ['HF_TOKEN'] = \"YOUR_HUGGINGFACE_TOKEN\"\r\n```\r\n\r\n## Usage\r\n\r\nThe following steps guide you through the process of utilizing the RAG-X library to optimize your RAG parameters:\r\n\r\n```python\r\nfrom RAG_X.prag import parent_class\r\n\r\n# Specify the path to your PDF document\r\nfile_path = \"PATH_TO_YOUR_PDF_FILE\"\r\n\r\n# Initialize the RAG-X instance\r\nmy_instance = parent_class(file_path)\r\n\r\n# Generate the optimal RAG parameters for your document\r\nscore_card = my_instance.get_best_param()\r\n\r\n# Output the results\r\nprint(score_card)\r\n```\r\n\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "This library is to search the best parameters across different steps of the RAG process.",
"version": "0.0.1.12",
"project_urls": {
"Homepage": "https://github.com/hidevscommunity/gen-ai-library/tree/main/Ankit"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "14aa10e814425a3e830084edce2d49a3ce3f10ce354a3357e008a403bbc4b95f",
"md5": "e1514bdd4e24af29bcfea277b839e7fa",
"sha256": "091acaf9612451ab414bf72d824a5550fb20a426e0d7afef7ac5f8bc96e1204a"
},
"downloads": -1,
"filename": "RAG_X-0.0.1.12.tar.gz",
"has_sig": false,
"md5_digest": "e1514bdd4e24af29bcfea277b839e7fa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 13035,
"upload_time": "2024-04-03T16:30:28",
"upload_time_iso_8601": "2024-04-03T16:30:28.988721Z",
"url": "https://files.pythonhosted.org/packages/14/aa/10e814425a3e830084edce2d49a3ce3f10ce354a3357e008a403bbc4b95f/RAG_X-0.0.1.12.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-03 16:30:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hidevscommunity",
"github_project": "gen-ai-library",
"github_not_found": true,
"lcname": "rag-x"
}