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 withmetrics_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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ragas_ng_examples-2026.11.1.tar.gz | 93.6 kB | With provenance | Details for ragas_ng_examples-2026.11.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ragas_ng_examples-2026.11.1-py3-none-any.whl | Python 3 | none | any | Details for ragas_ng_examples-2026.11.1-py3-none-any.whl |
Total release size: 187.5 kB
Release files / ragas_ng_examples-2026.11.1.tar.gz
| Download URL | ragas_ng_examples-2026.11.1.tar.gz |
|---|---|
| Size | 93.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7a99c49fd1ec408d986084e78e0a56fa259d30c5e43fdbece9485654781db874
|
|
BLAKE2b-256 checksum How to use checksums |
61ab6e6c7ede721b333d24511864bc74217ed69bc68750b20680bfdf57a1164d
|
| 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 13, 2026.
Transparency logRelease files / ragas_ng_examples-2026.11.1-py3-none-any.whl
| Download URL | ragas_ng_examples-2026.11.1-py3-none-any.whl |
|---|---|
| Size | 93.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
542e4fb25e68006976e1880bbc35d01bdc415b3aef08c7dcdee12bf815894639
|
|
BLAKE2b-256 checksum How to use checksums |
3e8d6d1187de1fd3123c127aa89598591d9e03b895a7c6eaac6e8a6b0feae966
|
| 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 13, 2026.
Transparency logSecurity for ragas-ng-examples 2026.11.1
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.
Attestation for ragas_ng_examples-2026.11.1.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 13, 2026.
Transparency logA 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.