Skip to main content

RAG-select

A framework for experimenting with and optimizing Retrieval-Augmented Generation (RAG) pipeline architectures.

Overview

This package provides a framework for testing different RAG pipeline configurations and measuring their performance. It supports pluggable components for document ingestion, chunking strategies, and retrieval methods.

Features

  • Modular Architecture: Pluggable components across the ingestion and retrieval stack with sample wrappers over top open-source component offerings.
  • Experiment Pipeline: Generate and test all combinations of component variants
  • LangChain Integration: RAGArtifact extends BaseRetriever for seamless use with LangChain chains

Installation

pip install rag_select

Quick Start

To set up an experiment with RAG-select, follow these steps:

  1. Prepare Your Dataset and Documents

    • dataset: This should be your evaluation set (e.g., queries and ground-truths).
    • documents: The corpus to be indexed and retrieved from.
  2. Define Component Variants

    • Specify different variants for each pipeline stage. Import and instantiate implementations as needed.

    Example:

    from rag_select.parameter_impls.chunking_impls import SlidingWindowChunking
    from rag_select.parameter_impls.embedding_impls import HuggingFaceEmbedding
    from rag_select.parameter_impls.retriever_impls import SimpleRetriever
    
    chunking_variants = [
        SlidingWindowChunking(chunk_size=256, chunk_overlap=20),
        SlidingWindowChunking(chunk_size=512, chunk_overlap=50),
    ]
    embedding_variants = [
        HuggingFaceEmbedding(model_name="sentence-transformers/all-MiniLM-L6-v2"),
    ]
    retriever_variants = [
        SimpleRetriever(top_k=3),
        SimpleRetriever(top_k=5),
    ]
    
  3. Run the Experiment

    • Instantiate the RAGExperiment and call .run() to evaluate all pipeline combinations.
    • Review, compare, or rank the results.

    Example:

    from rag_select.experiment.rag_experiment import RAGExperiment
    
    experiment = RAGExperiment(
        dataset=eval_dataset,
        documents=documents,
        search_space={
            "chunking": chunking_variants,
            "embedding": embedding_variants,
            "retriever": retriever_variants,
        },
        metrics=["precision@3", "precision@5", "recall@5", "mrr"],
    )
    
    results = experiment.run()
    
    # Rank pipelines by a metric
    ranked = results.rank(by="precision@5")
    
    # Get the best pipeline config
    best = results.get_best_pipeline()
    
  4. Extending the Search Space

    • To experiment with ingestion or storage variants, include them as keys in search_space and provide corresponding implementations.

License

MIT

Metadata

Release files for rag-select 0.1.3

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

Source distribution (sdist)

Source distribution for rag-select 0.1.3
File Size Uploaded Provenance Actions
rag_select-0.1.3.tar.gz 39.6 kB With provenance Details for rag_select-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rag-select 0.1.3
File Interpreter ABI Platform Actions
rag_select-0.1.3-py3-none-any.whl Python 3 none any Details for rag_select-0.1.3-py3-none-any.whl

Total release size: 115.6 kB

Release files / rag_select-0.1.3.tar.gz

Download URL rag_select-0.1.3.tar.gz
Size 39.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5608f183379e5bbd823c1c964121b5d2a051dbc3d0f5f493b82bd43f85b26b18
BLAKE2b-256 checksum
How to use checksums
c38ec815d8e872af576cfce7ef696d03239a8bba9987b482dccc639feef64c8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 14, 2026.

Transparency log

Release files / rag_select-0.1.3-py3-none-any.whl

Download URL rag_select-0.1.3-py3-none-any.whl
Size 76.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0616e43599e4778ce2e5e535c90089bb4f081c1766f1a4848d6bfa079e205b42
BLAKE2b-256 checksum
How to use checksums
8759c4f2ed428209183b86089a9eb32f9bcc15ce127ff8e34434518a135564a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 14, 2026.

Transparency log

Security for rag-select 0.1.3

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rag_select-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 14, 2026.

Transparency log

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.

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