Library · published 2026-02-22 · added 2026-08-29 · github.com

AgentHER: Hindsight Experience Replay for LLM Agents

What it is

AgentHER is a Python library and CLI tool that converts failed LLM agent trajectories into high-quality training data by relabeling the original goal to match the actual outcome. It uses a four-stage pipeline involving failure detection, outcome extraction, prompt relabeling, and data augmentation to generate SFT, DPO, or ShareGPT formats.

The problem it solves

Failed agent trajectories are routinely discarded during training, wasting valuable data where the agent's actions were correct but the final result did not meet an arbitrary or overly specific goal constraint.

What you could use it for

llm-agentsreinforcement-learningdata-augmentationhindsight-experience-repsftdpo

Read the source ↗Back to the library →

Summary written by an AI model from the source; check the source before you rely on it.