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
In this repository23 other files it gives its agents.
- content-pipelineSkill
- api-cost-trackerSkill
- memory-compactorSkill
- memory-guardianSkill
- post-mortem-analyzerSkill
- reflexive-trigger-boostSkill
- skill-trigger-systemSkill
- agent-communicationSkill
- auto-qa-gatesSkill
- cost-aware-orchestratorSkill
- decision-frameworkSkill
- GitHub Publish WorkflowSkill
- harvest-usageSkill
- network-restricted-hermesSkill
- omniroute-masterySkill
- reflection-qaSkill
- russia-hacksSkill
- self-hosted-aiSkill
- session-hygiene-plusSkill
- telegram-bot-patternsSkill
- tool-proficiency-trackerSkill
- trading-bot-deploymentSkill
- security-auditSkill
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
- Distinctive: line 25
When a tool fails:
- Distinctive: line 35
Update trust scores for approaches
≈ “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.
Files
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:
- Detect error type (timeout, auth, rate limit, etc.)
- Apply appropriate adapter (retry, rotate, proxy, etc.)
- Retry with fix
- Record result for future reference
2. Self-Learning Loop
After each task:
- Record outcome (success/failure)
- Note what worked/didn't work
- Update trust scores for approaches
- 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 Type | Strategy | Example |
| Timeout | Retry with backoff | sleep 5 && retry |
| Auth failure | Rotate credentials | Use different API key |
| Rate limit | Wait + retry | sleep 60 && retry |
| DPI block | Switch proxy | Hysteria2 → Tor |
| Model failure | Fallback model | auto/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
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
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.

