Never repeat the same mistake twice. An automatic failure pattern recording & recall system for OpenClaw agents.
AI agents make mistakes β misconfigurations, wrong flags, API quirks, permission errors. Without a structured way to log and recall these failures, the same mistakes get repeated across sessions.
Failure Memory solves this by:
- Recording every failure with context, root cause, and resolution
- Recalling relevant past failures before starting similar tasks
- Reporting patterns so systemic issues get fixed
Error occurs β Log to memory/failures.md β Next similar task β Auto-recall β Avoid repeat
## [2026-03-02 12:30] Docker permission denied on socket
- **Category:** permissions
- **Context:** Trying to run `docker compose up` for local dev
- **Error:** `Got permission denied while trying to connect to the Docker daemon socket`
- **Root Cause:** User not in docker group after fresh OS install
- **Resolution:** `sudo usermod -aG docker $USER && newgrp docker`
- **Prevention:** Check docker group membership in setup scripts
- **Tags:** docker, permissions, linux, setupBefore starting any significant task, the agent searches memory/failures.md for relevant history and surfaces known pitfalls:
β οΈ Known pitfall: Docker permission denied β check docker group membership first
clawhub install failure-memory-loggit clone https://github.com/VoidLight00/failure-memory.git
cp -r failure-memory /path/to/your/openclaw/workspace/skills/bash skills/failure-memory/scripts/init.sh| Feature | Description |
|---|---|
| π΄ Auto-Record | Logs failures when commands exit non-zero |
| π Pre-Task Recall | Searches past failures before similar work |
| π Failure Reports | Groups by category, identifies repeat patterns |
| π·οΈ Tag System | Keyword tags for precise grep/search |
| π Zero Dependencies | Plain markdown β no databases, no APIs |
| π Vector Search | Works with memory_search when available |
| Category | Examples |
|---|---|
build |
Compile errors, missing deps, version conflicts |
deploy |
Failed deploys, env misconfig, port conflicts |
config |
Wrong settings, missing env vars, path issues |
api |
Rate limits, auth failures, schema changes |
permissions |
File access, docker socket, sudo issues |
data |
Corruption, migration failures, encoding |
logic |
Wrong assumptions, race conditions, edge cases |
network |
DNS, SSL, timeout, proxy issues |
dependency |
Breaking updates, missing packages, conflicts |
# Failure Report β 2026-03-02
## Stats
- Total: 23 failures recorded
- Top category: config (8 occurrences)
- Repeat offenders: 3 patterns seen 2+ times
## Repeat Patterns
### ENV var not loaded in production
- Seen: 4 times
- Root cause: .env not copied to deploy target
- Systemic fix: Add .env validation to CI pipeline- Append-only β Never delete failure records, they're all lessons
- Grep-friendly β Structured markdown that works with
grep -i - Zero overhead β No external services, databases, or API keys
- Agent-native β Designed for AI agents, works with any OpenClaw setup
- OpenClaw (any version)
- No external dependencies
MIT
Built with π by VoidLight00