Latitude

Open-source AI agent monitoring that catches what will break next before your users do.

3.9Kstars
303forks
GNU Lesser General Public License v3.0
TypeScript

Latitude is an open-source AI agent monitoring platform built for teams running LLMs and autonomous agents in production. Positioned as “Sentry, but for agents,” it captures every trace from real traffic, groups failed runs into tracked issues with status and trend data, and alerts you the moment a new failure pattern emerges.

Unlike traditional observability tools that surface raw logs, Latitude is issue-centric: failures are clustered into named issues, annotated with human or LLM-as-judge scores, and continuously tracked against drift from your team’s quality baseline. Engineers and AI product teams use it to move from reactive fire-fighting to proactive reliability.

Latitude is built in TypeScript as a pnpm monorepo with separate apps for API, ingestion, workers, Temporal workflows, and a React-based web UI. It integrates via OpenTelemetry-compatible instrumentation, supporting every major LLM provider and framework out of the box—OpenAI, Anthropic, Bedrock, Vercel AI SDK, LangChain, and more.

Deployment options span a single-host Docker Compose setup, a Kubernetes Helm chart for cluster-scale HA, one-click Railway deployment, and a cloud-hosted tier with 20K free credits per month and unlimited seats.

What You Get

  • Issue-centric monitoring - Failed traces are automatically grouped into tracked issues with status, size, trend, and alert escalation—not just raw log streams.
  • Agent-native tracing - Multi-turn sessions, tool calls, sub-agent invocations, and full execution paths are captured in a single unified trace view.
  • Semantic search - Find any trace by meaning, exact phrase, or approximate similarity across 100% of ingested data with no sampling.
  • Human-aligned evaluations - Build evals from your team’s actual quality judgments and track an alignment score that measures drift from human ground truth over time.
  • Issue alerts - Get notified the moment a new failure pattern is detected or an existing issue escalates, via Slack, email, or webhook.
  • MCP server integration - Everything available in the Latitude UI is also accessible from your AI coding agent through a native MCP server.
  • Claude Code telemetry - Dedicated package captures full Claude Code session transcripts as structured traces with a single install command.
  • Self-hosting on any scale - Single-host Docker Compose, Kubernetes Helm chart, or one-click Railway deployment all built on fully open infrastructure.

Common Use Cases

  • Monitoring production AI chatbots - A customer support team instruments their chatbot with one npm package, then uses Latitude issues to catch misclassification patterns within minutes of deployment.
  • Debugging multi-step agent pipelines - A developer traces a ReAct agent’s tool calls and sub-agent hops in a single session view to find which step introduced a hallucination.
  • Building quality-aligned evaluations - An AI team annotates failing traces with human scores, calibrates an LLM-as-judge against them, and monitors the alignment score as the model changes.
  • Reducing noise in LLM alerting - A platform team connects Slack to Latitude issue alerts so oncall engineers see grouped failure escalations rather than raw spike notifications.
  • Tracing Claude Code sessions - An AI-assisted engineering team installs the claude-code-telemetry package to observe exactly which prompts, tool calls, and file edits their coding agent makes.
  • Operating OSS AI infrastructure - A self-hosting team deploys Latitude on Kubernetes alongside their LLM gateway to monitor cost, latency, and failure rates across multiple model providers.

Under The Hood

Architecture Latitude is structured as a pnpm monorepo with distinct application boundaries: an HTTP API layer built on Hono, an ingestion service that decodes and routes OTLP payloads, a BullMQ-backed worker fleet for background processing, a Temporal workflow engine for long-running analysis pipelines, and a React SPA for the web UI. The design enforces strict separation between domain logic and infrastructure by routing all persistence and queue access through platform adapter packages, meaning the application layer never imports a database client directly. Temporal orchestrates the most complex analysis work—session analysis, evaluation optimization, taxonomy gardening—with explicit retry policies, signal-driven debouncing, and deterministic replay safety ensured by patch guards in workflow definitions.

Tech Stack The entire platform is written in TypeScript (Node.js 25+) with pnpm and Turbo managing incremental builds across the monorepo. The web frontend uses React 19 with TanStack Router, while the API uses Hono with zod-openapi for typed, auto-documented endpoints. Primary storage is PostgreSQL with the pgvector extension for embedding search, and ClickHouse for high-throughput trace analytics. Redis serves as both a cache layer and a BullMQ job queue broker, with a separate noeviction instance for worker coordination. Temporal handles workflow orchestration, Weaviate is available for vector embedding, and the platform adapter layer includes integrations for Posthog analytics, Framer changelog, Loops email, Slack notifications, and object storage.

Code Quality Test coverage is extensive: unit tests live colocated with source files, integration tests use in-memory and transaction-scoped databases via a shared testkit package, and workflow tests validate Temporal activity sequences against the full activity graph. Biome enforces formatting and linting with consistent rules across the monorepo, and Knip audits unused exports to prevent dead code accumulation. The Effect.js library is used for functional error handling in core services, providing explicit typed error channels rather than thrown exceptions. TypeScript is in strict mode across all packages, and all public APIs are typed end-to-end including the auto-generated OpenAPI and MCP schemas.

What Makes It Unique Latitude’s defining architectural decision is treating failures as first-class entities rather than log lines. The issue tracking layer automatically clusters related failed traces, assigns them lifecycle status, and measures trend velocity—this is infrastructure almost no monitoring tool provides for LLM workloads. The alignment score system quantifies drift between LLM-as-judge evaluations and human annotations over time, giving teams a leading indicator of quality regression before users report it. The MCP server exposes the full platform API to AI coding agents natively, enabling agentic workflows that inspect, triage, and act on their own monitoring data. The GEPA prompt optimizer implements a research-grade evolutionary algorithm to find better prompts automatically against your real evaluation suite.

Self-Hosting

Latitude is released under the MIT License, which means you can use, modify, and distribute it freely for any purpose—commercial or otherwise—without restrictions or copyleft obligations. You are not required to open-source any application code that uses or embeds Latitude, making it straightforward to deploy as internal tooling inside a commercial product.

Running Latitude yourself means operating a non-trivial distributed system. A production-grade single-host deployment requires PostgreSQL (with pgvector), ClickHouse, two Redis instances (one for cache, one for BullMQ with noeviction policy), Temporal (which itself depends on Postgres), and optionally Weaviate for vector search—all coordinated via Docker Compose or Kubernetes. The Helm chart and single-host guides reduce first-day complexity, but ongoing responsibility for schema migrations, data retention, backup, and ClickHouse partition management falls entirely on you. Node.js 25 is required, and the monorepo build system (Turbo + pnpm 10) adds developer toolchain overhead compared to single-binary tools.

The cloud-hosted tier at latitude.so provides 20K credits per month free with unlimited seats, 30-day data retention, and no infrastructure to maintain. Compared to self-hosting, the managed service adds automatic upgrades, Latitude-managed backups, SLA-backed uptime, and direct Slack community support from the core team. The self-hosted path gives you full data sovereignty, unlimited retention, and the ability to deploy inside a private VPC—trade-offs that are straightforward for teams with existing Kubernetes or Docker Compose operations but a meaningful burden for those without.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack

No spam. Unsubscribe anytime.

Join 750+ subscribers
No spam. Unsubscribe anytime.

Search