Claude Skill
voocel/openclaw-mini
OpenClaw-mini replicates core OpenClaw architecture for building Claude AI agents with session management, task queues, memory search, and extensible Claude Skill integration in TypeScript.
Overview
Repository
Install this Skill
git clone git@github.com:voocel/openclaw-mini.gitRegistry
Summary
OpenClaw-mini is a minimal reproduction of the OpenClaw core architecture, implementing key components for building AI agents with Claude. It provides session management, task orchestration, memory search, and extensible skill integration.
OpenClaw 核心架构的极简复现,涵盖 sessionKey 会话域、队列串行化、工具化记忆检索、按需上下文加载、可扩展 Claude Skill 与主动心跳唤醒机制
Key features
- SessionKey-based conversation domain management
- Queue-based serialized task execution
- Tool-based memory search and retrieval
- On-demand context loading
- Extensible Claude Skill integration
- Active heartbeat wake-up mechanism
Use cases
- Building conversational AI agents with Claude
- Implementing task queues for AI workflows
- Creating memory-augmented AI assistants
- Developing extensible AI skill systems
- Managing multi-session AI applications
README excerpt
# OpenClaw Mini **OpenClaw 核心架构的精简复现,用于学习 AI Agent 的系统级设计。** > "没有记忆的 AI 只是函数映射,有记忆 + 主动唤醒的 AI,才是会演化的'生命系统'" ## 项目定位 目标: - 用一个小而完整的项目解释 OpenClaw 内核真正重要的设计点 - 让读者能同时读懂 CLI、Agent Loop、Session、Context、Gateway 四条主线 - 保留“为什么这么设计”的注释,而不只是给出能跑的代码 非目标: - 不追求和 OpenClaw 主仓库 1:1 API 兼容 - 不覆盖所有 channel、provider、插件和运维能力 - 不把生产环境里的所有防护、权限和兼容性细节都搬过来 仓库: - GitHub: `https://github.com/voocel/openclaw-mini` - npm 包名: `openclaw-mini` ## 快速开始 ```bash git clone git@github.com:voocel/openclaw-mini.git cd openclaw-mini pnpm install cp .env.example .env ``` 在 `.env` 里至少配置一个可用的模型 Key,然后先跑最小校验: ```bash pnpm test pnpm dev ``` 想直接看 Gateway 的 ACK-then-stream 链路: ```bash pnpm example:gateway ``` ## 安装与开发 作为独立项目开发: ```bash pnpm install pnpm test pnpm build ``` 本地 CLI: ```bash pnpm dev pnpm gateway pnpm gateway:connect ``` 发布前自检: ```bash pnpm test pnpm build pnpm pack:check ``` ## 为什么做这个项目 网上大多数 Agent 教程只讲 Agent Loop: ```python while tool_calls: response = llm.generate(messages) for tool in tools: result = tool.execute() messages.append(result) ``` **这不是真正的 Agent 架构。** 一个生产级 Agent 需要的是"系统级最佳实践"。 OpenClaw 是一个超 43w 行的复杂 Agent 系统,本项目从中提炼出核心设计与最小实现,帮助你理解: - Agent Loop 的双层循环与 EventStream 事件流 - 会话持久化与上下文管理(裁剪 + 摘要压缩) - 长期记忆、技能系统、主动唤醒的真实实现 - 多 Provider 适配(Anthropic / OpenAI / Google / Groq 等 22+ 提供商) ## 模块分层 本项目按学习价值分为四层,建议按 **核心 → 扩展 → 网关 → 工程** 的顺序阅读: ``` ┌─────────────────────────────────────────────────────────────┐ │ [网关层] Gateway │ │ WebSocket RPC 网关,让 Agent 从 CLI 直连升级为网络服务 │ │ │ │ Protocol (帧协议) · Server (广播+握手+路由) │ │ Client (重连+心跳) · Handlers (RPC 方法) │ ├────────────────────────────────────────────