Manuscript Offprint

arXiv:2610.13335

AgentTune: A Unified Training Lifecycle for Tool-Using LLM Agents

R E Zera Marveen Lyngkhoi, Abhivansh Gupta, Vidushee Vats, Ram Mohan Rao Kadiyala, Vinay Kumar Sankarapu, Pratinav Seth

AgentTune

A Unified Training Lifecycle for Tool-Using LLM Agents

R E Zera Marveen Lyngkhoi* Abhivansh Gupta* Vidushee Vats*

Ram Mohan Rao Kadiyala

Vinay Kumar Sankarapu Pratinav Seth

Lexsi Labs

Abstract

Tool-using agents increasingly require a common substrate for building, training, evaluating, distilling, and maintaining agentic systems, yet existing tooling typically addresses these stages in isolation. We present AgentTune, a source-available Python library that provides a unified framework for developing and optimizing tool-using agents. At its core, AgentTune introduces a two-tier EventLog representation that preserves agent trajectories while supporting consistent projections for training, evaluation, and auditing. Building on this substrate, the library provides a shared agent runtime, tool-calling reinforcement learning, agentic distillation, retrieval-augmented generation, decision workflows, evaluation utilities, and a designed path toward self-healing agents. These components are exposed through composable interfaces so that agent strategies, training methods, evaluation procedures, and recovery mechanisms can be combined without requiring separate representations or pipelines. We demonstrate the framework across agentic tasks including legal contract search and domain-specific applications, illustrating its use for trajectory-based optimization, tool-use evaluation, and cross-task agent development. AgentTune is released as an open-source library at https://github.com/Lexsi-Labs/AgentTune.

Keywords: Agentic LLMs, Reinforcement Learning, Tool Use, Knowledge Distillation, Retrieval-Augmented Generation, Self-Healing Systems, Source-Available Libraries

Lexsi.ai

1 Introduction

An LLM agent repeatedly reasons, calls a tool, reads the environment response, and decides whether to continue. Execution frameworks make that loop straightforward, but a useful agent system must also preserve the decisions and tool interactions needed for evaluation, training, compression, and recovery. Existing tools specialize in individual stages: TRL [1], verl [2] and OpenRLHF [3] train policies, LangGraph [4] orchestrates stateful agent loops, the lm-eval harness [5] standardizes static evaluation, and a separate literature covers distillation [6, 7]. The fragmentation is at their interfaces: an RL rollout, a decision-workflow state, and an evaluation trace use different representations, so scoring, loss masking, failure detection, and audit logic are repeatedly reconstructed.

We distinguish AgentTune from AgentTuning [8]: AgentTuning is a method and dataset for fine-tuning LLMs on agent interaction trajectories, whereas AgentTune is a software library for collecting, representing, training, evaluating, distilling, and recovering tool-using agents. The common trajectory substrate is therefore complementary rather than a claim of methodological equivalence.

∗^{*}These authors contributed equally.

AgentTune is organized around one interface between these stages: the two-tier EventLog. Agent trajectories from the runtime, RL rollouts, DECIDE workflows, and evaluation traces project into the schema; the same record projects out to SFT rows, evaluator inputs, and audit records. The library is designed to support the agent development lifecycle from build and collection through evaluation, training, distillation, and recovery, but the paper evaluates these capabilities separately rather than claiming a single experiment demonstrates the entire lifecycle. The legal case study provides the strongest task-level evidence: a search agent is trained on synthesized questions and then evaluated on three unseen corpora (§5.1).

Contributions. This paper makes four contributions:

• A unified trajectory contract. The two-tier EventLog represents agent interactions once and provides projections for training, evaluation, and audit, including segment-aware completion-only loss masking (§3.3).

• A shared agent-training stack. The agentic spine and TRL-backed RL core provide a common runtime and training interface for tool-using agents across GRPO, PPO, DPO, RLOO, and BCO, with agentic distillation and retrieval training using the same trajectory substrate (§3.4, §3.5).

• Decision workflows and recovery. DECIDE provides YAML-defined workflows and audit trails, while the architecture supports converting detected failures into corrective training data and gated retraining/deployment (§3.8, §3.9).

• Empirical evidence across representative paths. GPU-verified smoke tests establish that the principal training paths execute end to end, while the legal contract-search study provides the strongest task-level result: GRPO improves held-out CUAD exact match from 60.0% to 69.0% and reduces searches per question from 3.00 to 2.90 (§4, §5.1).

References (65)