Add consensus correlator: rules + Gemini LLM with smart tiebreaker
Refactor incident_correlator.py to a decision/commit split (preview_correlation / apply_correlation) so the rules engine and LLM can both produce decisions before anything is written to Firestore. Add llm_correlator.py: cheap Gemini Flash first-pass + Gemini Pro tiebreaker. Wire _correlate_with_consensus in upload.py — rules-only fallback when key is absent or call is thin; agreed/tiebreak consensus written to corr_debug.
This commit is contained in:
@@ -26,6 +26,11 @@ class Settings(BaseSettings):
|
||||
|
||||
# Gemini (intelligence extraction, embeddings, incident summaries)
|
||||
gemini_api_key: Optional[str] = None
|
||||
# Correlation consensus models
|
||||
# corr_cheap_model — first-pass LLM correlator (runs on every call)
|
||||
# corr_smart_model — tiebreaker (only fires when rules and cheap LLM disagree)
|
||||
corr_cheap_model: str = "gemini-2.0-flash"
|
||||
corr_smart_model: str = "gemini-1.5-pro"
|
||||
summary_interval_minutes: int = 2 # how often the summary loop runs
|
||||
correlation_window_hours: int = 2 # slow/location path: max hours since last call
|
||||
embedding_similarity_threshold: float = 0.93 # slow-path: requires location corroboration
|
||||
|
||||
Reference in New Issue
Block a user