Skip to main content
Limelight gives you deep visibility into your running app without rebuilds, heavy configuration, or invasive instrumentation. This page explains the architecture — from event capture to the structured context that powers AI-assisted debugging.

Architecture Overview

Every surface — the MCP server, the desktop app, the API — consumes the same Debug IR. The intelligence is built once in the engine and delivered everywhere.

Step 1: Event Capture

When you call Limelight.connect(), the SDK attaches lightweight interceptors inside your app:

Client Side (React / React Native)

Server Side (Node.js / Express / Next.js)

When you add Limelight middleware to your server:
  1. Captures every incoming HTTP request with method, URL, headers, and body
  2. Records the response including status code, body, and timing
  3. Propagates trace IDs via AsyncLocalStorage so context flows through async handlers
  4. Streams events to the same engine as your client-side data

Full-Stack Tracing

When both sides are connected, Limelight automatically correlates client and server events using a shared x-limelight-trace-id header. The client attaches it to every outgoing request, and the server middleware reads it to link the incoming request to the same trace. No configuration needed.

Step 2: Correlation Engine

Raw events are useful. Correlated events are powerful. The correlation engine links events together by analyzing:
  • Temporal proximity — what happened immediately before and after an event
  • Causal relationships — a state update that triggered a re-render, a network response that caused a state change
  • Cross-boundary links — frontend request → backend response → state update → re-render, connected automatically via trace IDs and timing
  • Pattern detection — recurring sequences that indicate known anti-patterns
The output is a correlation graph where each event has typed edges to related events: Each edge carries a confidence score, so consumers know how strong the relationship is.

Step 3: Debug IR

Debug IR (Debug Intermediate Representation) is the structured output of the correlation engine. It’s designed to be:
  • Structured — JSON with consistent schemas, not free-text logs
  • Token-efficient — optimized for LLM consumption without wasting context window
  • Anonymized — sensitive values are type-described, not exposed (e.g., "password": "[string, 12 chars]")
  • Pre-analyzed — includes detected violations, causal chains, and suggested fixes
A Debug IR analysis includes: This is what makes Limelight’s context fundamentally different from raw logs or browser DevTools data. The AI receives pre-analyzed, correlated context — not a wall of text to parse.

Step 4: Delivery

Debug IR flows to whichever surface needs it:

MCP Server

Your AI coding assistant calls Limelight’s 11 tools via the MCP protocol. Each tool returns structured Debug IR — the AI gets pre-analyzed context and can diagnose issues, suggest fixes, and explain behavior using real runtime data.

Desktop App

The visual timeline UI renders the same Debug IR as an interactive experience — click any event to see the full cause-and-effect chain, correlated events, and AI-powered diagnosis.

What Gets Detected Automatically

The engine identifies these patterns without any configuration:

Data Privacy

  • All data stays on your machine — the MCP server and desktop app run locally
  • No telemetry, no cloud dependency for core functionality
  • Sensitive headers (Authorization, Cookie, etc.) are automatically redacted
  • State values are type-described by default, not exposed as raw values
  • The beforeSend hook lets you filter or transform any event before it’s processed