Community Resource: Not affiliated with TypeSafe AI. · Read full notice
Official Upstream Asset: Access the authoritative repository or documentation directly.
Official Entry ↗

What It Solves & Overview

The Smart Home Assistant is TypeSafe AI’s official reference demo showcasing Speculative Fan-out in practice. When given natural language commands (e.g., "Turn off all the lights and set thermostat to 70"), the system emits speculative questions for lights, climate, and security in parallel, executing actions in sub-second response times.

Suitability & Fit

When to Use

  • Learning how to implement speculative fan-out in production TypeScript applications.
  • Referencing real-world state modeling and multi-domain command decomposition.
  • Benchmarking end-to-end user latency for voice and interactive assistant workflows.

When NOT to Use

  • Building purely conversational chat assistants that have no IoT or software execution triggers.

Installation & Setup

git clone https://github.com/typesafe-ai/demos
cd demos/smart-home
npm install

Offline Contract Verification Example

Verification Notice: The code snippet below demonstrates local structural validation of inputs and choice schemas without requiring live network credentials. Real-world API execution requires active connectivity and API credentials.

// Offline multi-device dispatch mock
const mockCommand = "Turn off living room lights";
const mockDispatch = { domain: 'living_room', target: 'lights', action: 'power_off', confidence: 0.96 };
console.log("Mock smart-home dispatch verified offline:", mockDispatch.action);

Prerequisites & Operational Boundaries

Prerequisites

  • Node.js 18+ and a TypeSafe API key for running live demo commands.

Known Limitations

  • Demo is built as an interactive reference; production IoT deployment requires integrating real device hardware APIs.

Official Source Provenance

This guide is compiled and fact-checked against official upstream assets:

Related Directory Resources