Skip to main content

RAG Evaluation Framework using Ragas metrics and MLflow tracking

Project description

RAGSentinel

RAG Evaluation Framework using Ragas metrics and MLflow tracking.

Installation

1. Create Virtual Environment

# Create project directory
mkdir my-rag-eval
cd my-rag-eval

# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

2. Install Package

pip install rag-sentinel

Quick Start

1. Initialize Project

rag-sentinel init

This creates:

  • .env - LLM/Embeddings API keys
  • config.ini - App settings and authentication
  • rag_eval_config.yaml - Master configuration
  • test_dataset.csv - Sample test dataset

2. Configure

Edit .env file:

  • Add your LLM API keys (Azure OpenAI, OpenAI, or Ollama credentials)
  • Set API endpoints and deployment names

Edit config.ini file:

  • Set your RAG backend URL in app_url
  • Set API paths for context and answer endpoints (context_api_path, answer_api_path)
  • Configure authentication (cookie, bearer token, or API key)
  • Set MLflow tracking URI (default: http://127.0.0.1:5000)

Edit test_dataset.csv file:

  • Add your test queries in format: query,ground_truth,chat_id
  • Example: What is RAG?,RAG stands for Retrieval-Augmented Generation,1

For detailed configuration help, see the comments in each config file.

3. Validate & Run

# Validate configuration
rag-sentinel validate

# Run evaluation
rag-sentinel run

Results will be available in the MLflow UI at the configured tracking URI.

CLI Commands

# Initialize new project
rag-sentinel init

# Validate configuration
rag-sentinel validate

# Run evaluation (auto-starts MLflow)
rag-sentinel run

# Run without starting MLflow server
rag-sentinel run --no-server

# Overwrite existing config files
rag-sentinel init --force

# Check package version
pip show rag-sentinel

# Upgrade to latest version
pip install --upgrade rag-sentinel

Metrics

  • Faithfulness - Factual consistency of answer with context
  • Answer Relevancy - How relevant the answer is to the question
  • Context Precision - Quality of retrieved context
  • Answer Correctness - Comparison against ground truth

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rag_sentinel-0.1.7.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rag_sentinel-0.1.7-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file rag_sentinel-0.1.7.tar.gz.

File metadata

  • Download URL: rag_sentinel-0.1.7.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for rag_sentinel-0.1.7.tar.gz
Algorithm Hash digest
SHA256 4156ded9043fe09de94ce122a451a836613a6fe104c28bfd88e006fd0980b311
MD5 7c70bf11a3c0eaf574fb95091139ba9d
BLAKE2b-256 21baff54367010b6b0eaf67fb76372b2e4a08bd6ce1f0ac48bdf75a19616f0c8

See more details on using hashes here.

File details

Details for the file rag_sentinel-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: rag_sentinel-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for rag_sentinel-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 4789cb414d3a3e93f42048805c277b9c9eae50d6432d7319f63c5f88364f5c94
MD5 483cf65c6373aa32fadb230a36a7f3a8
BLAKE2b-256 175765a0ba56b2ae8c0f49d480575dbd479ad815c8c6b7afbf5f6a413b588bf2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page