CICD-433 · RAG retrieval evaluation
Encyclopedia · AI and LLM application pipelines · All snippets
Previous · CICD-432 · Next · CICD-434
1. Where it fits
- Placement CI evaluation gate.
- Prerequisites approved synthetic evaluation data, authorized model artifacts and pinned runtime tools.
- Platforms local-linux, github-actions, gitea-actions.
2. Copy the snippet
bash
jq -se 'length > 0 and ([.[] | select((.retrieved[0:5] - .relevant | length) < (.retrieved[0:5] | length))] | length) / length >= 0.85' reports/retrieval.jsonl3. How it works
The expression compares the top five retrieved IDs with the labeled relevant set and counts a hit if any overlap. It aggregates hits over all input rows.
4. Verify the result
Each row contains retrieved IDs and relevant IDs. This computes hit rate at five using synthetic gold labels.
Validation syntax-validated (Bash parse). Status definitions.