Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Heuristic:Vibrantlabsai Ragas Warning Deprecated V1 Metrics

From Leeroopedia
Knowledge Sources
Domains Deprecation, Migration, Metrics
Last Updated 2026-02-12 00:00 GMT

Overview

DEPRECATION WARNING: All 56+ metric classes imported directly from ragas.metrics are deprecated and scheduled for removal in v1.0. Users must migrate to ragas.metrics.collections for continued support.

Description

The entire V1 metrics API surface (all classes in src/ragas/metrics/_*.py) is deprecated. The __init__.py module intercepts imports via __getattr__ and emits DeprecationWarning for every legacy metric name. This affects all major metrics including AnswerCorrectness, Faithfulness, ContextPrecision, AspectCritic, BleuScore, RougeScore, NoiseSensitivity, and many more.

The V2 replacement metrics live in ragas.metrics.collections and follow a new architecture using SimpleLLMMetric as a base class with structured prompt systems.

Usage

Apply this heuristic when you encounter any import from ragas.metrics that produces a DeprecationWarning. Migrate all metric imports to use the collections API instead.

The Insight (Rule of Thumb)

  • Action: Replace from ragas.metrics import MetricName with from ragas.metrics.collections import MetricName
  • Value: Affects 56+ metric classes and aliases
  • Trade-off: V2 metrics may have slightly different parameter names and initialization patterns; review migration guide before upgrading
  • Scope: AnswerCorrectness, AnswerRelevancy, AspectCritic, BleuScore, ChrfScore, ContextEntityRecall, ContextPrecision, ContextRecall, DataCompyScore, Faithfulness, FactualCorrectness, InstanceRubrics, LLMSQLEquivalence, MultiModalFaithfulness, MultiModalRelevance, NoiseSensitivity, RougeScore, RubricsScore, SemanticSimilarity, SimpleCriteriaScore, SummarizationScore, ToolCallAccuracy, ToolCallF1, TopicAdherenceScore, AgentGoalAccuracy variants, and all snake_case aliases

Reasoning

The V1 metrics used a complex inheritance hierarchy from MetricWithLLM and MetricWithEmbeddings. The V2 collections metrics use a simpler SimpleLLMMetric base that combines metric logic with structured prompts. This migration simplifies the codebase and enables better prompt management, save/load support, and modular judge systems.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment