agentleFS
zad111ak-aizad111ak-ai/hermes-agent-skills/skills/meta/adaptive-loops/SKILL.md

adaptive-loops

Skill7 starsChanged 4 months agoMITView on GitHub

Self-healing and self-learning loops for AI agents. Auto-recover from errors, remember what works.

  • Installs packages

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When a tool fails:

    line 25
  2. Distinctive:

    Update trust scores for approaches

    line 35

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Adaptive Loops

Self-healing and self-learning system for AI agents. Automatically recovers from errors and remembers what works.

Philosophy

"The best agent is the one that learns from its mistakes without being told."

Two Types of Loops

1. Self-Healing Loop

When a tool fails:

  1. Detect error type (timeout, auth, rate limit, etc.)
  2. Apply appropriate adapter (retry, rotate, proxy, etc.)
  3. Retry with fix
  4. Record result for future reference

2. Self-Learning Loop

After each task:

  1. Record outcome (success/failure)
  2. Note what worked/didn't work
  3. Update trust scores for approaches
  4. Apply successful patterns to future tasks

Usage

Pre-flight Check (before action)

# Check for known antipatterns
fact_store(action="reason", entities=["task_type", "past_error"])

# Check for known fixes
ls ~/.hermes/logs/adaptive/

Post-action Capture (after result)

# Record success
cd ~/.hermes/learning_loop
python3 learning.py record coding "fixed proxy issue" true "groq/llama-3.1-8b-instant" "groq"

# Record failure
python3 learning.py record system_admin "config edit failed" false "auto/best-chat" "omniroute"

Error-driven Adaptation

# Automatic error handling
core.handle_error(tool="browser", error_type="timeout", msg="Connection reset", context={})

Adaptation Strategies

Error TypeStrategyExample
TimeoutRetry with backoffsleep 5 && retry
Auth failureRotate credentialsUse different API key
Rate limitWait + retrysleep 60 && retry
DPI blockSwitch proxyHysteria2 → Tor
Model failureFallback modelauto/best-chat → groq

File Structure

~/.hermes/logs/adaptive/
├── browser_errors.jsonl
├── terminal_errors.jsonl
├── web_errors.jsonl
└── ...

What NOT to Ask Dima

  • "Can I record a fact?" → Just record it
  • "Can I try an alternative?" → Just try it
  • "Can I run handle_error?" → Just run it

What TO Ask Dima

  • Delete files/services
  • Change systemd
  • Install new software (pip install)
  • Modify proxy/OmniRoute config

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.