# Ragas

> A free Python tool. It scores AI apps that answer from your own documents.

**Field:** Artificial Intelligence  
**Category:** Evaluation & Benchmarks  
**Also known as:** Ragas Metrics, Ragas Evaluation, RAG Assessment

## Think of it like

It is like marking an open-book test. Did they find the right pages, and did they copy them right?

## Definition

Ragas is a free, open-source Python tool for grading AI apps, best known for apps that answer from your own files. These apps first fetch some text, then write an answer from it. Ragas scores both halves, mostly with a judge model, from 0 to 1. Context precision and context recall check if the right text was fetched. Faithfulness checks if the answer sticks to that text. Response relevancy checks if it answers the question.

## Example

Jack's help bot answers from 500 product manuals. Ragas shows context recall at 0.62, so he fixes how the bot finds pages before he touches the prompt.

## Example code

```bash
pip install ragas
ragas quickstart rag_eval
```

Install Ragas, then make a starter test for an app that answers from files.

## Why it matters

A wrong answer can come from bad search or bad writing. Scoring each half shows which one to fix.

## Common mistake

Only scoring the final answer. A good answer from the wrong pages hides a search problem that will bite later.

## Three principles

- **Two halves.** Fetching and answering, scored apart.
- **0 to 1 scores.** Higher is better on every metric.
- **Makes test sets.** Questions built from your own files.

## Related terms

- [Retrieval-Augmented Generation (RAG)](https://learn.benibix.com/term/ai/retrieval-augmented-generation)
- [Faithfulness (AI)](https://learn.benibix.com/term/ai/faithfulness)
- [LLM Evaluation](https://learn.benibix.com/term/ai/llm-evaluation)
- [DeepEval](https://learn.benibix.com/term/ai/deepeval)
- [Promptfoo](https://learn.benibix.com/term/ai/promptfoo)
- [LLM-as-a-Judge](https://learn.benibix.com/term/ai/llm-as-a-judge)

## Told apart from

- [DeepEval vs Ragas](https://learn.benibix.com/compare/deepeval-vs-ragas): People think DeepEval and Ragas do the same job, and they mostly do not. Ragas is built to score apps that answer from your own documents. It checks the search and the answer apart. DeepEval is a test runner that works like pytest. It runs many kinds of metric and fails the build when a score drops. DeepEval even lists a Ragas score among its metrics.

![Three boxes in a row: question, fetched text and answer. The arrow from question to fetched text is marked context precision and context recall. The arrow from fetched text to answer is marked faithfulness. A long arc from question over to answer is marked response relevancy. A note says each score runs from 0 to 1.](https://learn.benibix.com/diagrams/ai-ragas.svg)

---

Source: https://learn.benibix.com/term/ai/ragas
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
