Skip to main content

Ragas Examples

Example projects for evaluating different kinds of LLM applications with Ragas: RAG systems, agents, prompts, workflows, text-to-SQL and LLM benchmarking. They are the source of the ragas quickstart templates. They may change between releases.

Installation

The examples are the ragas-ng-examples package (import name ragas_examples), a member of this repository's uv workspace, published to PyPI alongside ragas-ng:

pip install ragas-ng-examples

To work on them, install from a clone:

git clone https://github.com/arpieb/ragas-ng.git
cd ragas-ng
uv sync --package ragas-ng-examples
# or, with pip, in editable mode:
pip install -e . -e ./examples

Some examples need extra dependencies, available as extras of ragas-ng-examples:

Extra For
text2sql ragas_examples.text2sql
improverag ragas_examples.improve_rag
llamaindex ragas_examples.llamaIndex_agent_evals
gdrive the Google Drive scripts below
uv sync --package ragas-ng-examples --extra text2sql
# or: pip install -e "./examples[text2sql]"

Starting a project from a template

To copy an example into a new project instead of running it in place:

ragas quickstart                          # list the templates
ragas quickstart rag_eval -o ./my-project # copy one

Available examples

Module Template What it evaluates
ragas_examples.rag_eval rag_eval A RAG system, with custom metrics
ragas_examples.improve_rag improve_rag Naive vs. agentic RAG, with BM25 retrieval
ragas_examples.agent_evals agent_evals An agent solving math problems
ragas_examples.llamaIndex_agent_evals llamaIndex_agent_evals LlamaIndex agents' tool calls
ragas_examples.text2sql text2sql Text-to-SQL, by query execution
ragas_examples.workflow_eval workflow_eval A multi-step workflow
ragas_examples.prompt_evals prompt_evals Prompt variants
ragas_examples.judge_alignment judge_alignment How well an LLM judge agrees with human labels
ragas_examples.benchmark_llm benchmark_llm Several LLMs on the same task
ragas_examples.ag_ui_agent_experiments An AG-UI agent server (see the AG-UI guide)

Standalone scripts in this folder:

  • iterate_prompt/: the prompt iteration guide example.
  • gdrive_backend_example.py, gdrive_append_example.py: datasets stored in Google Sheets. See Storage backends.
  • oci_genai_example.py: Oracle Cloud Infrastructure Generative AI models through LiteLLM (llm_factory("oci/...")) scored with metrics_experiment(). See the OCI guide.

Running an example

Most examples call OpenAI, so set your key first. The llamaIndex_agent_evals example uses Gemini (GOOGLE_API_KEY). The quickstart guide shows how to point the rag_eval template at other providers.

export OPENAI_API_KEY=your_key_here

Each template names its models once, near the top of the module that uses them. Override them without editing code:

Variable Sets
RAGAS_EXAMPLE_APP_MODEL the model the app or agent under test calls
RAGAS_EXAMPLE_JUDGE_MODEL the model that judges the results
RAGAS_EXAMPLE_APP_MODEL=gpt-5.6-terra RAGAS_EXAMPLE_JUDGE_MODEL=gpt-6.1-sol python -m ragas_examples.rag_eval.evals

The app's client must reach the model you name. Most templates use an OpenAI client, so a non-OpenAI model also needs that provider's OpenAI-compatible endpoint (see the quickstart guide).

Run an example as a module, or with its console script:

python -m ragas_examples.rag_eval.evals
# or
ragas-rag-evals
Module Console script
agent_evals.evals ragas-agent-evals
benchmark_llm.evals ragas-benchmark-llm
prompt_evals.evals ragas-prompt-evals
rag_eval.evals ragas-rag-evals
workflow_eval.evals ragas-workflow-evals
improve_rag.evals ragas-improve-rag
text2sql.evals ragas-text2sql-evals
llamaIndex_agent_evals.evals ragas-llamaindex-agent-evals
judge_alignment.evals ragas-judge-alignment

Versioning

The package version comes from the repository's git tags through setuptools_scm. These are the same tags as the ragas package, so the two versions stay in step. The publish-examples.yml workflow builds and publishes the package when a GitHub release is published. This fork doesn't publish to PyPI.

Metadata

Release files for ragas-ng-examples 2026.11.0

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-ng-examples 2026.11.0
File Size Uploaded Provenance Actions
ragas_ng_examples-2026.11.0.tar.gz 93.5 kB With provenance Details for ragas_ng_examples-2026.11.0.tar.gz

Built distribution (wheel)

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

Total release size: 182.4 kB

Release files / ragas_ng_examples-2026.11.0.tar.gz

Download URL ragas_ng_examples-2026.11.0.tar.gz
Size 93.5 kB
Tags Source
SHA-256 checksum
How to use checksums
aaedda045430acd6797aa4e2cdac40b69aa8786133626007ace92b448cf8c4a5
BLAKE2b-256 checksum
How to use checksums
1a07d9906b020ae840ba8f49ee23269e32a80f415d0fce15cea7998b64ef0cfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Release files / ragas_ng_examples-2026.11.0-py3-none-any.whl

Download URL ragas_ng_examples-2026.11.0-py3-none-any.whl
Size 88.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a0d71f6b3a614e1cf5cd56bddf5a7f9e2623ca578e01af04a9f9c5ce5ba58883
BLAKE2b-256 checksum
How to use checksums
6a4c0356ba1ac9099293c7e850157558a66a61da095c8b95fc7bd7eb084d9205
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Security for ragas-ng-examples 2026.11.0

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ragas_ng_examples-2026.11.0.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 Nov 12, 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