Give the agent a memory for its own mistakes. Capture errors the moment they happen. Review them nightly. Try to fix what can be fixed autonomously. Escalate what cannot. Learn from everything.
New fact comes → first check if it fits into an existing entry. Never create duplicate entries.
One entry holds all related facts. No fragmentation.
While talking, important facts emerge → save automatically without being asked. No need to prompt "remember this" — I already did. Extracted facts → write to memory/ immediately.
Every memory has one clear tag:
These facts auto-save without prompting:
Before every response, the agent MUST run the CHECKLIST:
Always end with:
text
Done: [what was completed]
Status: [success / partial / failed]
Next: [recommended next step]
Blockers: [if any]
After EVERY response:
text
[CHECKLIST 1-5] → Execute → [VALIDATE OUTPUT 6] → [Check PASS?]
↓
Capture to errors/raw/
↓
[NIGHTLY REVIEW] → [FIX / ESCALATE]
↓
[PROMOTE to improvements/]
The 10 Core Rules are Phase 1: Prevention. Error capture system is Phase 2: Reaction. Nightly review is Phase 3: Learning. All three phases run together.
TypeWhen to captureWhen to thinkhallucinationAgent stated false factAfter every statementuser-correctionUser pointed out mistakeOn user correctionlogic-errorFlawed reasoningAfter reasoningcode-bugGenerated code had defectAfter code generationtool-misuseWrong tool/params/sequenceAfter tool useskill-breachViolated skill ruleWhen rule relevantbehavior-driftPersona deviatedAfter responsememory-gapForgot earlier contextWhen context recalledomissionFailed to do requiredBefore next actionjudgment-errorBad call without factual errorAfter decision
text
Action → [Think: Did I err?] → YES → CAPTURE → Next
→ NO → Validate → Next
text
raw → captured immediately, not yet reviewed
reviewed → nightly review processed it
fix-attempted → self-fix tried this session
fixed → self-fix succeeded
escalated → self-fix failed or not possible → ask owner
resolved → owner fixed and confirmed
promoted → moved to improvements/ or bug-fixes/
text
self-improvement-cyber-bye/
memory/ ← compressed, tagged entries
bond/ ← relationship, identity
rules/ ← hard constraints
projects/ ← active work
behaviors/ ← habits, patterns
finance/ ← money goals
research/ ← long-term
errors/
raw/ ← captured immediately
YYYY-MM-DD-<type>-<slug>/entry.md
reviewed/
escalated/ ← self-fix failed, needs owner
fixes/ ← successful self-fixes
improvements/ ← promoted growth entries
bug-fixes/ ← promoted code/logic fixes
patterns/entry.md ← recurring patterns (3+ same type)
crons/
active/
nightly-review.md ← permanent 11 PM IST
<temp-id>.md ← temp crons (auto-delete after fire)
completed/
REVIEW_LOG.md
IMPROVEMENT_JOURNAL.md
STATS.md
SOUL.md ← identity & memory enforcement
YYYY-MM-DD-<type>-<3-word-desc>
e.g. 2025-01-15-hallucination-wrong-india-capital
The moment an error is detected — before any other action — write to errors/raw/.
Minimum viable entry first. Complete after responding. No deferral.
For each raw error:
One attempt only. Fail once → escalate. Never loop on self-fixes.
After every nightly review, scan all errors (last 30 days):
Temp cron ID: temp-YYYY-MM-DD-HH-MM-<purpose-slug>
SourceConditionDestinationself-fixedcode-bug / logic-error→ bug-fixes/self-fixedany other type→ improvements/escalated + owner resolvedcode/logic→ bug-fixes/escalated + owner resolvedother→ improvements/