Inspiration
What it does
How we built it
Inspiration Modern knowledge workers and engineering leaders face a paradox of choice and cognitive overload. While calendars and todo-lists have moved to the cloud, they remain passive CRUD databases, not active partners. When someone is falling behind on a major product launch or client delivery, their tools don't help them triage—they just sit there displaying an overwhelming list of overdue red badges and overlapping calendar blocks.
Existing AI chat assistants offer sympathetic advice ("You should block 2 hours for deep work!"), but stop dead in their tracks because they lack an actionable, authenticated interface to mutate the user's live commitments. The user is forced to play human middleware: reading advice from a chatbot, switching tabs, manually resizing calendar events, moving meetings, creating subtasks, and calculating schedule margins.
We asked ourselves: What if your assistant didn't just give advice, but had verifiable agency to inspect your live schedule, calculate optimal focus blocks, resolve conflicts, and commit real state changes with user transparency?
That question inspired LifeOS—an agentic AI command center built for the 2026 Amazon Developer Hackathon (Alexa+ & MCP tracks) that bridges natural language intent to concrete database transactions.
What It Does LifeOS transforms ambiguous, high-level user commands (e.g., "I'm overwhelmed with launch prep, schedule 2 hours of focus time tonight and clear my morning distractions") into deterministic actions across tasks, calendar events, and projects.
Autonomous Agent Loop: Translates natural language into goal-driven workflows: Intent Parsing → Context Gathering → Constraint-Satisfying Plan Generation → Multi-Tool Plan Execution. 12-Tool Model Context Protocol (MCP) Server: A self-hosted Express MCP server implementing the Streamable HTTP transport (spec 2025-11-25) with strict Zod argument validation, user-scoped tenant isolation, and sub-50ms execution latency. Real-Time Execution Streaming: A live Server-Sent Events (SSE) telemetry feed that streams each step, tool invocation, input payload, output, and execution latency directly to the browser UI. Multimodal Alexa+ Voice Simulator: A voice-first conversational interface replicating the next-generation Alexa+ experience with live speech state progression (Understanding → Retrieving → Planning → Executing → Updated) backed by the exact same MCP orchestrator. Resilient Dual-Engine Architecture: Seamless multi-provider support for OpenAI (GPT-4o) and Anthropic (Claude 3.5 Sonnet), with an automated deterministic rule-based fallback that runs zero-cost, offline, and keyless without degradation. Mathematical Scheduling Formulation Unlike naive LLM wrappers that hallucinate dates or double-book meetings, LifeOS formulates day planning as a Constraint Satisfaction and Utility Maximization Problem.
Given a set of pending tasks ( T = {t_1, t_2, \dots, t_n} ) where each task ( t_i ) possesses:
Estimated duration ( d_i \in \mathbb{R}^+ ) (in minutes) Priority weight ( w_i \in {1, 2, 4, 8} ) (corresponding to Low, Medium, High, Urgent) Due date deadline ( D_i \in \mathbb{R}^+ ) The agent seeks to assign each selected task to a disjoint continuous calendar slot ( [s_i, e_i) ) within the user's available workday horizon ( [T_{\text{start}}, T_{\text{end}}] ), maximizing total completed utility:
$$ \max \sum_{i=1}^{n} \left( w_i \cdot \frac{1}{1 + \max(0, e_i - D_i)} \right) - \lambda \sum_{i=1}^{n} \text{EnergyPenalty}(s_i, w_i) $$
Subject to hard temporal constraints:
Duration Consistency: $$ e_i - s_i = d_i, \quad \forall i \in {1, \dots, n} $$
Non-Overlapping Work & Fixed Events: For any two planned tasks or existing calendar events ( j ) and ( k ): $$ [s_j, e_j) \cap [s_k, e_k) = \emptyset, \quad \forall j \neq k $$
Buffer Margin Preservation: Minimum rest interval ( \delta \ge 10 \text{ min} ) between back-to-back deep focus blocks: $$ s_{j} - e_{k} \ge \delta \quad \text{or} \quad s_{k} - e_{j} \ge \delta $$
Working Day Boundaries: $$ T_{\text{start}} \le s_i < e_i \le T_{\text{end}}, \quad \forall i $$
By embedding these mathematical guardrails directly into the agent's MCP generate_plan and execute_plan tools, LifeOS ensures that scheduled blocks strictly honor reality, calendar boundaries, and human energy levels.
How We Built It LifeOS is structured as a production-grade TypeScript monorepo powered by pnpm workspaces and turbo:
LifeOS Architecture: ┌────────────────────────────────────────────────────────┐ │ Next.js 14 App Router (TailwindCSS + Zustand) │ │ Dashboard · Today · Tasks · Projects · Alexa+ │ └──────────────┬───────────────────────────▲─────────────┘ │ POST /api/agent/chat │ GET /api/agent/stream ▼ │ (Server-Sent Events) ┌──────────────────────────────────────────┴─────────────┐ │ AgentOrchestrator (@lifeos/ai) │ │ Goal Analysis ──► Context Extraction ──► Planning │ └──────────────┬─────────────────────────────────────────┘ │ MCP Streamable HTTP (spec 2025-11-25) ▼ ┌────────────────────────────────────────────────────────┐ │ Express MCP Server (@lifeos/mcp-server, Port 3001) │ │ Bearer Auth · Rate Limiting · 12 Scoped Tools │ └──────────────┬─────────────────────────────────────────┘ │ Prisma ORM ▼ ┌────────────────────────────────────────────────────────┐ │ PostgreSQL 16 Database (@lifeos/database) │ │ Users · Tasks · CalendarEvents · Projects · Sessions│ └────────────────────────────────────────────────────────┘ Tech Stack Highlights: Frontend: Next.js 14.2 (App Router), React 18, Tailwind CSS, Framer Motion for micro-animations, Zustand for client state, and Lucide React icons. MCP Infrastructure: Express, @modelcontextprotocol/sdk v1.5+, implementing the Streamable HTTP transport over POST /mcp with stateless per-request execution. AI Engine: Provider-agnostic abstraction supporting OpenAI GPT-4o, Anthropic Claude 3.5 Sonnet, and a zero-dependency algorithmic scheduler fallback. Data Layer: PostgreSQL 16 managed via Prisma 5 with relational integrity, compound indexes, and cryptographic session tracking. Verification & CI: 211 Vitest unit/regression tests, 46 MCP integration tests, Playwright E2E suites, and 7 automated GitHub Actions CI checks. Challenges We Faced Stateless MCP Transport under Streamable HTTP: The MCP specification (2025-11-25) introduces Streamable HTTP. Initially, maintaining state across multi-step agent actions led to session-mismatch errors. We solved this by designing a stateless, per-request server factory that binds the authenticated userId directly into the tool-call closure while omitting sessionIdGenerator. This eliminated state leaks and enabled instant scalability.
Cross-Tenant Multi-User Isolation: In AI agent architectures, prompt injections or improper scoping can lead to data leaks across users. We enforced zero-trust database scoping at every boundary:
Every MCP tool injects where: { id, userId }. Signed identity tokens verify user ownership before tool dispatch. We proved isolation with automated cross-tenant penetration tests (
scripts/test-cross-user-isolation.ts ), confirming that User B can never read or mutate User A's tasks or sessions. Timezone Horizon Date-Shifting Traps: Converting timestamps between local ISO strings and UTC without accounting for user timezones caused late-evening tasks (e.g., 9:00 PM) to bleed into the following day's calendar view. We engineered timezone-aware helpers utilizing Intl.DateTimeFormat with IANA timezone strings (America/Los_Angeles, America/New_York, etc.), locking scheduled events to their intended operational date.
Self-Healing Local Database Reliability: PostgreSQL process terminations during rapid development left stale postmaster.pid lock files on disk, blocking subsequent boots. We implemented a self-healing bootstrapper in start-pg.mjs that probes PID liveness using low-level OS signaling (process.kill(pid, 0)), automatically purging zombie lock files before starting embedded PostgreSQL.
Accomplishments That We're Proud Of 12 Fully Functional MCP Tools: Not mock endpoints, but production-tested tools with full CRUD, semantic search, day analysis, and two-phase atomic plan execution. Sub-50ms Local Tool Execution: High-throughput database transactions with near-instant UI reflections. 100% CI Test Coverage: 211 of 211 unit tests and 46 of 46 MCP integration tests passing with 0 lint warnings and 0 type errors. Voice-First Parity: Full feature parity between the graphical Dashboard and the conversational Alexa+ simulator. Zero-Cost Deployment Ready: Fully self-contained local developer experience with Docker Compose and embedded options requiring zero external paid subscriptions. What We Learned MCP is the Future of Agentic Tools: The Model Context Protocol provides an elegant, vendor-neutral standard for exposing internal capabilities to AI models without vendor lock-in. Determinism Trumps Pure Generation: LLMs are brilliant at understanding human intent, but mathematical constraint algorithms must validate and enforce calendar layouts and database invariants. Observability Builds Trust: Streaming tool executions in real-time through SSE completely changed user perception—transforming the AI from a black-box into a transparent pair-programmer for life. What's Next for LifeOS Native Alexa Skill Certification: Packaging the /alexa voice interaction model into an official Alexa Skill using the Alexa Conversations and MCP bridge. Two-Way Google & Microsoft Outlook Calendar Sync: Real-time webhook synchronisation to reflect external meeting changes instantly. Biometric Cognitive Load Balancing: Integrating Apple Health and WHOOP APIs to dynamically adjust task intensity based on recovery and sleep scores. On-Device Edge Model Inference: Running lightweight reasoning models locally via WebGPU/Ollama for 100% offline, privacy-first life management.
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for LifeOS — Your AI Personal Command Center
Built With
- alexa
- anthropic
- docker
- express.js
- framer-motion
- github-actions
- lucide-react
- mcp
- model-context-protocol
- monorepo
- next.js
- node.js
- openai
- playwright
- pnpm
- postgresql
- prisma
- react
- server-sent-events
- tailwindcss
- typescript
- vitest
- zod
- zustand
Log in or sign up for Devpost to join the conversation.