Agent traces carry increasing analytical value in agentic systems and context engineering, yet most prior work treats conversation format as a trivial implementation detail. Modern agent conversations, however, contain deeply structured content, including nested tool calls and results, chain-of-thought reasoning blocks, sub-agent invocations, context-window compaction boundaries, and harness-injected system directives, whose complexity far exceeds that of simple user-assistant exchanges. Feeding such traces to a reflector or other analytical mechanism in plain text, JSON, YAML, or via grep can materially degrade analysis quality. This paper presents VCC (View-oriented Conversation Compiler), a compiler (lex, parse, IR, lower, emit) that transforms raw agent JSONL logs into a family of structured views: a full view (lossless transcript serving as the canonical line-number coordinate system), a user-interface (UI) view (reconstructing the interaction as the user actually perceived it), and an adaptive view (a structure-preserving projection governed by a relevance predicate). In a context-engineering experiment on AppWorld, replacing only the reflector's input format, from raw JSONL to VCC-compiled views, leads to higher pass rates across all three model configurations tested, while cutting reflector token consumption by half to two-thirds and producing more concise learned memory. These results suggest that message format functions as infrastructure for context engineering, not as an incidental implementation choice.
翻译:智能体追踪在智能体系统与上下文工程中具有日益重要的分析价值,然而大多数前期工作将对话格式视为无关紧要的实现细节。现代智能体对话包含深度结构化内容,包括嵌套的工具调用及结果、思维链推理模块、子智能体调用、上下文窗口压缩边界以及框架注入的系统指令,其复杂性远超简单的用户-助手交互。若以纯文本、JSON、YAML或grep方式将此类追踪数据输入反射器或其他分析机制,将实质性地降低分析质量。本文提出VCC(面向视图的对话编译器),该编译器(词法分析、语法分析、中间表示、降级处理、代码生成)将原始智能体JSONL日志转换为一系列结构化视图:全视图(无损转录,作为规范行号坐标系统)、用户界面视图(重构用户实际感知的交互过程)与自适应视图(由相关性谓词驱动的结构保持投影)。在AppWorld上下文工程实验中,仅将反射器的输入格式从原始JSONL替换为VCC编译视图,即可提升所有三种模型配置的通过率,同时将反射器令牌消耗减少至原量的二分之一至三分之一,并生成更简洁的学习记忆。这些结果表明,消息格式在上下文工程中具有基础设施性功能,而非可随意选择的实现方案。