Decision Module¶
Decisioning: scoring, selection, and reporting with agent support.
This module filters analyzed items, scores them with heuristics, and optionally uses an agent to produce a plain-text report when there are strong candidates.
- async agent.pipeline.decision.make_decision_and_report(task, selected)[source]¶
Generate a plain-text report or decide to skip notifying the user.
Uses an LLM-based reporter when available, falling back to a local template otherwise.
- Parameters:
task (
PipelineTask
) – The source task that describes user intent.selected (
List
[ScoredAnalysis
]) – A compact list of scored analyses.
- Return type:
- Returns:
Decision and optional report text.
- agent.pipeline.decision.score_result(task, result)[source]¶
Compute overall score in
[0, 100]
using relevance and simple boosts.- Parameters:
task (
PipelineTask
) – The pipeline task providing thresholds.result (
AnalysisResult
) – A single analysis result to score.
- Return type:
- Returns:
Score in the range
[0, 100]
.
- agent.pipeline.decision.select_top(task, analyzed)[source]¶
Score and keep items above
min_relevance
in descending order.The output is trimmed to at most three items to keep reports concise.
- Parameters:
task (
PipelineTask
) – Pipeline task withmin_relevance
.analyzed (
List
[AnalysisResult
]) – Analysis results to select from.
- Return type:
- Returns:
Compact, sorted selection of
ScoredAnalysis
.