智能体执行追踪_agent-tracing
以下为本文档的中文说明agent-tracing智能体追踪是LobeHub开发的一款零配置本地开发工具用于记录和检查AI智能体的执行快照。它通过CLI命令行界面提供对智能体每一步执行的细粒度洞察。在开发模式下AgentRuntimeService.executeStep()方法会自动将每一步执行记录为部分快照partial snapshots存储在.agent-tracing目录中当操作完成时这些部分快照会被合并为一个完整的ExecutionSnapshot JSON文件。该技能的数据流设计精巧执行步骤循环构建StepPresentationData写入部分快照到磁盘完成时最终化为时间戳加追踪ID命名的JSON文件。它会同时捕获上下文引擎数据包括agentDocuments、systemRole等重型负载这些数据通过旁路通道传递不进入Redis状态管道从而避免性能瓶颈。CLI提供了丰富的查看命令inspect查看追踪概览list列出所有快照并支持按步骤查看消息(-m)、工具调用(-t)、原始事件(-e)、运行时上下文(-c)等。开发者还可以使用–payload(-p)查看上下文引擎输入概览使用–memory(-M)查看注入的用户记忆。该技能特别适合调试复杂的多步骤AI智能体系统帮助开发者理解LLM的输入输出、工具调用流程和上下文引擎的工作方式。它提供了从原始数据到格式化输出的完整调试链路是智能体应用开发中不可或缺的诊断工具。Agent Tracing CLI Guidelobechat/agent-tracingis a zero-config local dev tool that records agent execution snapshots to disk and provides a CLI to inspect them.How It WorksInNODE_ENVdevelopment,AgentRuntimeService.executeStep()automatically records each step to.agent-tracing/as partial snapshots. When the operation completes, the partial is finalized into a completeExecutionSnapshotJSON file.Data flow: executeStep loop - buildStepPresentationData- write partial snapshot to disk - on completion, finalize to.agent-tracing/{timestamp}_{traceId}.jsonContext engine capture: InRuntimeExecutors.ts, thecall_llmexecutor callsctx.tracingContextEngine(input, output)afterserverMessagesEngine()processes messages.AgentRuntimeService.executeStepbuffers the call per step and forwards it toOperationTraceRecorder.appendStepas the typedcontextEnginefield. CE flows through this side channel rather than theeventsarray so its heavy payload (agentDocuments, systemRole, …) never enters the Redis state pipeline (LOBE-9110).Package Locationpackages/agent-tracing/ src/ types.ts # ExecutionSnapshot, StepSnapshot, SnapshotSummary store/ types.ts # ISnapshotStore interface file-store.ts # FileSnapshotStore (.agent-tracing/*.json) recorder/ index.ts # appendStepToPartial(), finalizeSnapshot() viewer/ index.ts # Terminal rendering: renderSnapshot, renderStepDetail, renderMessageDetail, renderSummaryTable, renderPayload, renderPayloadTools, renderMemory cli/ index.ts # CLI entry point (#!/usr/bin/env bun) inspect.ts # Inspect command (default) partial.ts # Partial snapshot commands (list, inspect, clean) index.ts # Barrel exportsData StorageCompleted snapshots:.agent-tracing/{ISO-timestamp}_{traceId-short}.jsonLatest symlink:.agent-tracing/latest.jsonIn-progress partials:.agent-tracing/_partial/{operationId}.jsonFileSnapshotStoreresolves fromprocess.cwd()—run CLI from the repo rootCLI CommandsAll commands run from therepo root:# View latest trace (tree overview, inspect is the default command)agent-tracing agent-tracing inspect agent-tracing inspecttraceIdagent-tracing inspect latest# List recent snapshotsagent-tracing list agent-tracing list-l20# Inspect specific step (-s is short for --step)agent-tracing inspecttraceId-s0# View messages (-m is short for --messages)agent-tracing inspecttraceId-s0-m# View full content of a specific message (by index shown in -m output)agent-tracing inspecttraceId-s0--msg2agent-tracing inspecttraceId-s0--msg-input1# View tool call/result details (-t is short for --tools)agent-tracing inspecttraceId-s1-t# View raw events (-e is short for --events)agent-tracing inspecttraceId-s0-e# View runtime context (-c is short for --context)agent-tracing inspecttraceId-s0-c# View context engine input overview (-p is short for --payload)agent-tracing inspecttraceId-pagent-tracing inspecttraceId-s0-p# View available tools in payload (-T is short for --payload-tools)agent-tracing inspecttraceId-Tagent-tracing inspecttraceId-s0-T# View user memory (-M is short for --memory)agent-tracing inspecttraceId-Magent-tracing inspecttraceId-s0-M# Raw JSON output (-j is short for --json)agent-tracing inspecttraceId-jagent-tracing inspecttraceId-s0-j# List in-progress partial snapshotsagent-tracing partial list# Inspect a partial (use inspect directly — all flags work with partial IDs)agent-tracing inspectpartialOperationIdagent-tracing inspectpartialOperationId-Tagent-tracing inspectpartialOperationId-p# Clean up stale partial snapshotsagent-tracing partial cleanInspect Flag Reference| Flag | Short | Description| Default Step || ----------------- | ----- | ------------------------------------------------------------------------------------------------- | ------------ ||--step n|-s| Target a specific step | — ||--messages|-m| Messages context (CE input → params → LLM payload) | — ||--tools|-t| Tool calls results (what agent invoked) | — ||--events|-e| Raw events (llm_start, llm_result, etc.) | — ||--context|-c| Runtime context payload (raw) | — ||--system-role|-r| Full system role content | 0 ||--env| | Environment context | 0 ||--payload|-p| Context engine input overview (model, knowledge, tools summary, memory summary, platform context) | 0 ||--payload-tools|-T| Available tools detail (plugin manifests LLM function definitions) | 0 ||--memory|-M| Full user memory (persona, identity, contexts, preferences, experiences) | 0 ||--diff n|-d| Diff against step N (use with-ror--env) | — ||--msg n| | Full content of message N from Final LLM Payload | — ||--msg-input n| | Full content of message N from Context Engine Input | — ||--json|-j| Output as JSON (combinable with any flag above) | — |Flags marked “Default Step: 0” auto-select step 0 if--stepis not provided. All flags supportlatestor omitted traceId.Typical Debug Workflow# 1. Trigger an agent operation in the dev UI# 2. See the overviewagent-tracing inspect# 3. List all traces, get traceIdagent-tracing list# 4. Quick overview of what was fed into context engineagent-tracing inspect-p# 5. Inspect a specific steps messages to see what was sent to the LLMagent-tracing inspect TRACE_ID-s0-m# 6. Drill into a truncated message for full contentagent-tracing inspect TRACE_ID-s0--msg2# 7. Check available tools vs actual tool callsagent-tracing inspect-T# available toolsagent-tracing inspect-s1-t# actual tool calls results# 8. Inspect user memory injected into the conversationagent-tracing inspect-M# 9. Diff system role between steps (multi-step agents)agent-tracing inspect TRACE_ID-r-d2Key TypesinterfaceExecutionSnapshot{traceId:string;operationId:string;model?:string;provider?:string;startedAt:number;completedAt?:number;completionReason?:|done|error|interrupted|max_steps|cost_limit|waiting_for_human;totalSteps:number;totalTokens:number;totalCost:number;error?:{type:string;message:string};steps:StepSnapshot[];}interfaceStepSnapshot{stepIndex:number;stepType:call_llm|call_tool;executionTimeMs:number;content?:string;// LLM outputreasoning?:string;// Reasoning/thinkinginputTokens?:number;outputTokens?:number;toolsCalling?:Array{apiName:string;identifier:string;arguments?:string};toolsResult?:Array{apiName:string;identifier:string;isSuccess?:boolean;output?:string;};messages?:any[];// DB messagesbefore step context?:{phase:string;payload?:unknown;stepContext?:unknown};events?:Array{type:string;[key:string]:unknown};contextEngine?:{input?:unknown;// contextEngineInput minus messages toolsConfig (reconstructible from baseline)output?:unknown;// processed messages array (final LLM payload)};}–messages Output StructureWhen using--messages, the output shows three sections (if context engine data is available):Context Engine Input— DB messages passed to the engine, with[0],[1], … indices. Use--msg-input Nto view full content.Context Engine Params— systemRole, model, provider, knowledge, tools, userMemory, etc.Final LLM Payload— Processed messages after context engine (system date injection, user memory, history truncation, etc.), with[0],[1], … indices. Use--msg Nto view full content.Integration PointsRecording:apps/server/src/services/agentRuntime/AgentRuntimeService.ts— in theexecuteStep()method, after buildingstepPresentationData, writes partial snapshot in dev modeContext engine capture:apps/server/src/modules/AgentRuntime/RuntimeExecutors.ts— incall_llmexecutor, afterserverMessagesEngine()returns, callsctx.tracingContextEngine(input, output).AgentRuntimeService.executeStepbuffers it per step and passes it totraceRecorder.appendStepas the typedcontextEnginefield (kept off theeventsarray to stay out of Redis state).Store:FileSnapshotStorereads/writes to.agent-tracing/relative toprocess.cwd()3d:[“,,,L40”,null,{“content”:“$41”,“frontMatter”:{“name”:“agent-tracing”,“description”:“Agent tracing CLI for execution snapshots. Use for agent-tracing, traces, snapshots, LLM call inspection, context engine data, agent step analysis, or execution debugging.”,“user-invocable”:false}}]3e:[“KaTeX parse error: Expected }, got EOF at end of input: …,children:[[”,“div”,null,{“className”:“flex items-center justify-between border-b border-border bg-muted/30 px-4 py-2.5”,“children”:[[“KaTeX parse error: Expected }, got EOF at end of input: …,children:[”,“span”,null,{“className”:“truncate text-xs font-medium text-muted-foreground”,“children”:“同仓库更多 Skills”}]}],[“KaTeX parse error: Expected EOF, got } at position 88: …ldren:同仓库}]]}̲],[”,“div”,null,{“className”:“p-4 sm:p-5”,“children”:[[“,h2,null,id:related−skills−heading,className:text−2xlfont−semiboldtracking−normaltext−foreground,children:同仓库更多Skills],[,h2,null,{id:related-skills-heading,className:text-2xl font-semibold tracking-normal text-foreground,children:同仓库更多 Skills}],[,h2,null,id:related−skills−heading,className:text−2xlfont−semiboldtracking−normaltext−foreground,children:同仓库更多Skills],[”,“div”,null,{“className”:“mt-4 grid gap-3 sm:grid-cols-2”,“children”:[“L42,L42,L42,L43”,“L44,L44,L44,L45”,“L46,L46,L46,L47”]}]]}]]}]48:I[206516,[“/_next/static/chunks/051aanbhrv4br.js”,“/_next/static/chunks/0mizr60h7ayzt.js”,“/_next/static/chunks/0v9lm1dmbdoo-.js”,“/_next/static/chunks/0rxr1j1j3j-.r.js”,“/_next/static/chunks/02ftybezfvqjd.js”,“/_next/static/chunks/0.v9ksvnnj8ia.js”,“/_next/static/chunks/0bn6id96nx3k.js,“/_next/static/chunks/13ybnhn37c.tc.js”,“/_next/static/chunks/0_fnrdtruz8uf.js”,“/_next/static/chunks/0r6l15utt1mwb.js”,“/_next/static/chunks/0dm9a5into854.js”,/_next/static/chunks/07k6hqoibtcn.js”,“/next/static/chunks/0b4cao.4y…j.js”,“/_next/static/chunks/02i-n28z7kjd0.js”],“default”]

