Skip to content

Reflex

Reflex is a self-improvement loop for agent harnesses.

Core trick

A recursive Gemini reflection loop reads failed execution traces alongside the current skill files and rewrites the skill markdown for the next run.

Tags

Description

Reflex is a self-improvement loop for agent harnesses. It watches real Antigravity execution traces, sends the trace plus the harness’s current skill files to a Google Managed Agent, and runs a recursive language-model reflection loop with Gemini 3.5 Flash to figure out what went wrong. The reflector can then edit an existing skill or author a new one, turning failed runs into better operating procedures for the next run. In our demo, Antigravity follows a stale skill, hits missing scripts/files/endpoints, and Reflex automatically patches the harness skills so the next agent discovers the correct project command and validates successfully.
AnthonyRonning/reflex★ 173 forksPythonCreated May 23, 2026 · last push May 23, 2026

README excerpt

# Reflex

Reflex is a self-improvement loop for agent harnesses.

It watches real Antigravity execution traces, sends the trace plus the harness's current skill files to a Google Managed Agent, and runs a recursive language-model reflection loop with Gemini 3.5 Flash to figure out what went wrong. The reflector can then edit an existing skill or author a new one, turning failed runs into better operating procedures for the next run.

In our demo, Antigravity follows a stale `api-smoke-test` skill, hits missing scripts/files/endpoints, and Reflex automatically patches the harness skills so the next agent discovers the correct project command and validates successfully.

- missing npm scripts
- missing API spec/client files
- stale API endpoint

![Reflex architecture](assets/reflex-architecture.png)

## How It Uses Managed Agents

Reflex uses a Google Managed Agent as the hosted reflector environment. The local Reflex process mounts the Antigravity trace, current `SKILL.md` files, and reflector script into the Managed Agent sandbox using the Interactions API.

Inside that Linux sandbox, the reflector installs/runs DSPy and executes `dspy.RLM` with Gemini 3.5 Flash. The Managed Agent analyzes the failed trace, identifies the harness-level failure, and returns structured JSON containing a diagnosis plus a replacement or newly authored skill.

## Demo Story

1. Antigravity runs locally on a developer project.
2. A bad skill causes obvious tool errors:
   - `npm run verify:api` doe

Team