Skip to main content

Ragrid Library

Overview

Ragrid 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.

Why ragrid ?

Ragrid is a powerful and user-friendly library that empowers researchers and developers to achieve state-of-the-art performance in their RAG workflows. By automating parameter selection, offering a range of intelligent chunking methods, and ensuring seamless compatibility, Ragrid simplifies the RAG process and unlocks its full potential. If you're looking to streamline your RAG development and achieve optimal results, Ragrid is the perfect library to elevate your Gen AI projects.

Why we are best?

Ragrid revolutionizes the process of Retrieval-Augmented Generation (RAG) by offering unparalleled efficiency and optimization. With its adaptive chunking capability, Ragrid intelligently selects the most suitable chunking method for each document, ensuring superior performance across diverse datasets. Ragrid eliminates the need for tedious manual best configuration selection, allowing researchers and developers to focus on the core aspects of their Gen AI projects. Moreover, its commitment to continuous improvement ensures that Ragrid remains at the forefront of RAG technology, making it the ultimate choice for streamlining RAG workflows and achieving optimal results in Gen AI tasks.

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

Supported Python versions >= 3.9 and <= 3.11

Installation

To get started, install the ragrid library using the following command:

pip install ragrid

To verify the installation and view library details, execute:

pip show ragrid

Setting Up Your Environment

Before diving into the functionality of ragrid, ensure that your environment variables are properly configured with your OpenAI API key and your Hugging Face token:

import os

os.environ['OPENAI_API_KEY'] = "YOUR_OPENAI_API_KEY"

Note :- API Key from Free tier OpenAI account is not supported.

Usage

The following steps guide you through the process of utilizing the ragrid library to optimize your RAG parameters:

import ragrid as rg

# Specify the path to your PDF document
file_path = "PATH_TO_YOUR_PDF_FILE"

# Initialize the RAG-X instance
model = rg.ChunkEvaluator(file_path)

# Generate the optimal RAG parameters for your document
score_card = model.evaluate_parameters()

# Output the results
print(score_card)

Set parameters for evaluation

If you wish to analyse the performance of your parameters, you can pass the parameters as below:

kwarg = {
        'number_of_questions': 5, # Number of questions used to evaluate the process: type(int)
        'chunk_size': 250, # Chunk size: type(int)
        'chunk_overlap': 0, # Chunk overlap size: type(int)
        'separator': '',  # Separator to be used for chunking if any, type(str)
        'strip_whitespace': False, # Strip white space, type(bool)
        'sentence_buffer_window': 3, # Sentence Buffer window, type(int) 
        'sentence_cutoff_percentile': 80, # Sentence chunk split percentile for spliting context, type(int), range(1,100)
        }

# Specify the path to your PDF document
file_path = "PATH_TO_YOUR_PDF_FILE"

# Initialize the ragrid instance
model = rg.ChunkEvaluator(file_path, **kwargs)

# Generate the optimal RAG parameters for your document
score_card = model.evaluate_parameters()

# Output the results, output will be a pandas dataframe
print(score_card)

Contribution

We are open for contributions and any feedback from the users. Feel free to contact us.

Contact Us:

If you wish to integarte GenAI into your company, please contact us.

Struggling to implement Gen AI in your company or product?

Book a call at https://topmate.io/deepakchawla1307

Metadata

Release files for yajendra 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yajendra 1.0.1
File Size Uploaded Provenance Actions
yajendra-1.0.1.tar.gz 14.9 kB Without provenance Details for yajendra-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for yajendra 1.0.1
File Interpreter ABI Platform Actions
yajendra-1.0.1-py3-none-any.whl Python 3 none any Details for yajendra-1.0.1-py3-none-any.whl

Total release size: 30.6 kB

Release files / yajendra-1.0.1.tar.gz

Download URL yajendra-1.0.1.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
aecd49d7f53ea2a91aa6b3871126d9fb5d254319c2980044a76c0a96780e60e9
BLAKE2b-256 checksum
How to use checksums
520855e41bd31e0dc650cffca4b77a6ea7e6ec9500e872902cdc4a95fd845c01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.5

Release files / yajendra-1.0.1-py3-none-any.whl

Download URL yajendra-1.0.1-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
837b2db7e1dafe4467a496536f114783fdbb8994f584bcdfdc8c85b3bdc9566b
BLAKE2b-256 checksum
How to use checksums
616fc1e7fef3afba1b21d81a988b441ae338b140bd88bc10718726ef60e36bd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.5

Security for yajendra 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page