
AgentLens
io.github.agentkitai由 GitHub 账号 agentkitai 发布v0.13.7更新于 Oct 24, 2026
Tamper-evident, SHA-256 hash-chained audit trail and observability for AI agents.
概览
让助手查询 AgentLens 可观测性服务器,获取 AI 智能体会话、事件、LLM 分析、成本、健康评分和防篡改审计轨迹。
- 可以做什么
- AgentLens 是面向 AI 智能体的可观测性与审计轨迹平台。其 MCP 服务器提供 22 个工具,覆盖核心可观测性、智能分析与运维,助手可借此查看会话与事件时间线、搜索事件、查看 LLM 调用分析、token 用量与成本、检查智能体健康评分,并使用基于 SHA-256 哈希链的审计日志。它通过 HTTP 与单独运行的 AgentLens 服务器通信。
- 适用场景
- 当你已经运行 AgentLens 实例,并希望助手从 Claude Desktop、Cursor 或其他 MCP 客户端读取或操作智能体遥测与审计记录时,值得添加。它本身无法独立工作,只能查询 AgentLens 服务器。
- 运行要求
- 需要本地 Node.js 运行时,通过 npx 运行 npm 包 @agentkitai/agentlens-mcp,并需要可访问的 AgentLens 服务器。文档中的配置会设置 AGENTLENS_API_URL 和 AGENTLENS_API_KEY;API 密钥在 AgentLens 服务器上创建且仅显示一次。清单未声明任何认证或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 AgentLens,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
🔍 AgentLens
Open-source observability for AI agents — with a tamper-evident audit trail
Every event SHA-256 hash-chained & cryptographically verifiable — built for EU AI Act Article 12 record-keeping
[PyPI] [npm server] [npm mcp] [License: MIT] [Build Status] [Container: ghcr.io/agentkitai/agentlens]
📖 Documentation · Quick Start · Dashboard · ☁️ Cloud
📑 Table of Contents
- Tamper-Evident by Design
- Quick Start
- Architecture
- Integration Guides
- Key Features
- Dashboard
- AgentLens Cloud
- Packages
- API Overview
- CLI
- Development
- Contributing
- AgentKit Ecosystem
- License
AgentLens is a flight recorder for AI agents. It captures every LLM call, tool invocation, approval decision, and error — then presents it through a queryable API and real-time web dashboard.
🔒 Tamper-evident by design
What sets AgentLens apart from other observability tools: every event is SHA-256 hash-chained to the one before it, the same way git commits and blockchains are linked. The audit log is append-only and cryptographically verifiable — alter, delete, or reorder a single record after the fact and verification fails, pointing at the exact event that broke. Purpose-built for the record-keeping obligations of EU AI Act Article 12 and the emerging IETF Agent Audit Trail work.
See it for yourself in 30 seconds (needs Docker):
The demo ingests a real trace, verifies the chain (passes), edits one record directly in the database behind the audit log's back, then re-verifies (fails). Auditors get a signed, verifiable JSON snapshot from GET /api/audit/verify/export.
Five ways to integrate — pick what fits your stack:
🚀 Quick Start
One command — server + dashboard on SQLite, zero config:
Or without Docker:
AUTH_DISABLED=trueis for a quick local trial (JWT_SECRETis still required by the hardened image). For anything shared, dropAUTH_DISABLED, set a realJWT_SECRET, and create an API key (below).
Full stack (Postgres + Redis, auth, TLS) — runs from source:
Create an API Key
Save the als_... key from the response — it's shown only once. Then head to the Integration Guides to instrument your agent.
🏗️ Architecture
🔧 Integration Guides
🔭 OpenTelemetry (any GenAI agent — no SDK)
If your agent is already instrumented with the OpenTelemetry GenAI semantic conventions — via OpenLLMetry, OpenInference, or the official OTel instrumentations — just point its OTLP exporter at AgentLens. No AgentLens SDK required.
AgentLens maps gen_ai.* spans into its model and into the tamper-evident audit log:
Each OTel trace maps to a session (or gen_ai.conversation.id if present), and every event is hash-chained like any other — so traces from any GenAI framework get the same verifiable audit trail. Set OTLP_AUTH_TOKEN to require a bearer token on the OTLP endpoints in production.
Cost with no SDK: OTel GenAI instrumentation reports tokens but rarely cost. AgentLens reconstructs
costUsdfrom the model's per-1M-token pricing (fuzzy-matched on the model id), so OTel-only agents get the same cost analytics as SDK-instrumented ones — no per-call cost attribute required.
🤖 OpenClaw Plugin
If you're running OpenClaw, the AgentLens plugin captures every Anthropic API call automatically — prompts, completions, token usage, costs, latency, and tool calls.
Set AGENTLENS_URL if your AgentLens instance isn't on localhost:3400. See the plugin README for details.
🐍 Python Auto-Instrumentation
One line — every LLM call captured automatically across 9 providers (OpenAI, Anthropic, LiteLLM, AWS Bedrock, Google Vertex AI, Google Gemini, Mistral AI, Cohere, Ollama):
Key guarantees: ✅ Deterministic · ✅ Fail-safe · ✅ Non-blocking · ✅ Privacy (init(redact=True))
🔌 MCP Integration
For Claude Desktop, Cursor, or any MCP client — add to your config:
AgentLens ships 22 MCP tools — covering core observability, intelligence & analytics, and operations. Full MCP tool reference →
📦 Programmatic SDK
Python:
TypeScript:
✨ Key Features
- 🐍 Python Auto-Instrumentation —
agentlensai.init()captures every LLM call across 9 providers automatically. Deterministic — no reliance on LLM behavior. - 🔌 MCP-Native — Ships as an MCP server. Works with Claude Desktop, Cursor, and any MCP client.
- 🔭 OpenTelemetry GenAI — Ingests
gen_ai.*OTLP traces from any OTel-instrumented agent (OpenLLMetry, OpenInference, official OTel) — no AgentLens SDK required. - 🧠 LLM Call Tracking — Full prompt/completion visibility, token usage, cost aggregation, latency measurement, and privacy redaction.
- 📊 Real-Time Dashboard — Session timelines, event explorer, LLM analytics, cost tracking, and alerting.
- 🔒 Tamper-Evident Audit Trail — Append-only event storage with SHA-256 hash chains per session.
- 💰 Cost Tracking — Track token usage and estimated costs per session, per agent, per model. Alert on cost spikes.
- 🚨 Alerting — Configurable rules for error rate, cost threshold, latency anomalies, and inactivity.
- ❤️🩹 Health Scores — 5-dimension health scoring with trend tracking.
- 💡 Cost Optimization — Complexity-aware model recommendation engine with projected savings.
- 📼 Session Replay — Step-through any past session with full context reconstruction.
- ⚖️ A/B Benchmarking — Statistical comparison of agent variants using Welch's t-test and chi-squared analysis.
- 🛡️ Guardrails — Automated safety rules with dry-run mode for safe testing.
- 🔌 Framework Plugins — LangChain, CrewAI, AutoGen, Semantic Kernel — auto-detection, fail-safe, non-blocking.
- 🔗 AgentKit Ecosystem — Integrations with AgentGate, FormBridge, Lore, and AgentEval.
- 🔒 Tenant Isolation — Multi-tenant support with per-tenant data scoping and API key binding.
- 🏠 Self-Hosted — SQLite by default, no external dependencies. MIT licensed.
📸 Dashboard
AgentLens ships with a real-time web dashboard for monitoring your agents.
📸 Dashboard Screenshots (click to expand)
Overview — At-a-Glance Metrics
The overview page shows live metrics — sessions, events, errors, and active agents — with a 24-hour event timeline chart, recent sessions with status badges, and a recent errors feed.
Sessions — Track Every Agent Run
Every agent session with sortable columns: agent name, status, start time, duration, event count, error count, and total cost.
Session Detail — Timeline & Hash Chain
Full event timeline with tamper-evident hash chain verification. Filter by event type, view cost breakdown.
Events Explorer — Search & Filter Everything
Searchable, filterable view of every event across all sessions.
🧠 LLM Analytics — Prompt & Cost Tracking
Total LLM calls, cost, latency, and token usage across all agents with model comparison.
🧠 Session Timeline — LLM Call Pairing
LLM calls in session timeline with model, tokens, cost, and latency.
💬 Prompt Detail — Chat Bubble Viewer
Full prompt and completion in a chat-bubble style viewer with metadata panel.
❤️🩹 Health Overview — Agent Reliability
5-dimension health score for every agent with trend tracking.
💡 Cost Optimization — Model Recommendations
Analyzes LLM call patterns and recommends cheaper model alternatives with confidence levels.
📼 Session Replay — Step-Through Debugger
Step through any past session event by event with full context reconstruction.
⚖️ Benchmarks — A/B Testing for Agents
Create and manage A/B experiments with statistical significance testing.
🛡️ Guardrails — Automated Safety Rules
Create and manage automated safety rules with trigger history and activity feed.
☁️ AgentLens Cloud
Don't want to self-host? AgentLens Cloud is a fully managed SaaS — same SDK, zero infrastructure:
- Same SDK, one parameter change — switch
url=tocloud=True - Managed Postgres — multi-tenant with row-level security
- Team features — organizations, RBAC, audit logs
- No server to run — dashboard at app.agentlens.ai
📖 Cloud Setup Guide · Migration Guide · Troubleshooting
📦 Packages
Python (PyPI)
TypeScript / Node.js (npm)
🔌 API Overview
⌨️ CLI
Both commands support --format json for machine-readable output. See agentlens health --help for all options.
🛠️ Development
Requirements: Node.js ≥ 20.0.0 · pnpm ≥ 10.0.0
🤝 Contributing
We welcome contributions! See CONTRIBUTING.md for setup instructions, coding standards, and the PR process.
🧰 AgentKit Ecosystem
📄 License
来源:README.md,提交 78fe5eb
工具
0版本历史
1- v0.13.7最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分