Laminar
Open-source observability platform purpose-built for AI agents — trace, evaluate, debug, and monitor at scale with SQL access and real-time replay.
Laminar is an open-source observability platform purpose-built for AI agents. It gives developers end-to-end visibility into agent behavior that traditional logging cannot capture: distributed traces across every LLM call, tool use, and sub-agent interaction; real-time streaming traces as they happen; and a built-in AI-powered debugger that lets you replay any trace with LLM response caching — pausing, rewinding, and inspecting intermediate outputs without re-running expensive model calls.
At its core, Laminar integrates natively with OpenTelemetry and ships first-party SDKs for TypeScript and Python that auto-instrument popular frameworks including OpenAI, Anthropic, Gemini, LangChain, Vercel AI SDK, Browser Use, Stagehand, and Playwright. A single initialization call captures the full execution graph of your agent, including token counts, costs, latencies, and model metadata — all searchable via Quickwit full-text search and queryable via a built-in SQL editor backed by ClickHouse.
Beyond tracing, Laminar includes a Signals system for defining natural-language monitoring rules that fire automatically across millions of spans, an Evals SDK and CLI for CI/CD-integrated evaluation pipelines, browser session replay synced to agent traces, and a dashboard builder with custom SQL queries. The backend is written in Rust for high-throughput span ingestion via gRPC, while the frontend is a Next.js 15 application with Drizzle ORM and PostgreSQL for metadata. The full stack deploys via Docker Compose and can run in a lightweight single-node mode or a production-grade full-stack with RabbitMQ and remote storage.
What You Get
- OpenTelemetry-native SDK - Auto-instrument OpenAI, Anthropic, Gemini, LangChain, Vercel AI SDK, Browser Use, Stagehand, and Playwright with a single initialization call in TypeScript or Python.
- AI-powered replay debugger - Replay any agent trace with server-side LLM response caching so you can pause execution at any checkpoint, inspect intermediate outputs, and iterate without re-spending model budget.
- Signals for natural-language monitoring - Define custom monitoring rules in plain English (e.g., ‘agent failed to extract pricing data’) and have them evaluated automatically across incoming spans using structured output schemas.
- SQL editor and ClickHouse analytics - Query traces, spans, metrics, and events with a full SQL editor backed by ClickHouse; bulk-export filtered datasets via API for downstream evaluation or fine-tuning pipelines.
- Evals SDK and CLI - Run unopinionated, extensible evaluations locally or in CI/CD pipelines with a unified results UI for comparing outputs across model versions and prompt variants.
- Browser session replay - Automatically record and sync browser screen captures from Browser Use, Stagehand, and Playwright sessions with the corresponding agent trace, timestamped to the exact span.
- Custom dashboard builder - Build dashboards combining trace metrics, event counts, and arbitrary SQL queries with configurable time ranges for ongoing agent health monitoring.
- Data annotation and dataset creation - Annotate trace data with custom labels using a purpose-built rendering UI and export labeled datasets directly for use in evaluation or model fine-tuning workflows.
Common Use Cases
- Debugging silent agent failures - A developer whose agent intermittently returns empty tool results uses the replay debugger to re-execute the failing trace with cached LLM responses, pinpointing the exact span where the output schema mismatch occurred without spending additional model budget.
- Monitoring LLM cost and quality regressions in production - A platform team defines a ClickHouse-backed dashboard tracking average token cost, p95 latency, and error rate per model version; they get alerted via a Signal rule when error rates exceed threshold after a model upgrade.
- Automating evaluation in CI/CD - An ML engineer integrates the Laminar eval CLI into a GitHub Actions workflow, running a suite of evaluators against agent outputs on every PR and blocking merges when aggregate score drops below a configured threshold.
- Building fine-tuning datasets from production traces - A researcher filters 48 hours of production traces by a ‘logic_error’ Signal, annotates 600 matching spans in the Laminar UI with structured labels, and exports the labeled dataset via API for use in a supervised fine-tuning run.
- Tracing browser automation agents - A QA team instruments a Stagehand-based web automation agent and uses Laminar’s browser session replay to correlate the recorded screen video with the agent’s decision trace, identifying where the agent misidentified a UI element.
Under The Hood
Architecture
Laminar is structured as a polyglot multi-service system with clear separation between a high-throughput data plane and a query/analytics plane. The Rust-based app-server handles OpenTelemetry span ingestion over gRPC on a dedicated port, HTTP REST APIs on a second port, and Server-Sent Events for real-time trace streaming on a third — three communication channels with distinct performance characteristics sharing a single process. Internally the server is organized into deep domain modules (traces, signals, evaluations, debugger, checkpoints, query_engine, realtime) each with their own message queue consumers and producers when RabbitMQ is available. A feature-flag system (features/mod.rs) gates advanced capabilities like Signals clustering and PII redaction at compile time, allowing a stripped-down OSS build and a fully-featured private build from the same source tree. The frontend is fully decoupled from the backend, communicating via environment-configured URLs, enabling independent deployment and local development cycles. Storage is layered: PostgreSQL holds relational metadata via SQLx, ClickHouse stores analytical time-series span data, Quickwit provides full-text search over span content, and Redis serves as a cache for debugger replay sessions and real-time pub/sub.
Tech Stack
The backend is written in Rust 2024 edition using Actix-Web 4 for HTTP, Tonic for gRPC, and Tokio for the async runtime, with jemalloc as the global allocator for reduced memory fragmentation under high concurrency. Database access uses SQLx for PostgreSQL and the native ClickHouse Rust client. The frontend is Next.js 15 with React, NextAuth for authentication (supporting Okta, Google, GitHub, and email providers), Drizzle ORM for type-safe PostgreSQL migrations, and Zod for runtime schema validation. Span ingestion uses protobuf-encoded OpenTelemetry proto messages decoded with Prost. The Signals clustering feature uses ONNX Runtime and tokenizers for embedding-based event grouping when the signals Cargo feature is enabled. RabbitMQ (via lapin) queues asynchronous workloads including span processing, signal evaluation, browser event handling, and notification delivery. The full Docker Compose stack adds Quickwit v0.8 for search and optionally S3-compatible object storage for large span payloads.
Code Quality
The Rust backend has extensive inline documentation and module-level doc comments throughout, and the query engine in particular has thorough unit test coverage with 389 #[test] cases covering SQL generation, AST validation, filter edge cases, and SQL injection prevention via the AST-regeneration approach in json_to_sql.rs. The TypeScript frontend has eleven test files covering OpenAI response parsing, LLM header handling, playground utilities, UUID generation, and provider registry behavior. Error handling in Rust is explicit using anyhow and thiserror, with typed error variants and granular HTTP status codes. Custom cache keys, deduplication logic for tool calls and spans, and a three-state debugger cache warmup protocol (Hit/Miss/Live) indicate careful attention to edge cases. CI is present via GitHub Actions. The signals module demonstrates a clean public/private split where OSS builds compile against a no-op stub, ensuring the build always succeeds regardless of which feature set is compiled.
What Makes It Unique
Laminar’s most distinctive capability is the server-side replay debugger with LLM response caching: when replaying a trace, the app-server lazily warms a scoped cache of original LLM responses keyed by input hash and cache_until checkpoint, so the SDK can re-execute the agent deterministically from any point in its execution graph without making live model calls. This is fundamentally different from simple span recording — it enables iterative, cost-free debugging of agent logic. The compile-time feature flag architecture (the signals Cargo feature) also stands out: it allows the same codebase to ship as a stripped OSS build or a production-grade private build with ONNX-powered clustering, without conditional runtime checks or configuration divergence. The real-time SSE engine using DashMap for connection tracking enables sub-second trace streaming to the browser as spans arrive, which is non-trivial at the throughput Laminar targets.
Self-Hosting
Laminar is released under the Apache License 2.0, one of the most permissive OSI-approved open-source licenses available. You can use it commercially, modify it, distribute it, and incorporate it into proprietary products without any obligation to open-source your own code. There are no copyleft implications for self-hosters: deploying Laminar on your own infrastructure does not require you to release any of your application code. The only restrictions are standard attribution requirements (keep the license notice) and a trademark clause (don’t use the Laminar name to imply endorsement).
Running Laminar yourself requires operating several services in concert: PostgreSQL for relational metadata, ClickHouse for analytical queries, Quickwit for full-text search, Redis for caching and pub/sub, and optionally RabbitMQ for asynchronous workloads in the full-stack configuration. The lightweight Docker Compose variant (omitting RabbitMQ) is suitable for small teams and evaluation, while the full-stack compose adds message queuing and is recommended for production. You are responsible for all database backups, schema migrations (managed by Drizzle), ClickHouse capacity planning for high-volume span ingestion, and Quickwit index management. The Rust backend is built with performance in mind and runs well on a single node for moderate workloads, but horizontal scaling of the app-server or ClickHouse requires manual infrastructure investment.
Compared to the managed laminar.sh cloud service, self-hosting means you handle upgrades manually by pulling new Docker images as new releases ship (the project releases at roughly four times per month). The managed platform includes built-in high availability, automated backups, SLA guarantees, priority support, and an enterprise tier with custom data retention, on-premise options, and dedicated support. The Signals clustering feature — which uses ONNX Runtime for embedding-based event grouping — is gated behind a private Cargo feature and is not available in the open-source build; it is only available on the managed cloud or through an enterprise arrangement.
Related Apps
Ollama
AI Development · Developer Tools
Run Llama, Gemma, DeepSeek, and other open LLMs on your own machine with one command and an OpenAI-compatible API.
Ollama
MITLangflow
AI Agents · AI Development
Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.
Langflow
MITDify
No Code Platforms · AI Development · Developer Tools
Visual LLM workflow platform with RAG pipelines, agent capabilities, and model management for building production AI applications.