CoolFace
Apppublic

albert-einstein-09/codedark

sourceHugging Facemitupdated 8mo agoView on Hugging Face
3likes
App README

CodeDark: Data Analytics Environment for RL Agents

OpenEnv-compatible multi-turn environment for training AI agents on real business analytics tasks.

Overview

CodeDark is the first data analytics environment in the OpenEnv ecosystem. It challenges AI agents to analyze CSV datasets using Python/Pandas, testing their ability to be data scientists rather than just code executors.

Key Features

  • Real Business Tasks: Bank marketing and road safety datasets with genuine analytical questions
  • Multi-Turn Interaction: Agents explore data, save notes, ask clarifications, and submit answers
  • Shaped Rewards: 80% correctness + 10% efficiency + 10% token cost
  • Pre-Benchmarked: 25 curated L5-L6 difficulty tasks validated on 11+ models

Quick Start

Connect to the Environment

python
from openenv import EnvClient

# Connect to this Space
env = EnvClient.from_hub("openenv/codedark")

# Reset for a new task
obs = env.reset()
print(f"Task: {obs['question']}")

# Execute Python code
obs = env.step({"tool": "run_python", "args": "<code>result = df.shape</code>"})
print(f"Result: {obs['stdout']}")

# Submit answer
obs = env.step({"tool": "submit_answer", "args": "<answer>42.5</answer>"})
print(f"Reward: {obs['reward']}")

Available Tools

ToolDescription
run_pythonExecute Python/pandas code. Store result in result variable.
read_notesRead saved notes from previous turns.
save_noteSave observations for later recall.
clarifyAsk clarifying questions (max 2 per episode).
submit_answerSubmit final answer. Ends episode.

Datasets

Bank Marketing (750K rows)

  • Target: Term deposit subscription prediction
  • Features: age, job, marital, education, balance, housing, loan, contact, day, month, duration, campaign

Road Safety (500K rows)

  • Target: Accident risk assessment
  • Features: roadtype, numlanes, curvature, speedlimit, lighting, weather, timeof_day

Task Difficulty

LevelComplexityExample
L4Quartile/binned"Subscription rate in Q1 balance?"
L5Multi-condition"Rate for month='may' AND job='management'?"
L6Nested extrema"In lowest subscription month, avg day?"

Reward Structure

ComponentWeightDescription
Correctness80%Binary correct/incorrect with numeric tolerance
Efficiency10%Fewer turns = better score
Token Cost10%Lower token usage = better score

API Endpoints

EndpointMethodDescription
/healthGETHealth check
/resetPOSTReset for new episode
/stepPOSTExecute action
/stateGETCurrent state
/metadataGETEnvironment metadata
/schemaGETType schemas

Benchmark Results

Pre-benchmarked on 11+ models with 1,844 completions:

ModelAccuracyAvg Turns
Claude Opus 4.577.3%4.2
Qwen3 Max46.7%5.1
Mistral Large45.3%5.8
Llama 4 Maverick38.7%6.2

Links

License

MIT License

Author

Vijay Athithya