Tools
BeeGridX
Distributed Task Grid System - A hot-cold separation architecture based on Redis + PostgreSQL (OpenClaw Plugin)
Install
npm install
```
Configuration Example
{
"plugins": {
"load": {
"paths": [
"/path/to/BeeGridX"
]
},
"entries": {
"beegridx": {
"enabled": true,
"redis": {
"host": "<redis-host>",
"port": 6379
},
"pg": {
"url": "postgres://user:pass@localhost:5432/beegridx"
},
"watchdog": {
"enabled": true
}
},
"beegridx-channel": {
"enabled": true
}
}
}
}
README
# BeeGridX โก
A distributed task grid plugin for OpenClaw, featuring Boss-Worker architecture with Redis Pub/Sub for real-time task distribution and PostgreSQL for shared memory persistence.
## ๐ฏ Core Features
- **๐ค Task Distribution** โ Boss dispatches tasks via Redis channels, results return event-driven to original conversation
- **๐ง Intelligent Classification** โ Auto-identifies task type (heavy/light/coding) to decide dispatch or local execution
- **๐พ Shared Memory** โ PostgreSQL stores project context with Chinese full-text search, automatically pulled by Workers
- **๐บ Dead Letter Compensation** โ Watchdog monitors Redis keyspace events, automatically redistributes timeout tasks
- **โ๏ธ Unified Configuration** โ Dual plugins share one config, centralized Redis/PG/Boss/Worker parameters
## ๐๏ธ Architecture
```
๐ Boss (Agent) โ ๐ Redis Pub/Sub โ ๐ง Worker (Agent)
โ โ
๐ PostgreSQL Shared Memory ๐จ Result Event-Driven Return
```
## ๐ ๏ธ Tech Stack
- **๐ด Redis** โ Task distribution, event subscriptions, distributed locks
- **๐ PostgreSQL** โ Shared memory, full-text search, task persistence
- **๐งฉ OpenClaw Plugin SDK** โ Dual plugin architecture (Tool Plugin + Channel Plugin)
## ๐ Requirements
- OpenClaw 2026.4+
- Redis 6+
- PostgreSQL 14+
- Node.js 20+
## ๐ Quick Start
### 1. Installation
BeeGridX uses a unified plugin architecture:
```bash
# Clone repositories
git clone https://github.com/sonictx81/BeeGridX.git
# Install dependencies
cd BeeGridX
npm install
```
### 2. Configuration
Edit `~/.openclaw/openclaw.json`:
```json
{
"plugins": {
"load": {
"paths": [
"/path/to/BeeGridX"
]
},
"entries": {
"beegridx": {
"enabled": true,
"redis": {
"host": "<redis-host>",
"port": 6379
},
"pg": {
"url": "postgres://user:pass@localhost:5432/beegridx"
},
"watchdog": {
"enabled": true
}
},
"beegridx-channel": {
"enabled": true
}
}
}
}
```
### 3. Initialize Database
```bash
cd BeeGridX
node init-db.js
```
### 4. Restart OpenClaw Gateway
```bash
openclaw gateway restart
```
## ๐ Usage
### Basic Task Dispatch
```javascript
// Boss session
await beegridx_dispatch_task({
title: "Calculate Fibonacci",
type: "exec",
payload: { n: 10 }
});
```
### Auto Dispatch (Intelligent)
```javascript
// Automatically decides local vs. Worker execution
await beegridx_auto_dispatch("Analyze this project architecture");
```
### Worker Setup
```javascript
// In a separate session
await beegridx_pull_task({
workerType: "exec"
});
// After completing the task
await beegridx_finish_task({
taskId: "task-123",
result: { fibonacci: 55 },
status: "completed"
});
```
### Shared Memory
```javascript
// Store memory
await beegridx_store_memory({
content: "Project uses TypeScript and Express",
tags: ["category:tech", "importance:4"]
});
// Search memory
const results = await beegridx_search_memory({
query: "TypeScript",
limit: 10
});
```
## ๐ Documentation
- **[Architecture Guide](docs/BeeGridX_Architecture.md)** โ System design and components
- **[Protocol Specification](docs/BEEGRIDX_PROTOCOL.md)** โ Task flow and message formats
- **[Shared Memory](docs/SHARED_MEMORY.md)** โ Memory storage and search
- **[Examples](docs/EXAMPLES.md)** โ Usage examples and patterns
- **[API Reference](docs/API.md)** โ Complete tool reference
## ๐งช Testing
```bash
# Run all tests
npm test
# Run with UI
npm run test:ui
# Watch mode
npm run test:watch
# Coverage report
npm run test:coverage
```
## ๐ Performance
- **Task dispatch latency**: < 10ms (Redis)
- **Memory search**: < 5ms (PostgreSQL with GIN index)
- **Hook overhead**: < 0.01ms
- **Batch insert**: ~10ms for 10 records
## ๐ค Contributing
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
## ๐ License
MIT License โ see [LICENSE](LICENSE) for details.
## ๐บ๏ธ Roadmap
### v2.2.0 (Upcoming)
- [ ] Complete code cleanup for remaining files
- [ ] Enhanced documentation
- [ ] More usage examples
- [ ] Performance optimizations
### v3.0.0 (Future)
- [ ] TypeScript migration
- [ ] Plugin architecture upgrade
- [ ] Support for additional storage backends
- [ ] Task dependencies and cancellation
## ๐ Support
- **Issues**: [GitHub Issues](https://github.com/sonictx81/BeeGridX/issues)
- **Discussions**: [GitHub Discussions](https://github.com/sonictx81/BeeGridX/discussions)
## ๐ Credits
Built with โค๏ธ by the OpenClaw community
---
**Version**: 2.1.0 | **Last Updated**: 2026-05-03
tools
Comments
Sign in to leave a comment