Greyhaven's autocontext Lets AI Agents Teach Themselves Across 1,000-Star Open-Source Loop
A new open-source harness turns plain-language goals into iterative agent runs that leave behind playbooks, datasets, and distilled local models.
PRO- Autocontext is an open-source harness where agents iterate against real evaluation and inherit prior lessons via playbooks on disk.
- Five cooperating roles (competitor, analyst, coach, architect, curator) drive each run; the curator gates persistent knowledge.
- Ships in Python (
autocontexton PyPI) and TypeScript (autoctxon npm), Apache 2.0 licensed. - Supports Anthropic, OpenAI, Gemini, Mistral, Groq, OpenRouter, Azure, MLX, CUDA, plus Pi local runtime with no API keys.
- Exposes an MCP server so Claude Code, Cursor, or Pi can invoke solve, judge, improve, and export tools.
- Captures production traces via
instrument_clientand distills them into local models with MLX or TRL/GRPO.
A new open-source project called autocontext aims for something more ambitious than a prompt optimizer: give agents a harness where each run makes the next run measurably better. You point it at a goal written in plain English, and it generates a scenario, runs a multi-role loop against real evaluation, keeps what worked, and drops artifacts on disk that the next agent inherits automatically.
The repo has crossed 1,000 stars and ships as both a Python package (autocontext) and a TypeScript package (autoctx), under Apache 2.0. Supported backends include Anthropic, OpenAI-compatible endpoints (including vLLM and Ollama), Gemini, Mistral, Groq, OpenRouter, Azure, MLX on Apple Silicon, CUDA on Linux, and the Pi local coding agent. Claude Code, Cursor, and any MCP client can drive it directly through autoctx mcp-serve.
Five roles, one feedback loop
A single agent does not run the show. Each iteration is orchestrated by five cooperating roles:
- competitor proposes a strategy or artifact for the task
- analyst explains what happened and why the score moved
- coach turns that analysis into playbook updates and future hints
- architect proposes new tools or harness changes when the loop stalls
- curator gates what knowledge is allowed to persist across runs
Strategies get scored through scenario execution and staged validation. Weak changes are rolled back, successful ones are promoted into a
This story is for Pro members
You've reached the end of the free preview. Upgrade to AlphaSignal Pro to read the full article - and everything else behind the paywall.