RAG-metrics-2


NameRAG-metrics-2 JSON
Version 0.0.1.29 PyPI version JSON
download
home_pagehttps://github.com/hidevscommunity/gen-ai-library/tree/main/Ankit
SummaryThis library is to search the best parameters across different steps of the RAG process.
upload_time2024-04-05 05:20:03
maintainerNone
docs_urlNone
authorAnkit
requires_pythonNone
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
---

# 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-metrics-2",
    "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/34/84/b8be8147a87163b77950439888f1cdb2d2ae9dfb91f9d71e47377fa57f4c/RAG_metrics_2-0.0.1.29.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.29",
    "project_urls": {
        "Homepage": "https://github.com/hidevscommunity/gen-ai-library/tree/main/Ankit"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3484b8be8147a87163b77950439888f1cdb2d2ae9dfb91f9d71e47377fa57f4c",
                "md5": "ffee64986989ec0b7cc4742d897810d1",
                "sha256": "8670b6000272b34da86979c16bfe4faab21ba80cb014ca2af0014f5c4fa8f1ce"
            },
            "downloads": -1,
            "filename": "RAG_metrics_2-0.0.1.29.tar.gz",
            "has_sig": false,
            "md5_digest": "ffee64986989ec0b7cc4742d897810d1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 13151,
            "upload_time": "2024-04-05T05:20:03",
            "upload_time_iso_8601": "2024-04-05T05:20:03.708896Z",
            "url": "https://files.pythonhosted.org/packages/34/84/b8be8147a87163b77950439888f1cdb2d2ae9dfb91f9d71e47377fa57f4c/RAG_metrics_2-0.0.1.29.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-05 05:20:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hidevscommunity",
    "github_project": "gen-ai-library",
    "github_not_found": true,
    "lcname": "rag-metrics-2"
}
        
Elapsed time: 1.30454s