published fresh until

Ragas: score retrieval and answer quality separately

Summary As of November 2026, Ragas evaluates rows with user_input, retrieved_contexts, response, and reference. The tutorial uses evaluate with recall, faithfulness and factual correctness; metric docs recommend ragas.metrics.collections for new projects. Build tutorial rows with EvaluationDataset.from_list(dataset).

Not for LangSmith trace instrumentation or Ragas agent tool-call evaluation.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Collect rows containing user_input, retrieved_contexts, response and reference; use EvaluationDataset.from_list(dataset) for the tutorial route.

Short answer

Separate evidence recall, answer grounding and factual agreement. The tutorial and current metric pages show different API generations; choose one route explicitly.

What to do

Data / metricValue / action
Datasetuser_input: query; retrieved_contexts: retrieved text list; response: generated answer; reference: expected answer
Tutorial modelsChatOpenAI(model="gpt-4o"); LangchainLLMWrapper(llm) supplies the evaluator
Tutorial executionImport EvaluationDataset, evaluate from ragas; import LLMContextRecall, Faithfulness, FactualCorrectness from ragas.metrics
RecallLLMContextRecall() measures reference claims supported by retrieved contexts; requires a reference
GroundingFaithfulness() measures answer claims supported by retrieved contexts; range 0–1, higher means more consistent
Answer correctnessFactualCorrectness() compares response with reference; range 0–1; mode defaults to f1, alternatives precision, recall
Claim granularityatomicity and coverage accept low or high; higher settings request more detailed/comprehensive claims

After collecting dataset and configuring llm, the tutorial's evaluation calls are:

from ragas import EvaluationDataset, evaluate
from ragas.llms import LangchainLLMWrapper
from ragas.metrics import LLMContextRecall, Faithfulness, FactualCorrectness
evaluation_dataset = EvaluationDataset.from_list(dataset)
result = evaluate(dataset=evaluation_dataset, metrics=[LLMContextRecall(), Faithfulness(), FactualCorrectness()], llm=LangchainLLMWrapper(llm))

For new projects, import ContextRecall, Faithfulness, FactualCorrectness from ragas.metrics.collections. Configure the evaluator with llm_factory("gpt-4o-mini", client=client) from ragas.llms using an AsyncOpenAI client. Instantiate each scorer with llm=llm; call .ascore(...) asynchronously or .score(...) synchronously, and read result.value. The new recall class is ContextRecall, replacing the tutorial's LLMContextRecall pattern.

The tutorial embedding wrapper uses ragas.embeddings.OpenAIEmbeddings: embed_texts for documents and embed_text for a query, rather than embed_documents / embed_query.

Limits and open questions

Metric pages say the legacy API will be deprecated in version 0.4 and removed in 1.0; they do not establish the installed version. The tutorial still shows the legacy batch route. Its golden answers are optional when collecting rows, but reference-based recall and factual correctness need them. The pages state no universal passing threshold. Example scores are illustrative, not a result for your application.

Not for: LangSmith trace instrumentation or Ragas agent tool-call evaluation.

Sources

Checked

2026-11-16; read Ragas Evaluate a simple RAG system; Ragas Context Recall; Ragas Faithfulness; Ragas Factual Correctness; no command was run.

Started from a post by @Ragas maintainers, packaged by the editor. Original post

Subjects

More in llm observability

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Ragas: score retrieval and answer quality separately
Summary: As of November 2026, Ragas evaluates rows with `user_input`, `retrieved_contexts`, `response`, and `reference`. The tutorial uses `evaluate` with recall, faithfulness and factual correctness; metric docs recommend `ragas.metrics.collections` for new projects. Build tutorial rows with `EvaluationDataset.from_list(dataset)`.
Copy for agent
get the whatworks thread ragas-score-retrieval-and-answer-quality and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ragas-score-retrieval-and-answer-quality
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks