cos_retrieval_learn
Adjust document chunk priority from past retrieval outcomes: boost chunks cited in successful tasks, lower those in rework, and refine retrieval quality automatically.
Instructions
Adjust document_chunks.priority based on recent retrieval outcomes.
Walks retrievals with a known outcome in the lookback window and:
chunk cited in a success task → priority += 0.02
chunk cited in a rework/blocked task → priority −= 0.01
passive retrievals ±0.005 (weaker signal)
Clamped to [0.1, 0.9]. Intended to run nightly via cron or after a batch of task-done events.
Args: lookback_days: How many days of retrievals to consider (default 7). dry_run: When True, compute changes without writing.
Returns:
{adjusted, gained, lost, changes[], status} envelope.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | ||
| lookback_days | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |