Architecture

The infrastructure layer

Temporal Cortex sits between calendar provider APIs (Google, Outlook, CalDAV) and your AI agent. It handles the scheduling intelligence that raw calendar APIs don’t provide: deterministic temporal computation, cross-provider availability merging, and atomic booking with Two-Phase Commit.

┌─────────────────────────────────────────┐
│           Your AI Agent / Product        │
├─────────────────────────────────────────┤
│     MCP  │  A2A  │  REST  │  Browser    │  ← 4 Protocols
├─────────────────────────────────────────┤
│           Temporal Cortex                │  ← Scheduling Infrastructure
│  ┌────────────────────────────────────┐ │
│  │ Layer 4: Booking (2PC)            │ │
│  │ Layer 3: Availability Merging     │ │
│  │ Layer 2: Calendar Operations      │ │
│  │ Layer 1: Temporal Context         │ │
│  │ Layer 0: Discovery                │ │
│  └────────────────────────────────────┘ │
├─────────────────────────────────────────┤
│  Google Calendar │ Outlook │ CalDAV      │  ← Calendar Providers
└─────────────────────────────────────────┘

5-layer tool model

Tools are organized into layers that build on each other. Lower layers have no dependencies; higher layers compose capabilities from below.

Layer 0: Discovery (3 tools)

Contact search, identity resolution, and scheduling path discovery. The agent finds who to schedule with and discovers the best communication path.

  • search_contacts — Search address books by name across Google People API and Microsoft Graph
  • resolve_contact — Resolve a contact to their scheduling capabilities (Agent Card, Temporal Link, email)
  • resolve_identity — Full identity resolution with Open Scheduling discovery (Platform Mode)

Layer 1: Temporal Context (5 tools)

Pure computation — no calendar connection needed. Works immediately with zero setup.

  • get_temporal_context — Current time, timezone, day of week, week/month boundaries
  • resolve_datetime — Natural language → ISO 8601 ("next Tuesday at 3pm"2026-03-03T15:00:00-08:00)
  • convert_timezone — Convert timestamps between timezones (DST-safe)
  • compute_duration — Calculate duration between two timestamps
  • adjust_timestamp — Add/subtract time periods from a timestamp

Layer 2: Calendar Operations (5 tools)

Direct calendar data access. Requires OAuth authentication with at least one provider.

  • list_calendars — All connected calendars with IDs, names, provider types
  • list_events — Calendar events for a date range, filterable by calendar
  • find_free_slots — Available time slots across all connected calendars
  • check_availability — Is a specific time slot available? Returns conflicts if not
  • expand_rrule — Deterministic RFC 5545 RRULE expansion via Truth Engine

Layer 3: Availability (2 tools)

Cross-provider availability merging. Returns “when are you free?” not “here are your events.”

  • get_availability — Merge free/busy across all connected calendars into unified view
  • query_public_availability — Query another person’s public availability (Platform Mode)

Layer 4: Booking (3 tools)

Safe mutation with concurrency control.

  • book_slot — Atomic booking with Two-Phase Commit (lock → verify → write → release)
  • request_booking — Send booking request to another user’s Open Scheduling endpoint (Platform Mode)
  • compose_proposal — Compose scheduling proposal for email/SMS delivery (backward compatibility)

4 protocols

The same 18 tools are accessible through 4 protocols:

ProtocolCommunication patternPrimary use case
MCPAgent ↔ ToolsAI agent directly calls scheduling tools
A2AAgent ↔ AgentTwo agents negotiate scheduling over Google’s open A2A protocol
RESTApp ↔ APIEmbed scheduling into your product via HTTP endpoints
BrowserHuman ↔ BookingTemporal Links — public booking pages for people without agents

Two operating modes

Local Mode (default)

No external dependencies. The binary runs entirely on your machine.

  • All 15 core tools available
  • In-process locking for atomic booking
  • Local credential storage
  • No account required

Platform Mode

Connects to the Temporal Cortex platform for multi-agent coordination.

  • All 18 tools (adds resolve_identity, query_public_availability, request_booking)
  • Distributed Redis Redlock for multi-agent booking safety
  • Managed OAuth lifecycle
  • Usage metering and dashboard

Core computation: Truth Engine + TOON

Truth Engine is the deterministic computation library (written in Rust) that powers all temporal math. Instead of asking the LLM to expand FREQ=WEEKLY;INTERVAL=2;BYDAY=TU,TH;COUNT=8, Truth Engine computes the exact occurrences with zero hallucination.

TOON (Token-Oriented Object Notation) compresses calendar payloads by ~40% before they enter the agent’s context window. All data tools return TOON by default; pass format: "json" for standard JSON.

Both are available as standalone libraries: Rust, JavaScript/WASM, Python.