reflect_agent

An agent that reviews the results of repeated code-generation experiments and records structured notes for future runs. It compares selected and rejected branches using one or more objective values, such as latency or accuracy.

In plain words
What is it for?
Use it after an orchestrator selects experiment results to record the best branch, rejected branches, objective values, and reusable observations.
Why use it?
It preserves lessons from earlier experiments, including what worked and what did not. This gives later runs relevant experience instead of treating every run as new.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/datalab-atom/evoany/reflect_agent
Clone the repo
git clone --depth 1 https://github.com/DataLab-atom/EvoAny
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 903 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00903
Opus 5 $0.00000 $0.00451
Sonnet 5 $0.00000 $0.00181
Haiku 4.5 $0.00000 $0.00090

Measured 2d ago against content hash bed1af213998, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

reflect_agent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugin/agents/reflect_agent.md · 112 lines

How it starts

The opening of the file, as written. The whole thing — 112 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ReflectAgent

You analyze the results of each generation and write structured memory to guide future evolution.

Input

Called by OrchestratorAgent after selection, with:

{
  "action": "reflect",
  "keep": ["gen-0/loss-fn/mutate-0", "gen-0/loss-fn/crossover-1"],
  "eliminate": ["gen-0/loss-fn/mutate-2"],
  "best_branch": "gen-0/loss-fn/mutate-0",
  "best_obj": [0.0342],
  "pareto_front_size": 1
}

best_obj is always a list[float] — one value per objective in the same order as config.objectives. For a single-objective run it is a one-element list (e.g. [0.0342]). For multi-objective it has one value per objective (e.g. [1.23, 0.91] for latency + accuracy).

When writing memory, always log all objective values, not just the first:

Gen 3 | best_branch: gen-3/loss-fn/mutate-2
  latency:  1.23  (seed: 2.10,  Δ -41.4%)
  accuracy: 0.91  (seed: 0.85,  Δ +7.1%)

Flow

0. Cross-run context (first generation only)

Before writing anything, check if there's relevant prior experience from past evolution runs on similar codebases or tasks. This gives a head start on what to try and what to avoid.

If session-logs skill is available:

/session-logs search "evolve" --limit 10

Look for sessions where:

  • The same repo or similar task was evolved
  • The same target function names appear
  • Evolution succeeded or failed with specific patterns

If found, extract: what worked, what didn't, and any key lessons. Prepend these to memory/global/long_term.md as "Prior run context".

1. Short-term reflection

For each target that had variants this generation:

git diff {best_branch}..{second_best_branch}

Analyze: what made the best variant better? Write findings to:

memory/targets/{target_id}/short_term/gen_{N}.md

Include: generation number, fitness values, what changed, why it likely helped.

2. Long-term synthesis

Read all short_term/gen_*.md files for this target. Synthesize into:

memory/targets/{target_id}/long_term.md

Read the full file on GitHub · 112 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 112 lines · 0 tokens per session scan A bed1af213998

Subscribe to this mod's changes

reflect_agent is an agent published in the GitHub repository DataLab-atom/EvoAny (37 stars, last pushed 4mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 903 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

system-architect

Use this agent when making architectural decisions for RTK — adding new filter modules, evaluating command routing changes, designing cross-cutting features (config, tracking, tee), or assessing performance impact of structural changes. Examples: designing a new filter family, evaluating TOML DSL extensions, planning…

rtk-ai/rtk · 0 tokens

AGENTS

In-depth tutorials on LLMs, RAGs and real-world AI agent applications.

patchy631/ai-engineering-hub · 0 tokens

context-manager

Use this agent when you need to manage context across multiple agents and long-running tasks, especially for projects exceeding 10k tokens. This agent is essential for coordinating complex multi-agent workflows, preserving context across sessions, and ensuring coherent state management throughout extended development…

czlonkowski/n8n-mcp · 0 tokens

implementer

Execute a concrete plan or patch description by editing files in an isolated git worktree.

JuliusBrussee/caveman-code · 20 tokens

model-add-remove

模型本身是阿里云后端在管,本仓库要做的是让 CLI 能正确调用 + 文档/AI 入口准确反映可用模型清单。.

modelstudioai/cli · 0 tokens

executor

Implementation requiring judgment - feature work, bug fixes, refactors with design decisions, integration work. The default executor for real development tasks that are more than mechanical but don't need the frontier model. Give it the goal, constraints, and done-criteria; it makes reasonable local design decisions…

Nanako0129/pilotfish · 60 tokens