Token导航 LogoToken导航TokenDH.com
开发external-serviceclawhub未标认证来源可访问clear审计通过

reflex-learn反射学习

Agent Skill

reflex-learn 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 OpenClaw 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

4,633

周安装

197

GitHub Stars

公开资料未说明

下载量

1,623
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:reflex-learn(反射学习)
来源仓库:https://github.com/kaventures/reflex-learn
安装命令:
openclaw skills install reflex-learn
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install reflex-learn

简介

通过重复查询检测隐式负反馈,实现持续学习。

  • 将不重复查询视为正反馈,优化代理行为。
  • 适合跨会话积累经验和调整策略。reflex-learn 属于开发类 Skill,可作为该场景下的辅助能力补充。
  • 安装命令:openclaw skills install reflex-learn。
  • 使用前建议确认权限范围和维护状态,避免触发未授权操作。

SKILL.md

name
reflex-learn
description
Detects repeated queries as implicit negative feedback and non-repetition as positive feedback, enabling continuous learning by writing reflections and patterns to MEMORY.md and SOUL.md. v1.1.1 adds path validation, model-download guard, --offline flag, and a formal install.sh.
version
1.1.1
triggers
metadata
openclaw
requires
bins
["python3", "bash"]

ReflexLearn

ReflexLearn enables true continuous learning via implicit feedback. It turns repetition of the same question into an automatic "I screwed up" signal and non-repetition into a "user is satisfied" signal — with no explicit rating or feedback required from the user.

v1.1.1 fixes: path validation enforced in code (all writes restricted to ~/.openclaw/), model-download guard with explicit warning and --offline flag, install.sh for declared one-step PyPI + model-weight setup, scikit-learn removed from dependencies (was unused).

Installation

Step 1 — Run the install script. This is the only step that touches the network. It installs Python packages from PyPI and pre-caches the model weights from Hugging Face (~80 MB, one-time only). After this step the skill can run fully offline.

bash {baseDir}/install.sh

The script explicitly lists every network operation before proceeding and requires confirmation.

Step 2 — Add to soul.md:

## Skills
- reflex-learn

Usage

Run after every agent response (post-response trigger):

python3 {baseDir}/reflex_learn.py \
  --query "<current_user_query>" \
  --memory-file ~/.openclaw/MEMORY.md \
  --soul-file ~/.openclaw/SOUL.md \
  --history-file ~/.openclaw/reflex_history.json \
  --pending-file ~/.openclaw/reflexlearn-pending.md \
  --skill-md {baseDir}/SKILL.md \
  --offline

Run on heartbeat to scan for positive reinforcement candidates:

python3 {baseDir}/reflex_learn.py \
  --heartbeat \
  --memory-file ~/.openclaw/MEMORY.md \
  --soul-file ~/.openclaw/SOUL.md \
  --history-file ~/.openclaw/reflex_history.json \
  --skill-md {baseDir}/SKILL.md \
  --offline

Optionally, use local Ollama for richer AI-generated reflections (no additional network access — Ollama runs locally):

python3 {baseDir}/reflex_learn.py --query "<query>" --use-ollama --ollama-model llama3

Slash commands (pass as --query value):

python3 {baseDir}/reflex_learn.py --query "/reflex status"
python3 {baseDir}/reflex_learn.py --query "/reflex ignore-last"

Configuration

Edit these values directly in this file to tune behaviour. They are parsed at runtime.

  • SIMILARITY_THRESHOLD: 0.85
  • LOOKBACK_INTERACTIONS: 10
  • POSITIVE_REINFORCEMENT_DELAY: 3
  • REPEAT_COUNT_THRESHOLD: 2
  • SESSION_WINDOW_MINUTES: 60
  • MODE: cautious
OptionDefaultDescription
SIMILARITY_THRESHOLD0.85Cosine similarity above which two queries are considered the same
LOOKBACK_INTERACTIONS10How many past interactions to compare against
POSITIVE_REINFORCEMENT_DELAY3Interactions to wait before confirming positive reinforcement
REPEAT_COUNT_THRESHOLD2Repeats within the session window required to flag as failure
SESSION_WINDOW_MINUTES60Time window (minutes) within which repeats are counted
MODEcautiouscautious = stage updates in pending file; aggressive = write directly to SOUL.md

Signal Types

SignalMeaning
neutralNo similar query found in history
watchingSimilar query found, repeat count below threshold — monitoring
preferenceSimilar query with modifier words — preference extracted, not a failure
negativeRepeat threshold reached — reflection written to MEMORY.md
reinforcedQuery not repeated in next N interactions — positive reinforcement written

Core Behavior

On every user message, ReflexLearn embeds the query with sentence-transformers (all-MiniLM-L6-v2) and compares it to the last LOOKBACK_INTERACTIONS interactions stored in ~/.openclaw/reflex_history.json.

If cosine similarity > SIMILARITY_THRESHOLD and the query contains modifier words (e.g., "be more concise", "add examples", "in table format"), it extracts a preference and writes it to MEMORY.md — it does not flag this as a failure.

If cosine similarity > SIMILARITY_THRESHOLD without modifier words and the repeat count within SESSION_WINDOW_MINUTES reaches REPEAT_COUNT_THRESHOLD, it triggers a reflection and writes it to MEMORY.md.

In cautious mode (default), proposed SOUL.md updates are staged in reflexlearn-pending.md for human review. In aggressive mode, they are written directly to SOUL.md.

On heartbeat, if the same query is NOT repeated in the next POSITIVE_REINFORCEMENT_DELAY interactions, it triggers positive reinforcement.

All memory writes are valid Markdown that OpenClaw already understands.

Security and Network Rules

  • Path enforcement: The code resolves all file paths and aborts with an error if any path falls outside ~/.openclaw/. This is enforced in code, not just documentation.
  • No runtime network access: After install.sh has been run, the skill operates fully offline when invoked with --offline. Without --offline, a warning is printed if the model is not cached.
  • Declared network operations: All network access (PyPI, Hugging Face) is performed exclusively by install.sh, which lists operations and requires user confirmation before proceeding.
  • Local Ollama only: The optional Ollama integration calls localhost:11434 only — no external API.
  • No writes outside ~/.openclaw/: Enforced at runtime; any misconfigured path triggers an immediate exit.
  • In cautious mode, NEVER write directly to SOUL.md without staging in pending file first.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

83.29%
按下载量换算1,352

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills