Docs · Intelligent loop

Insi

Incord Super Intelligence

Insi turns a repository's own history into a benchmark, then uses it to make your coding agent better. A fix commit that also changed a test becomes a task; the agent works it in a throwaway checkout and is judged by tests it never saw. What went wrong becomes a lesson for the next task, and a change to the agent's prompts or settings is kept only if the benchmark says it helped.

Early release. Version 0.1.0. It ships inside Watchman beside the memory engine; on its own, build it from source, as the npm and pip packages are not yet published.

What it is

“My agent learns” is usually an anecdote. Insi counts an improvement only when it raises the pass rate on tasks it was not learned from, against a control. Nothing changes silently: changes arrive as draft pull requests, and Insi never merges.

  1. 1Mineinsi mine turns fix commits into tasks; the hidden tests are kept outside the checkout.
  2. 2Validateinsi validate runs two agent-free controls per task, to keep only the fair ones.
  3. 3Evaluateinsi eval runs your agent on the tasks, with a cost cap.
  4. 4Learninsi learn writes lessons from failed attempts.
  5. 5Improveinsi improve --harness changes one prompt or setting at a time and keeps it only if the benchmark improves.

Install and set up

Build from source (Rust 1.89+ and git)

git clone https://github.com/incordai/Insi.git
cd Insi
cargo build --release

In your repo

insi init

insi init detects your stack and writes .insi/config.toml, the MCP entry, the Claude Code hook and a CI workflow; --no-mcp, --no-hooks and --no-ci skip each. The default worker is Incode; presets exist for claude, codex and agy.

CLI

CommandWhat it does
insi doctorOffline checks, with secrets redacted.
insi reportPass rate, timeouts, repeat failures, cost, and reward hacking per condition.
insi suggestBenchmark-gated code improvement; a draft PR only for a measured gain.
insi heartbeatRepeat discovery and evaluation on a timer.
insi reviewAn evidence-first review of a revision or pull request.
insi issue --number NWork a GitHub issue that carries the trusted label into a draft PR.
insi sandbox runRun a command in the built-in OS sandbox.

Insi listens on no port and holds no GitHub token; GitHub goes through the gh CLI's own login.

MCP tools

insi mcp is a read-only MCP server over stdio: nothing an agent sends can write a lesson or run anything.

Claude Code

claude mcp add --scope project insi -- insi mcp
ToolWhat it does
insi_briefingThe verified lessons for a topic, as one briefing of what to do and what to avoid.
insi_lessons_for_errorLessons whose failure matches this error output.
insi_contextOutside context for a topic: repo docs, failed CI runs and connectors, each with its trust level.

insi hook is a Claude Code hook: before an edit, and after a failed shell command, it adds the matching lessons to the agent's context.

How it connects to Watchman

  • Inmem holds the knowledge (lessons, beliefs, retrieval); Insi holds the experiments, the frozen benchmarks and the decision to propose a PR.
  • Insi talks to the engine at 127.0.0.1:9180 and refuses any address that is not your own machine.
  • learn --to-memory and improve --to-memory write lessons and decisions into memory; suggest reads context first.
  • Its heartbeat research uses the same research tool every agent and Watchman use.
  • Scheduled checks run from Inmem's scheduler (.incord/watch.toml); Insi only adds its own section there.

Other docs

How every service reaches Watchman, in one place: How it connects.