light-rsi

AGENTS.md native ยท no dependencies

light-rsi

A lightweight recursive self-improvement loop that drops into any project following the AGENTS.md convention. Clone the folder, point the agent at goal.md, and let it run.

Goal anchor
1
Agent prompts
3
Dependencies
0
The light-rsi loop Nine steps arranged in a ring around the goal file: open, diagnose, blind check, gated brainstorm, evidence, implement, evaluate, iterate, close.

Click a step to inspect it. The loop always reads the goal first.

What lives where

light-rsi owns the loop and nothing else. Plans, state, logs, traces, code, data, and results stay with the host project.

Inside .light-rsi/

  • goal.mdObjective and done criteria. The anchor of every round.
  • memory/positive.mdWhat worked in the loop itself.
  • memory/negative.mdWhat failed, and under which conditions.
  • AGENTS.mdThe nine-step protocol, parallel-benefit gate, development discipline, and hard rules.
  • agents/Research, evaluation, and read-only document-review prompts.

Outside .light-rsi/

  • Plans and stateThe host project's own trackers.
  • Logs and tracesRun history owned by the host.
  • Code, data, resultsEverything the work produces.
  • Project memoryDomain knowledge never enters RSI memory.

RSI memory is deliberately narrow: only rules about running the loop. Reuse is gated by compatibility: exact may be reused, partial and unknown must pass the cheapest adaptation test, none is contrast only.

Run it

  1. Clone into the project

    git clone https://github.com/ztxtech/light-rsi \
      <project-root>/.light-rsi
  2. Point the host AGENTS.md at it

    ## RSI loop
    
    Before each round, read `.light-rsi/AGENTS.md`
    and run its loop. The goal is `.light-rsi/goal.md`.
  3. State the goal

    On first run the loop creates goal.md and the memory files from templates. They are git-ignored, so upstream updates never conflict with your goal or memory.

Why this design works

01

A system must see what it is missing

Improvement starts with gap detection between the current state and the goal. Without it, the loop only re-runs what it already knows and mistakes motion for progress.

02

Judgment must have discriminating power

A weak evaluator cannot separate progress from activity, so it stops early or churns. Here the evaluator starts from raw artifacts with a blank context, and may not say "can stop" while a blocker or a higher-value action remains.

03

Solving requires new information

Pure self-analysis converges to a fixed point: the system keeps re-deriving its own assumptions. The loop opens outward instead, through ready-made answers, similar problems, weaker subproblems, leading-route DFS, failure questions, and cross-domain literature, and treats what it finds as evidence rather than conclusion.

04

Parallelism must earn its cost

A gate compares expected gain with coordination cost and risk before decomposition. If parallel wins, isolated blank-context brainstormers fill every usable slot; their raw results are merged by evidence, not agreement, and dissent is preserved.

05

Critical comments are part of the interface

Comments are written in the user's language and explain contracts, assumptions, failure modes, trade-offs, and verification. They change with the code instead of drifting away from it.

06

Abstract flow comes first

The public path names the work and shows its order. Parsing, I/O, branching, and framework details stay inside focused functions or classes, so review starts with behavior rather than implementation noise.

07

Recorded facts need fresh evidence

High-impact claims are checked against dated source evidence and prior versions. History shows what changed, not what is true. Reviewers return findings; the main agent verifies them and keeps the append-only ledger.

08

Progress reports need decision facts

Side-conversation updates list rounds and tests, findings by round, the best verified result, and the next gate. Unrun tests and unverified fixes stay clearly labeled.

Hard rules in the entry protocol

  • Terse by default. The fewest words that keep the meaning; terseness never removes evidence, uncertainty, or blockers.
  • No slacking. No fake completion, no superficial patch, no skipped check, no invented result.
  • Blind review. The evaluator never inherits the main agent's reasoning or expected conclusion.
  • Parallel-benefit gate. Parallel brainstorming runs only when expected gain exceeds its combined coordination cost and risk.
  • Comments by contract. Critical comments use the current user's language and stay synchronized with contracts, assumptions, failure modes, trade-offs, and verification.
  • Abstraction before implementation. Public flow comes first; concrete details stay behind stable contracts in focused functions or classes.
  • Review recorded facts. Check high-impact claims against dated evidence; only the main agent writes the review ledger.
  • Report progress plainly. List rounds/tests, findings, the best verified result, and the next gate.

Acknowledgments

light-rsi is a lightweight extraction of the RSI loop from AION, a harness built for time-series work.

AION is a good project; it simply did not have enough compute and experiment hardware behind it. So we pulled its RSI loop out into a small external component that can be used every day.

It does not favor any harness: it follows the AGENTS.md convention. Your harness only needs a goal mode. Point it at the goal in .light-rsi/ and it can keep going, because the agent starts from this directory and runs the whole loop here.