█

AI/TLDR

Buy me a coffee
Buy me a coffee

Agent Apprenticeship

Run your agent in mentor-judged loops and keep what it learned as reusable experience

Coding-Agent Harnesses & RuntimesOpen source
Latest
v0.3.0
Updated
19 Oct 2026
Language
Python
License
MIT
$npx agent-apprenticeship init

What's new

v0.3.019 Oct 2026

Version 0.3.0 added trace interchange in the Harbor ATIF v1.8 format; it was published to npm on 25 October 2026.

IN SHORT

What is Agent Apprenticeship?

Agent Apprenticeship is an MIT-licensed command-line tool that wraps an AI agent you already have installed and runs it on a task in repeated loops. The agent doing the work is the "Apprentice Agent": Codex, Cursor, Claude Code, OpenClaw, OpenCode, Hermes Agent, or any other CLI you describe with a command template. It sits in the Coding-Agent Harnesses & Runtimes category of the AI Coding tools and is open-source, written in Python and licensed MIT.

Updated Markdown version ↗

Overview

Agent Apprenticeship is an MIT-licensed command-line tool that wraps an AI agent you already have installed and runs it on a task in repeated loops. The agent doing the work is the "Apprentice Agent": Codex, Cursor, Claude Code, OpenClaw, OpenCode, Hermes Agent, or any other CLI you describe with a command template. Each iteration is evaluated by a "Mentor", either a model you configure with your own OpenAI, Anthropic, Gemini or OpenRouter key, or a human expert, and the loop runs until the work passes or the maximum loop depth is reached.

Diagram: a human in the loop works with an apprentice agent, a task loop is judged by mentor evaluation, and a work experience compiler passes the result to future agents, with a run, evaluate, improve arrow back
The loop: the apprentice agent works, a mentor evaluates, and the compiled experience feeds future runs.Agent Apprenticeship README ↗

What sets it apart from other harnesses is what happens after a run. Agent Apprenticeship writes a local run folder and an "Experience Compilation": the task, the execution traces, the mentor's evaluations and lessons drawn from them. You can inspect and validate that bundle, export it in full, and install it as "Runtime Training" so the next run of your agent starts from the lessons of the previous ones. Version 0.3.0 (October 2026) added trace interchange in the Harbor ATIF v1.8 format.

Runs can stay private or feed a shared pool. In Public Ecosystem mode completed experience is contributed back, and `apprentice ecosystem search` and `pull` fetch experience others published; Private Internal Only mode keeps everything on your machine. The project also publishes a seed dataset on Hugging Face (Apache-2.0) with 505 experience compilations plus traces, reward, verifier and preference rows derived from them. The CLI is written in Python (3.11+) and distributed through npm, which needs Node.js 18+.

What it does

  • Wraps existing agent CLIs (Codex, Cursor, Claude Code, OpenClaw, OpenCode, Hermes Agent) and auto-detects which are installed, plus a custom command template for anything else
  • Mentor evaluation by a model on your own OpenAI, Anthropic, Gemini or OpenRouter key, or by a human, in Autonomous, Expert-Led or Organization Custom modes
  • Configurable loop depth (`AA_MAX_ITERATIONS` or `apprentice settings`) and live progress with `apprentice watch <run_id>`
  • Experience Compilations: per-run bundles of traces, evaluations and lessons that can be inspected, checked, exported and installed as Runtime Training for later runs
  • Optional public ecosystem to search, inspect and pull experience other users contributed, or a private internal-only mode
  • Trace interchange in the Harbor ATIF v1.8 format and an open Apache-2.0 seed dataset on Hugging Face

Getting started

From the README. You need at least one supported agent CLI installed and an API key for the mentor model; the npm package requires Node.js 18+ and runs on Python 3.11+.

Initialise

Runs the setup wizard; add `--defaults` to accept the default answers. To install globally instead, run `npm install -g agent-apprenticeship` and then `apprentice init`.

bashbash
npx agent-apprenticeship init

Add a mentor model key

Keys live in `~/.agent-apprenticeship/.env.local` (shell environment variables also work). Fill in the providers you use.

bashbash
OPENAI_API_KEY=""
ANTHROPIC_API_KEY=""
GEMINI_API_KEY=""
OPENROUTER_API_KEY=""

Pick the agent, model and mode, then check the setup

bashbash
apprentice configure
apprentice configure model
apprentice doctor

Run a task and watch it

When the run completes, the CLI prints the local run folder and the Experience Compilation path.

bashbash
apprentice run "Create a short market map for AI procurement tools."
apprentice watch <run_id>

Inspect the experience and reuse it

Check the compiled bundle, then install it as Runtime Training so later runs build on it.

bashbash
apprentice ecosystem inspect <experience_compilation_path>
apprentice bundle check <experience_compilation_path>
apprentice learn install <experience_compilation_path>

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Put a second, independent judge (a mentor model or a domain expert) over an agent's work instead of trusting its own "done"
  • Make an agent improve across runs by installing the lessons of earlier runs as Runtime Training
  • Collect structured execution traces, evaluations and lessons from real tasks as training or evaluation data
  • Share or pull agent work experience through a public pool, or keep it strictly internal

How Agent Apprenticeship compares

Agent Apprenticeship alongside other open-source coding-agent harnesses & runtimes tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
CC Switch★ 158kA cross-platform desktop app that manages provider configuration for eight coding-agent CLIs from one place, with a local failover proxy, MCP and skill management, and spend tracking.
Oh My OpenAgent★ 71.2kOpinionated agent bundle for OpenCode and Codex CLI that ships preconfigured sub-agents, lifecycle hooks and built-in MCP servers behind a single ultrawork command.
herdr★ 53.7kA single-binary terminal multiplexer built for coding agents: persistent sessions across local and SSH machines, per-pane working/blocked/idle status, and a socket API agents drive themselves.
oh-my-claudecode★ 41.1kA plugin and CLI that adds multi-agent orchestration to Claude Code: staged autopilot workflows, parallel tmux workers, and advisors that route a second opinion to Codex, Gemini, Grok or Cursor.
DSH Go★ 35.2kA native Android client for DeepSeek Harness that runs the agent on the phone in a built-in Linux environment or drives DSH on your computer or server over SSH, with plugins and phone control.
AionUi★ 34.6kAn open-source desktop workspace that pairs a built-in agent engine with dozens of external CLI agents, adding scheduled runs, MCP tools and remote access from a WebUI or chat apps.
cc-connect★ 16.5kA Go daemon that bridges local coding agents — Claude Code, Codex, Cursor Agent, Gemini CLI, OpenCode, Kimi CLI and more — to Feishu, DingTalk, Slack, Telegram, Discord, LINE and WeCom, so you drive them from chat.
Agent Apprenticeship★ 1.6kRun your agent in mentor-judged loops and keep what it learned as reusable experience