
A beginner’s guide to why “it seems to work” isn’t good enough and what to do about it.
Series: Stop Vibing, Start Evaluating-Part 1 of 5
Imagine you hired a new employee. Every day, you ask them a few questions, they answer well, and you think: “Great, they’re doing an amazing job!” But you never actually measure anything. No targets. No scorecards. No way to know if they’re getting better or worse over time.
That’s exactly how most teams build AI apps today. They try a response, it feels right, and they ship it. This is called a “vibe check” and it’s quietly destroying AI products.
The old way of evaluating software doesn’t work for AI. A unit test (a small automated code check) tells you if a function returns the right number. But how do you check if an AI gave a good enough answer? That’s fuzzier, harder, and way more important. This series is about solving exactly that problem and the tool we’ll use is called Ragas.
A story from the baking world
Meet Priya. She runs a small bakery, and she’s trying to perfect her sourdough recipe.
The first week, she bakes a loaf, tastes it, and thinks: “Hmm, not bad.” She tweaks the flour ratio and bakes again. Still not sure if it’s better. She shows it to a friend who says “yeah, tastes good!” She keeps going like this for months making changes, feeling things out, never really knowing if she’s actually improving.
Then she discovers her competitor’s trick: they use a scoring sheet. Every loaf gets rated on crust color (1–10), crumb texture (1–10), and rise height (measured in centimeters). Now when they change anything water temperature, fermentation time, oven setting they can instantly see if the number goes up or down.
Priya’s breakthrough moment — a scoring sheet turned guesswork into progress. Your AI app needs the same.
Aha moment: Once you have a score, you can run experiments. Without a score, you’re just baking or building by feel.
Ragas is the scoring sheet for your AI app. It replaces “feels right” with numbers you can track, compare, and improve over time.
What is Ragas?
Ragas is an open-source Python library that helps you build a systematic evaluation loop for your AI applications. Think of it as a testing framework, but instead of checking if a function returns true or false, it checks if your AI's answers are good.
The key insight is this: traditional evaluation metrics were designed for predictable software. AI systems are different. Their outputs are open-ended, fuzzy, and context-dependent. You need a different kind of measurement.
Ragas solves this by combining three things: structured test datasets, repeatable experiments, and AI-powered metrics. Together they replace gut instinct with something you can actually act on.
The eval loop
The engine behind Ragas is something called an eval loop (short for evaluation loop). Here’s the full cycle:
The eval loop: four simple steps that separate teams who improve fast from teams who stay stuck.
This is the same loop scientists use. You have a hypothesis: “I think switching to GPT-4o will give more accurate answers.” You run a test, you measure the outcome, and you decide what to do next. No more guessing. No more vibing.
Ragas gives you three building blocks to make this loop work.
The three building blocks
1. Your exam paper (Dataset)
A dataset is a curated collection of test questions paired with correct answers. Think of it as a fixed exam you give your AI system every time you make a change.
The key word is fixed. If you test on different questions each time, your results aren’t comparable. A dataset makes sure you’re always comparing apples to apples.
from ragas import Dataset
dataset = Dataset(name="my_evaluation", backend="local/csv", root_dir="./data")
dataset.append({
"id": "sample_1",
"query": "What is the capital of France?",
"expected_answer": "Paris",
"metadata": {"complexity": "simple", "language": "en"}
})
Good datasets include samples across different difficulty levels, edge cases, and real-world scenarios your users actually face. Quality beats quantity every time.
2. Your test runs (Experiment)
An experiment is a single, structured run of your AI system against the full dataset. Every run gets saved automatically, with a timestamp, so you can always go back and compare.
from ragas import experiment
@experiment()
async def model_comparison(row, model_name: str):
response = await my_system(row["query"], model=model_name)
return {
**row,
"response": response,
"experiment_name": f"test_{model_name}"
}
# Run with GPT-3.5
results_v1 = await model_comparison.arun(dataset, model_name="gpt-3.5-turbo")
# Run with GPT-4o
results_v2 = await model_comparison.arun(dataset, model_name="gpt-4o")
Ragas automatically stores results in an organized folder:
experiments/
├── 20241201-143022-test_gpt-3.5-turbo.csv
└── 20241201-144001-test_gpt-4o.csv
Now you have two scorecards sitting side by side. That’s the whole game.
3. Your scoring sheet (Metrics)
Metrics are automatic scores for each response. This is where things get interesting because the scores are often calculated by another AI acting as a judge.
Here’s a mini-story to make this click.
Imagine a newspaper with two roles. The reporter writes the story that’s your AI app, generating responses. The editor reads each story and grades it: Is it factually accurate? Does it answer the question? Is it well structured?
In Ragas, the editor is also an AI, a separate language model that evaluates the reporter’s output. This is called LLM-as-judge (using a language model to evaluate another language model’s output). It sounds circular, but it works surprisingly well for catching factual errors and irrelevant responses at scale.
from ragas.metrics import FactualCorrectness
factual_score = FactualCorrectness().score(
response=response,
reference=row["expected_output"]
)
# Returns a score between 0.0 (wrong) and 1.0 (correct)
Datasets, Experiments, Metrics — the three tools that turn ‘it feels right’ into ‘the number went up.
What a real experiment looks like end to end
Say you’re building a customer support chatbot. You want to know: Does switching from GPT-3.5 to GPT-4o actually make answers more accurate?
Here’s the full flow:
- Load your dataset:- 50 real customer questions with correct answers written by your team
- Run two experiments:- one with GPT-3.5, one with GPT-4o, both on the exact same 50 questions
- Apply metrics:- factual correctness, answer relevance, response completeness
- Compare scorecards :- GPT-4o scores 0.87 vs GPT-3.5’s 0.71 on factual correctness
GPT-4o scored 0.87. GPT-3.5 scored 0.71. Now that’s a decision, not a debate.
No more “GPT-4o feels better.” Now you have a number — and a number you can beat next week.
Current limitations
Ragas isn’t magic. A few things to keep in mind before you go all in:
LLM-as-judge has its own biases. The judge model might prefer longer answers even when shorter ones are better. It’s smart, but not infallible.
Dataset quality is everything. If your test questions are too easy or unrepresentative of real usage, your scores will be misleadingly high. A well-crafted set of 50 questions beats a lazy set of 500.
Running evaluations costs money. You’re making API calls for both your app and the judge model on every experiment run. Budget accordingly.
Metrics measure proxies, not truth. A high factual correctness score means the AI’s answer matches your reference answer, but it doesn’t guarantee the reference answer was perfect to begin with.
The bottom line
Remember Priya and her sourdough? The moment she got a scoring sheet, she stopped guessing and started actually improving. Within two months, her loaves were consistently better, not because she tried harder, but because she could see what was working.
Your AI app deserves the same. Stop vibing, start measuring and watch what happens when you finally know what “better” actually means.
If you found this useful, follow along for Part 2 — we’ll go from zero to scores in one sitting. Questions or ideas? Drop them in the comments.
Reference
All technical details and code examples in this post are sourced from the official Ragas documentation.
POSTS ACROSS THE NETWORK
10 Best ISO 27001 Software Tools for Fast Implementation in 2026

Website Traffic Checkers Are Becoming Developer Tools

Designing Scalable Recommendation Engines for Courses and Graduate Programs
He Developed a New Methodology to Cut Site Labor by Half and Speed Up Housing Delivery
