Skip to main content

Ragas Examples

Official examples demonstrating how to use Ragas for evaluating different types of AI applications including RAG systems, agents, prompts, workflows, and LLM benchmarking. These examples might be unstable and are subject to change.

Installation

From PyPI (after release)

pip install "ragas[examples]"

Local Development

Install both main ragas and examples packages in editable mode:

cd /path/to/ragas
uv pip install -e . -e ./examples

Or using regular pip:

cd /path/to/ragas  
pip install -e . -e ./examples

Available Examples

  • ragas_examples.agent_evals - Agent evaluation examples
  • ragas_examples.benchmark_llm - LLM benchmarking and comparison examples
  • ragas_examples.prompt_evals - Prompt evaluation examples
  • ragas_examples.rag_eval - RAG system evaluation examples
  • ragas_examples.workflow_eval - Workflow evaluation examples

Usage

Set Environment Variables

Most examples require API keys to be set:

export OPENAI_API_KEY=your_key_here

For Google Drive examples, also install the gdrive extra:

pip install "ragas[examples,gdrive]"

Running Examples as Modules

After installation, you can run examples directly:

# Run benchmark LLM prompt example
python -m ragas_examples.benchmark_llm.prompt

# Run benchmark LLM evaluation
python -m ragas_examples.benchmark_llm.evals

# Run other examples
python -m ragas_examples.rag_eval.evals
python -m ragas_examples.agent_evals.evals
python -m ragas_examples.prompt_evals.evals
python -m ragas_examples.workflow_eval.evals

Release process

  • The examples package is released together with ragas and shares its version, which comes from the release tag (e.g., v0.4.4).
  • Publishing is handled by the GitHub Actions workflow python-publish.yml. When a GitHub release is published it checks the tag, runs the unit tests and a clean-install check, and then uploads both ragas and ragas-examples to PyPI.

Local Development & Testing

Local Development & Testing

Verify Installation

# Test module execution
python -m ragas_examples.benchmark_llm.prompt --help

Metadata

Release files for ragas-examples 0.4.4

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

Source distribution (sdist)

Source distribution for ragas-examples 0.4.4
File Size Uploaded Provenance Actions
ragas_examples-0.4.4.tar.gz 91.4 kB Without provenance Details for ragas_examples-0.4.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ragas-examples 0.4.4
File Interpreter ABI Platform Actions
ragas_examples-0.4.4-py3-none-any.whl Python 3 none any Details for ragas_examples-0.4.4-py3-none-any.whl

Total release size: 176.7 kB

Release files / ragas_examples-0.4.4.tar.gz

Download URL ragas_examples-0.4.4.tar.gz
Size 91.4 kB
Tags Source
SHA-256 checksum
How to use checksums
74241b1c474b85e021840185201bc22a6f76a5e2104131db278cdc7abde76c33
BLAKE2b-256 checksum
How to use checksums
16a02eaa909a29019f37de4bec6cdfa45bffda0a7500e7a353bf60cbc8e7b1d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / ragas_examples-0.4.4-py3-none-any.whl

Download URL ragas_examples-0.4.4-py3-none-any.whl
Size 85.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
359acf298438395a05aebc065ecc7efc9cb2282ddc67f41220b851dbbff1e773
BLAKE2b-256 checksum
How to use checksums
3db073a2ec71fca7cc5181cc6d2ab3fe4a83e5a905d2a1a6a5d96498966a8cfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for ragas-examples 0.4.4

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.

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