Deep dive into OpenClaw architecture and internals
📖 Live Site: https://elarwei001.github.io/research_openclaw/
This repository documents the internal workings of OpenClaw, an AI agent framework. The goal is to understand its architecture through code analysis, issue investigation, and hands-on experimentation.
| Module | Description | Status |
|---|---|---|
| Session | Session lifecycle, caching, persistence | 📝 Active |
| Agent | Agent runtime, model switching, transcript | 📝 Active |
| Channels | Telegram, Discord, WhatsApp integration | 🔍 Basic |
| Gateway | HTTP/WebSocket server | 🔍 Basic |
| Memory | Memory indexing and retrieval | 🔍 Basic |
| Plugins | Plugin system and hooks | 🔍 Basic |
| Security | Authentication and pairing | 🔍 Basic |
| Browser | Browser automation | 🔍 Basic |
Real-world bug investigations for issues without active PRs:
| Issue | Module | Severity | Analysis |
|---|---|---|---|
| #22506 | Session | 🔴 Critical | Session GC causes gateway crash |
| #18194 | Session | 🔴 Critical | Compaction timeout loses session |
┌─────────────────────────────────────────────────────────────┐
│ Gateway Server │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │Telegram │ │ Discord │ │WhatsApp │ │ WebChat │ │
│ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ │
│ └────────────┴────────────┴────────────┘ │
│ │ │
│ ┌─────▼─────┐ │
│ │ Router │ │
│ └─────┬─────┘ │
│ │ │
│ ┌───────────────────────▼───────────────────────┐ │
│ │ Session Manager │ │
│ │ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ │
│ │ │ Store │ │ Cache │ │Compactor│ │ │
│ │ └─────────┘ └─────────┘ └─────────┘ │ │
│ └───────────────────────┬───────────────────────┘ │
│ │ │
│ ┌─────▼─────┐ │
│ │ Agent │ │
│ │ Runtime │ │
│ └─────┬─────┘ │
│ │ │
│ ┌───────────┬───────────┼───────────┬───────────┐ │
│ │ Memory │ Plugins │ Tools │ Browser │ │
│ └───────────┴───────────┴───────────┴───────────┘ │
└─────────────────────────────────────────────────────────────┘
This is a personal research project. Feel free to open issues for questions or suggestions.
Documentation content is MIT licensed. OpenClaw itself is licensed under its own terms.