Skip to content

Introduction

What is AgentLens?

AgentLens is an open-source observability and audit trail platform for AI agents. Think of it as a flight recorder — it captures every tool call, approval decision, data exchange, and error your agents produce, then presents it through a queryable API and web dashboard.

Why AgentLens?

The AI agent ecosystem has exploded, yet observability infrastructure is virtually nonexistent. Teams deploy agents to production with zero visibility into what those agents actually do.

When an agent fails, there's no trace. When it succeeds, there's no understanding of why. When auditors ask what happened, there's no record.

AgentLens fills this gap.

Key Features

FeatureDescription
MCP-NativeShips as an MCP server — agents connect to it like any other tool
Real-Time DashboardSession timelines, event explorer, analytics charts, alerting
Tamper-EvidentAppend-only storage with SHA-256 hash chains per session
Cost TrackingToken usage and estimated costs per session, agent, and time period
AlertingConfigurable rules for error rate, cost spikes, latency anomalies
IntegrationsFirst-class support for AgentGate (approvals) and FormBridge (data collection)
Self-HostedSQLite by default, PostgreSQL optional. Your data, your infrastructure

Architecture at a Glance

AI Agents (Claude, GPT, Custom)

       │ MCP Protocol (stdio/SSE)

┌─────────────────────┐
│  @agentlensai/mcp     │  ← MCP server with 4 tools
└────────┬────────────┘
         │ HTTP

┌─────────────────────┐
│  @agentlensai/server  │  ← Hono API + Dashboard
│  ┌───────────────┐  │
│  │ SQLite / PG   │  │  ← Append-only event store
│  └───────────────┘  │
│  ┌───────────────┐  │
│  │ React SPA     │  │  ← Dashboard UI
│  └───────────────┘  │
└─────────────────────┘

Part of the AgentKit Suite

AgentLens is designed to work alongside:

  • AgentGate — Human-in-the-loop approval gateway for sensitive agent actions
  • FormBridge — Structured data collection from humans during agent workflows

Together, they provide unified agent lifecycle management: data collection → approvals → observability.

Packages

AgentLens is a monorepo with six packages:

PackagenpmDescription
@agentlensai/corenpmShared types, schemas, and utilities
@agentlensai/servernpmHono API server + dashboard
@agentlensai/mcpnpmMCP server for agent instrumentation
@agentlensai/dashboardReact dashboard (bundled with server)
@agentlensai/sdknpmProgrammatic TypeScript client
@agentlensai/clinpmCommand-line interface

Released under the MIT License.