autocontext
A recursive self-improving agent harness that runs LLM agents through structured scenarios, evaluates outputs, and accumulates validated knowledge so repeated runs get better over time.
At a Glance
Fully free and open-source under the Apache License 2.0. Install via pip or npm and use without restrictions.
Engagement
Available On
Alternatives
Listed Apr 2026
About autocontext
autocontext is an open-source recursive self-improving harness for LLM agents that closes the loop between execution, evaluation, and knowledge accumulation. Instead of starting every agent run cold, autocontext persists what worked — traces, playbooks, artifacts, and distilled models — so each subsequent run builds on validated prior success. It supports Python and TypeScript surfaces, multiple LLM providers, and a structured multi-agent loop with roles for proposing, analyzing, coaching, and curating knowledge.
- Scenario Families: 11 reusable scenario families (game, agent_task, simulation, investigation, workflow, negotiation, coordination, and more) executable in both Python and TypeScript.
- Multi-Agent Loop: A structured internal loop with competitor, analyst, coach, architect, and curator roles that propose, evaluate, and gate knowledge persistence.
- Persistent Knowledge: Validated playbooks, hints, tools, reports, and progress snapshots accumulate across runs rather than being discarded.
- Multiple Surfaces: Access via CLI (
autoctx), REST API server, MCP server, TypeScript/TUI operator surfaces, and external agent integration. - Provider Routing: Supports Anthropic, OpenAI-compatible endpoints, Gemini, Mistral, Groq, OpenRouter, Azure OpenAI, MLX (Apple Silicon), Pi, and deterministic testing backends.
- Frontier-to-Local Distillation: Export stable training data and distill it into cheaper local runtimes using MLX on Apple Silicon.
- Replay and Analysis: Inspect, compare, and replay runs, simulations, investigations, and missions to understand regressions and stable wins.
- Notification Hooks: Route notifications via Slack, HTTP webhooks, stdout, or composite routing using
AUTOCONTEXT_NOTIFY_*env vars. - Quick Start: Install via
pip install autocontextornpm install autoctx, then runautoctx solve --description "your task" --gens 3to hand the harness a plain-language task and let it iterate.
Community Discussions
Be the first to start a conversation about autocontext
Share your experience with autocontext, ask questions, or help others learn from your insights.
Pricing
Open Source
Fully free and open-source under the Apache License 2.0. Install via pip or npm and use without restrictions.
- Full Python control-plane CLI
- TypeScript package with CLI and library surface
- All 11 scenario families
- Multi-agent loop execution
- Persistent knowledge and artifacts
Capabilities
Key Features
- Recursive self-improving agent harness
- 11 reusable scenario families
- Structured multi-agent loop (competitor, analyst, coach, architect, curator)
- Persistent playbooks, hints, and knowledge across runs
- Staged validation and harness-aware execution
- Replays, checkpoints, and exported artifacts
- Frontier-to-local distillation with MLX on Apple Silicon
- CLI, API server, MCP, and TypeScript/TUI surfaces
- Multi-provider LLM routing (Anthropic, OpenAI-compatible, Gemini, Mistral, Groq, OpenRouter, Azure, MLX, Pi)
- Notification hooks via Slack, HTTP webhooks, stdout
- Export training data for downstream systems
- Verifier-driven missions with checkpoints and completion criteria
- Campaign coordination for multi-mission workflows
- V8 isolate codegen for secure TypeScript execution
- Subprocess-based executors for Python with SSH and sandboxed options