相关新闻

手机状态栏图标隐藏的耗电与安全隐患解析

手机状态栏图标隐藏的耗电与安全隐患解析

1. 手机顶部图标隐藏的安全隐患 那天在地铁上,我无意间瞥见邻座小伙的手机顶部状态栏,密密麻麻排着七八个图标。出于职业习惯,我忍不住多看了两眼——好家伙,里面至少有三个图标代表着后台正在运行的高耗电应用。这让我想起自己刚…

2026/7/21 9:13:19阅读更多 →
RNAi技术在MASH治疗中的突破与应用

RNAi技术在MASH治疗中的突破与应用

1. 项目概述:MASH赛道与瑞博生物的领先布局 在生物医药领域,代谢功能障碍相关脂肪性肝炎(MASH)已成为全球制药巨头竞相争夺的黄金赛道。作为一家专注于RNA疗法研发的创新型企业,瑞博生物(股票代码&#xff…

2026/7/21 9:13:19阅读更多 →
5分钟掌握GIMP Resynthesizer:智能图像修复与纹理合成全攻略

5分钟掌握GIMP Resynthesizer:智能图像修复与纹理合成全攻略

5分钟掌握GIMP Resynthesizer:智能图像修复与纹理合成全攻略 【免费下载链接】resynthesizer Suite of gimp plugins for texture synthesis 项目地址: https://gitcode.com/gh_mirrors/re/resynthesizer 还在为照片中的瑕疵烦恼吗?还在为找不到合…

2026/7/21 9:13:19阅读更多 →
AI搜索工具横向对比:为什么开源模型(如Llama-3-70B+Qwen2-RAG)在私有化部署中综合得分反超闭源SaaS?

AI搜索工具横向对比:为什么开源模型(如Llama-3-70B+Qwen2-RAG)在私有化部署中综合得分反超闭源SaaS?

更多请点击: https://codechina.net 第一章:AI搜索工具横向对比:为什么开源模型(如Llama-3-70BQwen2-RAG)在私有化部署中综合得分反超闭源SaaS? 在企业级知识检索场景中,私有化AI搜索系统正经历…

2026/7/21 17:38:17阅读更多 →
从0到1搭建AI自媒体工作室:含部署教程、避坑指南、ROI测算表(附真实收益数据)

从0到1搭建AI自媒体工作室:含部署教程、避坑指南、ROI测算表(附真实收益数据)

更多请点击: https://intelliparadigm.com 第一章:AI自媒体工作室的底层逻辑与价值定位 AI自媒体工作室并非传统内容团队的简单技术升级,而是以数据驱动、模型协同与人机共生为内核的新生产力组织形态。其底层逻辑根植于三个不可分割的支柱&…

2026/7/21 17:38:17阅读更多 →
揭秘Beyond All Reason:开源RTS游戏的复兴与战略革新

揭秘Beyond All Reason:开源RTS游戏的复兴与战略革新

揭秘Beyond All Reason:开源RTS游戏的复兴与战略革新 【免费下载链接】Beyond-All-Reason Main game repository for Beyond All Reason. 项目地址: https://gitcode.com/gh_mirrors/be/Beyond-All-Reason 在实时战略游戏的黄金时代渐行渐远之际,…

2026/7/21 17:38:17阅读更多 →
【多模态能力黄金三角评估法】:视觉理解力×语言生成力×跨模态推理力三维打分模型(附开源评估工具包v1.2及12个行业测试集)

【多模态能力黄金三角评估法】:视觉理解力×语言生成力×跨模态推理力三维打分模型(附开源评估工具包v1.2及12个行业测试集)

更多请点击: https://intelliparadigm.com 第一章:【多模态能力黄金三角评估法】:视觉理解力语言生成力跨模态推理力三维打分模型(附开源评估工具包v1.2及12个行业测试集) 多模态大模型的评估长期受限于单维指标主导、…

2026/7/21 17:38:17阅读更多 →
微信小助手主题设计终极指南:4大皮肤模式与专业配色技巧

微信小助手主题设计终极指南:4大皮肤模式与专业配色技巧

微信小助手主题设计终极指南:4大皮肤模式与专业配色技巧 WeChatExtension-ForMac是一款专为Mac用户打造的微信功能拓展插件,它不仅能增强微信的功能,还提供了丰富的主题定制选项,让你的微信界面焕然一新。本文将为你详细介绍如何…

2026/7/21 17:38:17阅读更多 →
本地化语音转录解决方案:Vibe技术架构与部署实践指南

本地化语音转录解决方案:Vibe技术架构与部署实践指南

本地化语音转录解决方案:Vibe技术架构与部署实践指南 【免费下载链接】vibe Transcribe on your own! 项目地址: https://gitcode.com/GitHub_Trending/vib/vibe 在当今数字化工作环境中,语音内容的高效处理已成为技术团队和内容创作者面临的重要…

2026/7/21 17:36:17阅读更多 →
Go语言静态资源打包方案对比与实践指南

Go语言静态资源打包方案对比与实践指南

1. 项目背景与核心需求在Go语言开发中,我们经常需要处理静态资源文件的打包问题。无论是Web应用的模板文件、前端资源,还是配置文件、证书等,都需要随程序一起分发。传统做法是将这些文件与编译后的二进制文件放在同一目录下,但这…

2026/7/21 0:51:49阅读更多 →
Go语言实现高性能LDAP认证服务的架构与实践

Go语言实现高性能LDAP认证服务的架构与实践

1. 项目背景与核心价值LDAP(轻量级目录访问协议)作为企业级身份认证的黄金标准,已经服务了超过80%的财富500强公司。我在金融科技领域实施统一认证体系时,发现传统Java方案存在启动慢、内存占用高等痛点。而Go语言凭借其协程并发模…

2026/7/21 0:51:49阅读更多 →
【AI面试官实战指南】:用ChatGPT模拟10类高频技术岗面试,3天提升应答精准度92%

【AI面试官实战指南】:用ChatGPT模拟10类高频技术岗面试,3天提升应答精准度92%

更多请点击: https://intelliparadigm.com 第一章:AI面试官实战指南的核心价值与适用场景 AI面试官并非替代人类HR的“黑箱工具”,而是以可解释、可审计、可迭代的方式,赋能招聘全链路的关键基础设施。其核心价值在于将主观经验沉…

2026/7/21 0:51:49阅读更多 →
Windows+macOS 通用 OpenClaw 部署流程,内置依赖一键启动智能桌面助手

Windows+macOS 通用 OpenClaw 部署流程,内置依赖一键启动智能桌面助手

📌教程适配:OpenClaw v2.7.9 | 兼容 Windows10/11、macOS 双系统 📖前言 当下各类本地 AI 工具层出不穷,多数产品仅能完成文字问答交互,很难直接操控电脑执行实际操作。OpenClaw,业内常称小龙虾 AI&#…

2026/7/21 0:01:46阅读更多 →
Codex 接入后 Bug 反增?复盘从个人演示到团队协作的“流程陷阱”

Codex 接入后 Bug 反增?复盘从个人演示到团队协作的“流程陷阱”

聊《一次Codex项目复盘,问题最后出在流程而不是模型》之前,先说一句实在的:别急着背概念,先看它在真实项目里到底解决什么问题。摘要先把这篇文章的目标说清楚:看完之后,你应该能判断这件事值不值得做&…

2026/7/21 0:01:46阅读更多 →
手把手搓一个五子棋游戏,零代码也能当“游戏开发者”

手把手搓一个五子棋游戏,零代码也能当“游戏开发者”

大家好,还是我。前几期带大家做了心情日记本和可视化大屏,后台有朋友留言:“能不能教点好玩的?我想做游戏,但一行代码都不会。”行,这期就安排。今天的目标:从零做一个五子棋游戏。 带AI对战、三…

2026/7/21 0:03:46阅读更多 →
YOLOv8推理性能优化:从1.2FPS到35FPS的全链路加速实践

YOLOv8推理性能优化:从1.2FPS到35FPS的全链路加速实践

如果你在部署 YOLOv8 时,发现推理速度只有可怜的 1-2 FPS,而别人的演示视频却能跑到 30 FPS 以上,那么问题很可能不在模型本身,而在于你的整个处理链路。很多开发者拿到一个训练好的 YOLOv8 模型后,会直接使用官方示例…

2026/7/20 22:51:39阅读更多 →
Coze与Dify对比指南:低代码AI应用开发从入门到实战

Coze与Dify对比指南:低代码AI应用开发从入门到实战

1. 从零到一:为什么你需要了解 Coze 和 Dify?如果你对 AI 应用开发感兴趣,但一看到“大模型”、“智能体”、“工作流”这些词就头疼,觉得门槛太高,那这篇文章就是为你准备的。很多开发者,包括我自己&#…

2026/7/20 18:51:18阅读更多 →
AI生图工具怎么选?2026年6月版实测对比

AI生图工具怎么选?2026年6月版实测对比

做自媒体的朋友应该都有体会:配图一直是个让人头疼的问题。2026年,AI生图工具已经非常成熟了,但工具太多反而不知道怎么选。以下是截至2026年6月我对主流AI生图工具的实测对比。Midjourney V8.1:速度之王2026年6月11日&#xff0c…

2026/7/20 18:51:18阅读更多 →