💡 Inspiration

Knowledge workers spend hours striving to achieve "flow state," yet research from UC Irvine shows that it takes an average of 23 minutes and 15 seconds to regain focus after a single interruption.

In modern remote and hybrid work environments, household interruptions are relentless: delivery couriers ringing the doorbell, neighborhood solicitors, casual visitor knocks, and false alarms. While smart home systems like Alexa and Ring are great at notifying us of events, they lack contextual intelligence—they alert us indiscriminately, shattering our concentration.

We built FlowGuard to act as an executive gatekeeper for your home. It bridges smart devices (Ring and Alexa) with AWS Bedrock and the Model Context Protocol (MCP), giving your smart home the ability to reason about interruptions, enforce strict focus policies, deflect non-urgent visitors with courteous outdoor audio, and protect your deep work without missing what matters.


🛡️ What It Does

FlowGuard is a desktop-first interruption arbitration console and agent backend:

  1. Focus Workspace: Activate deep-work sessions (e.g., "Executive Board Financial Modeling") with scheduled durations, tolerance thresholds (Emergency Only, Urgent Only, Allow Family, Lenient), and allowed response channels.
  2. AI Interruption Arbitration: When a simulated Ring doorbell or Alexa sensor triggers, FlowGuard evaluates audio transcripts, courier signals, and visitor urgency using AWS Bedrock (Claude 3.5 / Haiku / Nova) to calculate an urgency score (1–10) and propose an action.
  3. Deterministic Policy Boundary: FlowGuard follows a strict defense-in-depth model: the LLM is never allowed to bypass authorization or invent tool execution. Application-level rules verify whether the action is pre-authorized (e.g., package drop-off quick replies) or requires explicit user approval.
  4. Privacy Guardrail Engine: Protects the resident's confidential context. If an inquisitive visitor asks what you are doing, the Privacy Guard ensures the system never reveals your focus objective or schedule, sanitizing outdoor audio to neutral pre-approved messages.
  5. Hardware Execution & Chime Muting: Automatically mutes indoor Ring chimes while deep work is active and transmits simulated outdoor speaker responses (e.g., "Please leave the package by the door. Thank you!").
  6. Idempotency & Deduplication: A sliding TTL cache prevents courier double-rings from re-triggering outdoor audio or creating redundant notifications.
  7. Post-Focus Queue & Debrief: Holds deferred non-urgent events in a silent digest that knowledge workers can review and acknowledge once their focus block concludes.

🛠️ How We Built It

FlowGuard is built with an end-to-end TypeScript architecture:

  • Self-Hosted MCP Server: Implemented using the official @modelcontextprotocol/sdk (specification version 2025-11-25) over Streamable HTTP (Server-Sent Events) at /sse and message routing at /messages.
  • AWS Bedrock Integration: Invokes AWS Bedrock Runtime models via the unified ConverseCommand in @aws-sdk/client-bedrock-runtime. It includes a built-in deterministic local fallback engine so anyone can test the system locally for $0 without upfront cloud credentials.
  • Application API Adapter: Bridges browser requests to the MCP server using InMemoryTransport linked pairs, strictly preventing internal function calls or secret exposure to the client.
  • Frontend Console: A desktop-first React dashboard styled with bespoke dark-mode design tokens, live countdown timers, interactive Ring event dispatchers, side-by-side AI-vs-Policy decision cards, and audit timelines.
  • Automated Test Suite: Built with Vitest, featuring 29 automated tests across 6 test suites validating policy enforcement, privacy redactions, idempotency tracking, Bedrock fallbacks, and live MCP protocol over SSE.

🧗 Challenges We Faced

  1. Preventing LLM Hallucinations in Device Control: Letting an LLM directly trigger physical hardware is a recipe for unauthorized actions. We solved this by decoupling AI recommendation from deterministic application authorization. If Bedrock recommends a breakthrough that violates policy, the application engine catches and downgrades it to a silent queue.
  2. Sensitive Context Leakage: An LLM might naturally reply to a visitor with: "The resident is busy with Q3 M&A Valuation." We built a semantic token extraction and n-gram Privacy Guard that audits visitor-facing speech and sanitizes private terms before audio is ever queued for transmission.
  3. Handling Duplicate Doorbell Events: Couriers frequently ring twice within 10 seconds. We implemented a sliding TTL deduplication tracker that safely suppresses repeat speaker dispatches (DUPLICATE_IGNORED).

🏆 Accomplishments That We're Proud Of

  • 100% Test Coverage on Core Invariants: 29 automated tests verifying protocol compliance, policy boundaries, and privacy protection.
  • Zero-Downtime Multi-Mode Operation: FlowGuard runs seamlessly on live AWS Bedrock credentials, yet gracefully degrades to deterministic local arbitration if credentials are unset, ensuring hackathon judges can review it with zero setup hurdles.
  • Full MCP Protocol Adherence: Real protocol-level Server-Sent Events communication using the official @modelcontextprotocol/sdk.

📚 What We Learned

  • How to architect agentic workflows using the latest Model Context Protocol (MCP 2025-11-25).
  • Structuring strict schema outputs using the AWS Bedrock ConverseCommand.
  • Designing resilient human-in-the-loop fallback and approval boundaries for smart home AI agents.

🔮 What's Next for FlowGuard

  • Physical Alexa Skill & Ring API Bridge: Integrating the Amazon Alexa Skills Kit (ASK) and Ring Developer APIs for physical device control.
  • Calendar & Slack Context Sync: Automatically establishing focus objectives from Google Calendar, Outlook, and Slack Do Not Disturb statuses.
  • Multimodal Delivery Inspection: Leveraging Ring camera snapshots with Bedrock vision models to visually confirm package placement and courier uniforms.

Built With

Share this project:

Updates

Submission history