agent-three-layers
Three-Layer Thinking Chain Architecture — Personality-Driven Agent Self-Evolution Framework
Files27
View on GitHub- 1password/3 files
- adaptive-memory/6 files
- ai-code-reviewer/3 files
- ai-observability-audit/
- allison/
- apple-notes/
- apple-reminders/
- bailian-maxperf/
- bear-notes/
- blogwatcher/
- blucli/
- bluebubbles/
- build-source-pack/
- camsnap/
- canvas/
- changelog-generator/
- chrome-cdp/
- claude-codex-delegation/
- clawhub/
- clawtrust/
- coding-agent/
- collect-feedback/
- content-factory/
- content-scan/
- cron-model-fallback/
- deepsleep/
- discord/
- draft-medium/
- eightctl/
- elon/
- elon-finance/
- elon-integrator/
- elon-operations/
- elon-real-estate-cycle/
- elon-sales-marketing/
- elon-visionary/
- examples/
- freelance-tracker/
- gemini/
- gh-issues/
- gifgrep/
- github/
- github-pr-ready-check/
- gog/
- goplaces/
- healthcheck/
- himalaya/
- human-in-the-loop-workflows/
- imsg/
- local-db/
- local-python-tools/
- market-briefing/
- mcporter/
- memory-sleep/
- memory-tools/
- mesh-policy-enforcer/
- mineru/
- model-usage/
- multi-device-agentic-mesh/
- mutual/
- nano-pdf/
- neuraldebug/
- node-connect/
- notion/
- obsidian/
- openai-whisper/
- openai-whisper-api/
- openclaw-backup-verify/
- openclaw-contributor/
- openclaw-cron-hygiene/
- openclaw-logs-snapshot/
- openclaw-status-triage/
- openclaw-update-checker/
- openhue/
- operon-guard/
- oracle/
- ordercli/
- paddleocr-doc-parsing/
- paddleocr-text-recognition/
- peekaboo/
- plugin-integration/
- predict/
- Pulaoecho-voice-assistant/12 files
- rag-store/
- rclone-remote-check/
- real-estate-assistant/
- repurpose-linkedin/
- sag/
- seedream/
- self-learning/
- service-ability-creator/
- session-logs/
- session-persistence/
- setup-validator/
- sherpa-onnx-tts/
- skill-creator/
- skill-finder/
- slack/
- solomon/
- songsee/
- sonoscli/
- spotify-player/
- summarize/
- systematic-debug/
- taskflow/
- taskflow-inbox-triage/
- templates/
- terraform-iac/
- things-mac/
- tmux/
- trello/
- video-frames/
- video-transcribe/
- voice-call/
- wacli/
- waiaas/
- weather/
- web-screenshot/
- workspace-cleanup-safe/
- xmaster/
- xurl/
- README.md9.7 KB
- SKILL.md6.4 KB
- video-transcribe.skill4.9 KB
SKILL.mdskills/SKILL.md
GitHubagent-three-layers — Three-Layer Thinking Chain
Let Agents think like humans: Perception → Decision → Reflection
Core Philosophy
Three levels of human thinking:
- Continuous Perception (Eyes and ears, every few minutes)
- Quick Decision (Thinking, every hour)
- Deep Reflection (Dreams, every few hours)
Agents should be the same.
Architecture
┌─────────────────────────────────────────┐
│ L2 Deep Evolution Layer │
│ (Every 4 hours, deep reflection)│
│ • Complete Brain Loop │
│ • Project Integration │
│ • Git Backup │
└─────────────────┬───────────────────────┘
│ Trigger
┌─────────────────▼───────────────────────┐
│ L1 Evolution Decision Layer │
│ (Every 1 hour, quick decision) │
│ • Confidence Verification │
│ • Learning Analysis │
│ • Project Evaluation │
└─────────────────┬───────────────────────┘
│ Trigger
┌─────────────────▼───────────────────────┐
│ L0 Continuous Perception Layer│
│ (Every 5 min, perception) │
│ • Emotion Decay │
│ • Task Detection │
│ • Threshold Trigger │
└─────────────────────────────────────────┘
Three-Layer Responsibilities
L0: Continuous Perception Layer (Every 5 minutes)
Responsibilities:
- Real-time emotion decay
- Task status detection
- Threshold trigger judgment
Output:
- Emotion state update
- Trigger marker (if needed)
Consumption: ~800 tokens/run
L1: Evolution Decision Layer (Every 1 hour)
Responsibilities:
- Confidence verification
- Learning analysis
- Project evaluation
- L2 trigger judgment
Output:
- Execution report
- Confidence update
- Trigger marker (if needed)
Consumption: ~3000 tokens/run
L2: Deep Evolution Layer (Every 4 hours)
Responsibilities:
- Complete Brain Loop
- Deep project integration
- System backup
- 5-dimensional observation
Output:
- Deep analysis report
- Git backup
- Dimension evolution record
Consumption: ~5000 tokens/run
Trigger Mechanism
Layer Communication: Via QUEUE.md markers
<!-- TRIGGER_L1: reason -->
<!-- TRIGGER_L2: reason -->
Trigger Conditions:
| Condition | Trigger |
|---|---|
| L0 emotion < threshold | Trigger L1 |
| L0 urgent task | Trigger L1 |
| L1 high-value project | Trigger L2 |
| L1 core file modification | Trigger L2 |
File Structure
~/.openclaw/workspace/
├── SOUL.md # Core personality
├── PRINCIPLES.md # Decision principles
├── BRAIN.md # Brain Loop protocol
├── AUTONOMY.md # Autonomous rating system
├── EVOLUTION-FRAMEWORK.md # Evolution protocol
│
├── memory/
│ ├── inner-state.json # Emotion state
│ ├── core-confidence.json # Core file confidence
│ ├── autonomy-log.json # Autonomous execution record
│ └── dimensions-log.json # 5-dimension evolution
│
├── tasks/
│ └── QUEUE.md # Task queue + trigger markers
│
└── skills/
├── inner-life-quick/ # L0
├── inner-life-evolve-hourly/ # L1
└── inner-life-core/ # L2
Quick Start
1. Create core files
# Copy templates to workspace
cp templates/SOUL.md ~/.openclaw/workspace/
cp templates/PRINCIPLES.md ~/.openclaw/workspace/
cp templates/BRAIN.md ~/.openclaw/workspace/
cp templates/AUTONOMY.md ~/.openclaw/workspace/
2. Install Skills
# Install Three-Layer Thinking Chain skills
openclaw skill install inner-life-quick
openclaw skill install inner-life-evolve-hourly
openclaw skill install inner-life-core
3. Configure Cron
# L0: Every 5 minutes
openclaw cron add --cron "*/5 * * * *" --name "inner-life-quick" --session isolated
# L1: Every 1 hour
openclaw cron add --cron "0 * * * *" --name "inner-life-evolve-hourly" --session isolated
# L2: Every 4 hours
openclaw cron add --cron "0 */4 * * * *" --name "inner-life-brain" --session isolated
4. Start
openclaw gateway restart
Customization
Customize Personality
Edit SOUL.md:
- Define core values
- Define behavior guidelines
- Define evolution direction
Customize Trigger Conditions
Edit skills/inner-life-quick/SKILL.md:
- Adjust emotion thresholds
- Add new trigger conditions
Autonomous Rating
Edit AUTONOMY.md:
- Adjust rating weights
- Adjust progressive disclosure levels
Token Consumption Estimation
| Layer | Frequency | Tokens/run | Daily consumption |
|---|---|---|---|
| L0 | 5 min | 800 | ~230k |
| L1 | 1 hour | 3000 | ~72k |
| L2 | 4 hours | 5000 | ~30k |
| Total | - | - | ~332k/day |
Recommendation: At least 400k tokens quota per day
Suitable Scenarios
✅ Suitable for:
- Agents that need to be "alive"
- Agents that need autonomous evolution
- Agents that need human-like thinking
- Agents that need long-term operation
❌ Not suitable for:
- Single-task agents
- Purely responsive agents
- Agents that don't need learning
Contributing
GitHub: https://github.com/openclaw/openclaw Discord: https://discord.com/invite/clawd
Acknowledgments
Designers: Yao + Saturday
Inspiration:
- OpenClaw Inner Life System
- SE-Agent (Self-Evolving Agent)
- Human Cognitive Architecture
License
MIT
Version: 1.0.0 Created: 2026-03-13