Skip to main content
Evaluating LLM outputs is critical for maintaining quality in production. This tutorial shows you how to build a complete evaluation pipeline using RAGAS metrics and Helicone’s dataset features.

What is RAGAS?

RAGAS (Retrieval Augmented Generation Assessment) provides metrics for evaluating:
  • Answer correctness - How accurate is the response?
  • Answer similarity - How close to the reference answer?
  • Faithfulness - Is the answer grounded in the context?
  • Context relevance - Is retrieved context useful?

Prerequisites

  • Python 3.8+
  • Helicone account with API key
  • Requests logged in Helicone (see Quick Start)

Setup

1

Install Dependencies

2

Configure Environment

Create a .env file:
RAGAS uses OpenAI models for evaluation by default.

Workflow Overview

Evaluation workflow diagram

Complete RAGAS evaluation workflow

Step 1: Export Data from Helicone

Create a Dataset

In your Helicone dashboard:
  1. Navigate to DatasetsCreate Dataset
  2. Filter requests you want to evaluate (e.g., production traffic from last week)
  3. Add requests to the dataset
  4. Click “Export Data” to download CSV
The exported CSV contains:
  • id - Request ID
  • model - Model used
  • messages - Input prompt
  • choices - Model response
  • heliconeMetadata - Custom properties and metadata

Export via API

Alternatively, export programmatically:

Step 2: Add Ground Truth Labels

RAGAS evaluation requires reference answers (“ground truth”) to compare against.

Manual Labeling

Create a script to help with manual annotation:
Then manually edit ground_truth column with correct answers.

Automated Labeling

For testing, generate synthetic labels:
Synthetic ground truth is useful for testing but not for production evaluation. Use human-labeled data for reliable quality assessment.

Step 3: Prepare Evaluation Dataset

Convert Helicone export to RAGAS format:

Step 4: Run RAGAS Evaluation

Evaluate responses using RAGAS metrics:

Step 5: Push Scores to Helicone

Sync evaluation scores back to Helicone for unified tracking:
Now you can filter and analyze requests by RAGAS scores in your Helicone dashboard!

Step 6: Analyze Results

Identify patterns in low-scoring responses:

Complete Evaluation Pipeline

Put everything together:
Run it:

Automated Evaluation

Run evaluations on a schedule:

Best Practices

Begin with 20-50 examples to validate your pipeline. Scale up once confident in your labeling and metrics.
Evaluate on data that matches your production distribution. Include edge cases and common queries.
Don’t rely on a single metric. Use correctness, similarity, and relevancy together for comprehensive assessment.
Monitor score trends weekly. Sudden drops indicate quality regressions that need immediate attention.
When scores drop, filter in Helicone by score range to find and fix problematic cases.

Next Steps

Experiments

Use evaluation results to guide A/B testing

Fine-Tuning

Build training datasets from high-scoring examples

Custom Properties

Tag requests for targeted evaluation

RAGAS Docs

Deep dive into RAGAS metrics and configuration