Skip to main content

Official examples for the ragas project

Project description

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 versioned independently using Git tags with prefix examples-v (e.g., examples-v0.1.0).
  • Publishing is handled by the GitHub Actions workflow publish-examples.yml, which builds from examples/ and publishes to PyPI when such a tag is pushed.

Release Commands

To create and push a new release:

# Create and push a new tag (replace X.Y.Z with actual version)
git tag examples-vX.Y.Z
git push origin examples-vX.Y.Z

# Example:
git tag examples-v0.1.0
git push origin examples-v0.1.0

Local Development & Testing

Local Development & Testing

Verify Installation

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

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

ragas_examples-0.3.5.tar.gz (66.2 kB view details)

Uploaded Source

Built Distribution

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

ragas_examples-0.3.5-py3-none-any.whl (65.8 kB view details)

Uploaded Python 3

File details

Details for the file ragas_examples-0.3.5.tar.gz.

File metadata

  • Download URL: ragas_examples-0.3.5.tar.gz
  • Upload date:
  • Size: 66.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ragas_examples-0.3.5.tar.gz
Algorithm Hash digest
SHA256 6535e79b71b51dec9ab1ba79f87d8cd382056f9aaeb26fa91f055e2bdf3ae51e
MD5 6de39db8eab88c3d2dd80dd7f7d70795
BLAKE2b-256 033e4ec53afdc2751a04cbdfe76eef2faaeb7c48ca2a673f836bd254aad1b6f3

See more details on using hashes here.

File details

Details for the file ragas_examples-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: ragas_examples-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 65.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ragas_examples-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 183b5a1f10fb678e1d35879e9e99328aecb1930474fe9dcfcffbd875d964195a
MD5 b90e9ee91aa32c3272f4ad57726aa9e2
BLAKE2b-256 bce7d3ff5f84c51c5d9276c3af516eaca29c758bd7de0974a57dd9d925e07fa4

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