Confidence gating (PASS / FLAG / FILTER)
memledger applies a three-tier policy to every search result, gating on effective confidence — not declared confidence.
| Flag | Effective confidence | Effect |
|---|---|---|
| 🟢 PASS | ≥ flag_threshold | Returned normally |
| 🟡 FLAG | between min_threshold and flag_threshold | Returned with confidence_flag="FLAG" attribute |
| 🔴 FILTER | < min_threshold | Excluded from results |
Configure thresholds per call:
result = await ml.search(
query="connection pool fix",
confidence_policy={"min_threshold": 0.4, "flag_threshold": 0.6},
)
Inspect the gate decision via the response metadata:
print(result.metadata["confidence_gating"])
# {'passed': 4, 'flagged': 1, 'filtered': 2,
# 'policy': {'min': 0.4, 'flag': 0.6}, ...}
For the conceptual framing — including how effective confidence is computed via the chain — see Confidence flags and Effective confidence.
The full configuration reference — global defaults via memledger.yaml, per-namespace overrides — ships in a future release.