Architecture Overview
Step 1: Event Capture
When you callLimelight.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:- Captures every incoming HTTP request with method, URL, headers, and body
- Records the response including status code, body, and timing
- Propagates trace IDs via
AsyncLocalStorageso context flows through async handlers - 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 sharedx-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
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
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
beforeSendhook lets you filter or transform any event before it’s processed