cos_retrieval_quality
Reports mean retrieval precision over a lookback window, from citation-outcome pairs, to decide if contextual enrichment is worth the LLM cost.
Instructions
Report mean retrieval precision over the lookback window.
Precision is derived from (was_cited, outcome) pairs on the retrievals table, so it's honest: a retrieval that was cited and led to success counts as 1.0; a cited retrieval that led to rework counts as 0.0. Used to decide whether contextual enrichment is worth the LLM cost.
Args: lookback_days: Window in days (default 14). layer: Optional layer filter ("memory"|"docs"|"tasks").
Returns:
{mean_precision, samples, below_gate, gate, layer, status}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layer | No | ||
| lookback_days | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |