RAG-015RAG · Citationslayaeval.CitationCorrectness
Citation Correctness
Does each citation point to a source that says that thing?
Simulation state:
When it passes
Every tag points right.
Threshold satisfied: evaluation score >= 3.0.
When it fails
A tag points to the wrong page.
Violation detected: execution flagged for human review or fallback routing.
SDK Specification
| Parameter | Value | Description |
|---|---|---|
| Class | CitationCorrectness | Python evaluator class in layaeval |
| Required Fields | "query", "response", "citations", "cited_source_text" | Arguments expected in the call signature |
| Default Threshold | >= 3.0 | Passes when quality score is at or above this value |
| Category | RAG Evaluation | Citations (Do the little [1] tags point to the right place?) |
Python Example
citation-correctness.py
1from layaeval import CitationCorrectness23metric = CitationCorrectness(threshold=3.0) # passes at or above 3.045res = metric(6 query="What is the capital of France?",7 response="Paris is the capital of France.",8 citations=["[1]"],9 cited_source_text="Paris is the capital of France.",10)1112print(res.passed, res.value, res.confidence)
Related RAG Checks