feat(ai): implement predictive friction clusters for zero-day incident detection#87
Open
Maayank18 wants to merge 2 commits into
Open
feat(ai): implement predictive friction clusters for zero-day incident detection#87Maayank18 wants to merge 2 commits into
Maayank18 wants to merge 2 commits into
Conversation
…t detection This introduces an autonomous incident detection pipeline that proactively deflects support tickets by identifying emerging search trends in real-time. - Add embedding vectors to SearchLog for semantic grouping. - Implement DBSCAN clustering (frictionClusterer.ts) over a 30-min rolling window. - Leverage Anthropic LLM to auto-generate incident titles and descriptions. - Add GlobalAlert model and /api/alerts API endpoints. - Create dynamic GlobalAlertBanner layout component for immediate user deflection. - Create /admin/alerts dashboard for visibility and incident resolution. - Enhance async error handling to prevent cron loop failures or UI crashes. Author: Mayank Garg <gargmayank1805@gmail.com>
…tation in PRODUCT.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 What is this PR?
Transforms the FAQ platform from a reactive system into a proactive one.
This PR introduces Predictive Friction Clusters—a background daemon that detects sudden spikes in semantically identical, unfulfilled search queries (e.g., a system outage). Once a volume threshold is met, it leverages an LLM to generate an incident warning and deploys a global banner, deflecting duplicate support questions before they are ever asked.
🧠 Architectural Changes
SearchLogschema to asynchronously capture and store1024-dimquery embeddings without blocking the user's search request path.frictionClusterer.ts, running aDBSCANalgorithm (epsilon: 0.65) on a 10-minute cron interval over a sliding 30-minute window to detect dense query vectors.GlobalAlertBanner: A persistent, polling layout component that dynamically color-codes severity (Info, Warning, Critical) to deflect users.AdminAlerts: A new management dashboard at/admin/alertsallowing support teams to view the triggering queries and manually resolve the incident.🛡️ Safety & Reliability Audit
BATCH_MAX_SIZE=50), guaranteeing 0ms latency impact on the core search API.try/catchexecution. A single malformed LLM response or DB timeout will gracefully log and skip, leaving the rest of the daemon unblocked.res.data?.alerts || []), preventing React rendering crashes in the event of upstream proxy errors.Author: Mayank Garg gargmayank1805@gmail.com