Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sense-lab.ai/llms.txt

Use this file to discover all available pages before exploring further.

Automated Pattern Detection

Continuously analyze your memory store to surface recurring patterns, anomalies, and risks — before they become incidents.

Pattern Types

The Pattern Detector scans memory entries and decision trace data for four pattern types:
PatternWhat it findsSeverity
Recurring failuresEntries that repeatedly appear in incident causal chainsWarning / Critical
Hot entitiesEntities with disproportionate write/outcome activity vs. averageInfo
Stale clustersGroups of old entries with no outcome links that may need pruningWarning
Confidence driftEntries whose confidence diverges significantly from their entity averageInfo

Alert Manager

Configurable rules that fire when matching patterns are detected:
from amfs_patterns import PatternDetector, AlertManager, AlertRule

detector = PatternDetector(incident_threshold=2, stale_days=30)
report = detector.analyze(entries, outcome_data=outcomes)

manager = AlertManager()
manager.add_rule(AlertRule(
    name="Critical recurring failures",
    pattern_type="recurring_failure",
    min_severity="critical",
    cooldown_minutes=60,
))
manager.on_alert(lambda eval: send_slack_notification(eval))

evaluations = manager.evaluate(report)
Features: severity filtering, entity-path scoping, cooldown-based suppression (prevent alert fatigue), and callback registration for routing to Slack, PagerDuty, email, or custom systems.