Self-improving harness proof of concept.
Stilts is a Python backend project that generates, evaluates, and iteratively improves LLM task harnesses.
It supports single-prompt and multi-step workflow harnesses, built-in episodic/semantic memory, self-authored tool generation, run recording/replay, and feedback-driven optimization.
Most LLM apps stop at prompt engineering. Stilts treats prompting as an optimization loop:
- Generate an initial harness from a task description
- Generate an eval suite automatically
- Evaluate outputs with LLM-as-judge and optional outcome checks
- Analyze failure patterns
- Propose and apply changes
- Re-evaluate and promote or reject
- Repeat until convergence
- Self-improving harness proof-of-concept (prototype/research-stage backend)
- CLI-first workflow
- Persistence via local JSON file store (
~/.stilts) - FastAPI service planned (see
plan.md)
- Iterative optimization pipeline (
ANALYZE -> PROPOSE -> GENERATE -> EVALUATE -> DECIDE) - Workflow DAG harnesses with per-node scoring
- Synthetic + targeted + adversarial + feedback-derived test generation
- Run recording and deterministic replay
- Structured memory (episodic/semantic) and skill extraction
- Cross-task transfer and self-model updates
- Optional tool-calling (built-in + self-authored tools)
- Parallel expert optimization mode
stilts/
├── backend/
│ ├── stilts/
│ │ ├── cli.py
│ │ ├── engine/
│ │ ├── harness/
│ │ ├── runtime/
│ │ ├── skills/
│ │ ├── store/
│ │ └── tools/
│ ├── requirements.txt
│ └── tests/
├── plan.md
└── research/
cd backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtexport OPENROUTER_API_KEY="your_key_here"python -m stilts.cli init "Classify support tickets by urgency and team" --name support-triagepython -m stilts.cli run "User says billing failed twice and service is down" --task support-triage| Command | Purpose |
|---|---|
init |
Create task + generate first optimized harness |
optimize |
Run more improvement cycles |
run |
Execute current best harness |
history |
Show optimization changelog |
runs |
List recorded runs |
feedback |
Attach production feedback to run records |
watch |
Check quality drift and auto-trigger optimization |
replay |
Deterministic replay of recorded runs |
compose / compose-run |
Build and run composed task pipelines |
skill-list / skill-show |
Inspect learned skills |
tools / tool-show |
Inspect self-authored tools |
Authored tool execution is disabled by default.
If you are in a trusted environment and intentionally want to execute generated/authored tools:
export STILTS_ALLOW_UNSAFE_AUTHORED_TOOLS=1Without this flag, authored tool validation/execution is blocked.
Run tests:
cd backend
pytest -qCompile check:
python -m compileall -q stilts testsMIT