# Laminar — Open-Source Observability for AI Agents > Open-source observability for AI agents: self-host with Docker Compose, then use the SDK to trace runs, metrics, and outputs end-to-end. ## Install Save as a script file and run: ## Quick Use 1. Self-host locally: ```bash git clone https://github.com/lmnr-ai/lmnr cd lmnr docker compose up -d ``` 2. Install the Python SDK: ```bash pip install --upgrade 'lmnr[all]' ``` ## Intro Open-source observability for AI agents: self-host with Docker Compose, then use the SDK to trace runs, metrics, and outputs end-to-end. - **Best for:** agent teams who need repeatable tracing and debugging, not just ad-hoc logs, across prompts, tools, and multi-step runs - **Works with:** Docker Compose for self-hosting; SDK instrumentation in your agent app - **Setup time:** 30–60 minutes ## Practical Notes - Quant: define 3 core metrics per agent workflow (latency, tool-call count, success rate) and baseline them before you optimize prompts. - Quant: keep a replay set of 20 representative runs; compare traces after every change to detect regressions. --- ## Observability-first iteration If you can’t answer these questions with data, you’re guessing: - Which step dominates latency? - Which tool calls fail most often? - Which prompt change improved success rate vs just “felt better”? ## Minimal instrumentation strategy 1. Trace every run with a stable run id. 2. Attach tool-call spans with inputs/outputs (redact secrets). 3. Capture final outcomes (pass/fail + reason). ## Don’t drown in dashboards Start with one workflow and one team. Once the metrics are trusted, scale to more services. ### FAQ **Q: Do I need to self-host?** A: No. The repo documents self-hosting; teams can choose managed options or local-only usage. **Q: What should I instrument first?** A: One end-to-end workflow that currently fails or is slow—make it measurable. **Q: How do I compare prompt changes?** A: Use a fixed replay set and compare traces/metrics, not anecdotes. ## Source & Thanks > Source: https://github.com/lmnr-ai/lmnr > License: Apache-2.0 > GitHub stars: 2,875 · forks: 195 --- ## 快速使用 1. 本地自托管: ```bash git clone https://github.com/lmnr-ai/lmnr cd lmnr docker compose up -d ``` 2. 安装 Python SDK: ```bash pip install --upgrade 'lmnr[all]' ``` ## 简介 AI Agent 的开源可观测性平台:用 Docker Compose 自托管后,通过 SDK 采集 trace/指标/输出结果,支持端到端追踪、调试与对比评估,让 agent 的迭代从“感觉”变成可量化。 - **适合谁:** 希望把 agent 的追踪与调试做成可复用能力,而不只靠零散日志的团队 - **可搭配:** Docker Compose 自托管;在你的 agent 应用里接入 SDK - **准备时间:** 30–60 分钟 ## 实战建议 - 量化建议:为每条工作流定义 3 个核心指标(延迟、tool 调用次数、成功率),先基线再优化 prompt。 - 量化建议:固定 20 条可复现的回放样本;每次变更后对比 traces,及时发现回归。 ## 用可观测性驱动迭代 如果下面问题回答不出数据,你就在“凭感觉优化”: - 哪一步最耗时? - 哪个 tool 调用最容易失败? - 哪次 prompt 变更真的提升成功率? ## 最小接入策略 1. 每次 run 都用稳定的 run id 做追踪。 2. tool 调用做 span 记录输入/输出(注意脱敏)。 3. 记录最终结果(成功/失败 + 原因)。 ## 避免看板淹没 先从一个工作流 + 一个团队开始;指标可信后再扩到更多服务。 ### FAQ **必须自托管吗?** 答:不必须。仓库提供了自托管路径;团队也可以选择托管或仅本地使用。 **优先接入什么?** 答:先把一条当前最慢或最不稳定的工作流做成可量化的端到端追踪。 **如何对比 prompt 变更?** 答:用固定回放集对比 traces/指标,而不是靠主观感受。 ## 来源与感谢 > Source: https://github.com/lmnr-ai/lmnr > License: Apache-2.0 > GitHub stars: 2,875 · forks: 195 --- Source: https://tokrepo.com/en/workflows/laminar-open-source-observability-for-ai-agents Author: Script Depot