Enforces minimum similarity thresholds on vector retrieval to prevent RAG hallucination from weak matches.
97
97%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
WHERE similarity >= match_threshold in the query. Omitting this filter renders the threshold parameter decorative.match_threshold as a configurable parameter with a default value >= 0.5.IF match_threshold < 0.5 THEN RAISE EXCEPTION) at the top of every retrieval function.LIMIT match_count.1 - (embedding <=> query_embedding) for cosine distance.<-> (L2 distance) unless the embedding model explicitly requires Euclidean distance.EXECUTE to authenticated only — NEVER to anon unless the caller explicitly overrides.