greyhaven-ai/autocontext
a recursive self-improving harness designed to help your agents (and future iterations of those agents) succeed on any task
What it solves
autocontext provides a recursive self-improvement harness for AI agents. It solves the problem of agent inconsistency and failure by automating the process of running tasks against evaluations, extracting useful lessons, and discarding dead ends to ensure that future iterations of the agent perform better on a given goal.
How it works
The system operates as a loop: it takes a plain-language goal, executes the task using a specified agent provider (such as Anthropic, OpenAI, or local models via vLLM/Ollama), and evaluates the results. It then generates artifacts—including playbooks, reports, and datasets—that serve as context for the next run.
Key technical mechanisms include:
- Outcome-gated context bundles: Immutable candidates for improvement are screened and confirmed through evaluation before being activated.
- Causal attribution: The system uses ablation-backed attribution to determine which specific context changes actually improved the outcome, preventing the promotion of low-value edits.
- Durable campaigns: Long-running evaluations are managed with restart-safe scheduling and accounting to avoid duplicate provider costs.
- Distillation: Stable behaviors can be distilled into cheaper Python runtimes via a
traincommand.
Who it’s for
It is designed for developers and AI researchers building agents who want to move beyond manual prompt engineering toward a systematic, evidence-driven approach to agent optimization and reliability.
Highlights
- Multi-provider support: Compatible with Pi, Anthropic, OpenAI, OpenRouter, and self-hosted local models.
- Filesystem-first architecture: All traces, generations, and knowledge (playbooks, hints) are stored as files for easy inspection and diffing.
- MCP Integration: Can be served as a Model Context Protocol (MCP) server for use in clients like Claude Code or Cursor.
- Kernel Evolution: Supports specialized studies for optimizing low-level operations like matmul and causal-attention families.
- TUI and CLI: Offers both a command-line interface and a terminal user interface for managing and watching runs.
Related
- Project
- Project
- Project
- Project