[claude] Implement AutoLoRA continuous improvement loop (#1105) #1118

Merged
claude merged 1 commits from claude/issue-1105 into main 2026-03-23 18:18:33 +00:00

1 Commits

Author SHA1 Message Date
Alexander Whitestone
283ec330c8 feat: implement AutoLoRA continuous improvement loop (#1105)
Some checks failed
Tests / lint (pull_request) Failing after 16s
Tests / test (pull_request) Has been skipped
Adds the weekly sovereignty retrain cycle — Timmy improves himself
without cloud AI in the decision path.

Components:
- `timmy_automations/retrain/trajectory_exporter.py` — reads session
  JSONL logs and segments them into discrete conversation trajectories
- `timmy_automations/retrain/quality_filter.py` — scores trajectories
  (multi-step tasks, successful tool calls, decision points) and keeps
  only HIGH/MEDIUM quality examples
- `timmy_automations/retrain/training_dataset.py` — appends filtered
  trajectories to a chat-format JSONL training file with deduplication
- `timmy_automations/retrain/lora_trainer.py` — triggers mlx_lm.lora
  fine-tune and registers the resulting adapter in Ollama; degrades
  gracefully when mlx-lm is unavailable
- `timmy_automations/retrain/training_log.py` — records per-cycle
  metrics (iteration count, train loss, skill accuracy) to JSONL + MD
- `timmy_automations/retrain/retrain.py` — main orchestrator; runs the
  full pipeline and is registered as a `weekly_sunday` automation

Automation registered in `automations.json` as `retrain` with
`schedule: weekly_sunday` pointing to `hermes4-14b` as the base model.

49 new unit tests covering all components.

Fixes #1105

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 14:17:39 -04:00