| name | agent-long-context-benchmark |
| title | AgentLongBench: A Controllable Long Benchmark For Long-Contexts Agents via Environment Rollouts |
| version | 0.0.2 |
| engine | skillxiv-v0.0.2-claude-opus-4.6 |
| license | MIT |
| url | https://arxiv.org/abs/2601.20730 |
| keywords | ["agent-benchmark","long-context","evaluation-framework","environment-simulation","task-generation"] |
| description | Build controllable benchmarks for evaluating long-context agents using environment rollouts. Generate diverse multi-step agent tasks that require maintaining context across extended interaction sequences, enabling evaluation of agent reasoning quality in scenarios with long history requirements. |
Problem
Existing agent benchmarks typically use short, isolated tasks that don't reflect real-world requirements where agents must maintain context and reason over long interaction histories. Long-context agents need benchmarks that can systematically vary task complexity, history length, and environmental conditions to properly evaluate their capabilities.
Solution
Create AgentLongBench: a controllable benchmark framework that generates synthetic long-context agent tasks through environment rollouts. This approach allows you to:
- Control Task Complexity: Vary the number of steps, branching decisions, and tool interactions
- Simulate Extended Histories: Generate long chains of observations and actions that agents must reason over
- Test Context Window Usage: Evaluate how agents handle increasing history lengths
- Generate Diverse Scenarios: Create varied environmental states and task requirements programmatically
When to Use
- Evaluating long-context language models on agent tasks
- Testing agent memory and reasoning capabilities with extended histories
- Benchmarking context window limitations and efficiency
- Developing agents for complex multi-step workflows (code generation, research, planning)
- Analyzing how agent performance degrades with longer interaction histories
When NOT to Use
- Short, single-turn interaction tasks (standard benchmarks suffice)
- Real-world task evaluation (use human-curated benchmarks)
- Tasks requiring specialized domain knowledge (this is synthetic evaluation)
Implementation
Step 1: Define the Environment Simulator
Create a controllable environment that generates long-context agent interactions.
class LongContextEnvironment:
"""Simulation environment for generating long interaction sequences"""
def __init__(self, complexity_level=1, max_steps=50):
self.complexity = complexity_level
self.max_steps = max_steps
self.state = self.initialize_state()
.step_count =
.history = []
():
{
: .generate_goal(.complexity),
: .generate_objects(.complexity),
: .available_actions(),
:
}
():
.step_count +=
is_valid = .validate_action(agent_action)
is_valid:
observation = .get_observation()
observation, -, , {: }
result = .apply_action(agent_action)
observation = .get_observation()
.history.append({
: .step_count,
: agent_action,
: result,
: .state.copy()
})
progress_delta = .get_progress() - .state[]
reward = progress_delta *
.state[] += progress_delta
done = (.step_count >= .max_steps) .goal_reached()
observation, reward, done, {: (.history)}
():
{
: .step_count,
: .state[],
: .get_visible_objects(),
: .history[-:],
: .state[],
: .state[]
}