# edict
**Repository Path**: shenyao/edict
## Basic Information
- **Project Name**: edict
- **Description**: https://github.com/cft0808/edict
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 2
- **Created**: 2026-03-24
- **Last Updated**: 2026-03-24
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
โ๏ธ Edict ยท Multi-Agent Orchestration
I modeled an AI multi-agent system after China's 1,300-year-old imperial governance.
Turns out, ancient bureaucracy understood separation of powers better than modern AI frameworks.
12 AI agents (11 business roles + 1 compatibility role) form the Three Departments & Six Ministries: Crown Prince triages, Planning proposes, Review vetoes, Dispatch assigns, Ministries execute.
Built-in institutional review gates that CrewAI doesn't have. A real-time dashboard that AutoGen doesn't have.
๐ฌ Demo ยท
๐ Quick Start ยท
๐๏ธ Architecture ยท
๐ Features ยท
ไธญๆ ยท
Contributing
---
## ๐ฌ Demo
๐ฅ Full demo: AI Multi-Agent collaboration with Three Departments & Six Ministries
๐ธ GIF Preview (loads faster)
Issue edict โ Crown Prince triage โ Planning โ Review โ Ministries execute โ Report back (30s)
> ๐ณ **No OpenClaw?** Run `docker run -p 7891:7891 cft0808/edict` to try the full dashboard with simulated data.
---
## ๐ก The Idea
Most multi-agent frameworks let AI agents talk freely, producing opaque results you can't audit or intervene in. **Edict** takes a radically different approach โ borrowing the governance system that ran China for 1,400 years:
```
You (Emperor) โ Crown Prince (Triage) โ Planning Dept โ Review Dept โ Dispatch Dept โ 6 Ministries โ Report Back
็ไธ ๅคชๅญ ไธญไนฆ็ ้จไธ็ ๅฐไนฆ็ ๅ
ญ้จ ๅๅฅ
```
This isn't a cute metaphor. It's **real separation of powers** for AI:
- **Crown Prince (ๅคชๅญ)** triages messages โ casual chat gets auto-replied, real commands become tasks
- **Planning (ไธญไนฆ็)** breaks your command into actionable sub-tasks
- **Review (้จไธ็)** audits the plan โ can reject and force re-planning
- **Dispatch (ๅฐไนฆ็)** assigns approved tasks to specialist ministries
- **7 Ministries** execute in parallel, each with distinct expertise
- **Data sanitization** auto-strips file paths, metadata, and junk from task titles
- Everything flows through a **real-time dashboard** you can monitor and intervene
---
## ๐ค Why Edict?
> **"Instead of one AI doing everything wrong, 9 specialized agents check each other's work."**
| | CrewAI | MetaGPT | AutoGen | **Edict** |
|---|:---:|:---:|:---:|:---:|
| **Built-in review/veto** | โ | โ ๏ธ | โ ๏ธ | **โ
Dedicated reviewer** |
| **Real-time Kanban** | โ | โ | โ | **โ
10-panel dashboard** |
| **Task intervention** | โ | โ | โ | **โ
Stop / Cancel / Resume** |
| **Full audit trail** | โ ๏ธ | โ ๏ธ | โ | **โ
Memorial archive** |
| **Agent health monitoring** | โ | โ | โ | **โ
Heartbeat detection** |
| **Hot-swap LLM models** | โ | โ | โ | **โ
From the dashboard** |
| **Skill management** | โ | โ | โ | **โ
View / Add skills** |
| **News aggregation** | โ | โ | โ | **โ
Daily digest + webhook** |
| **Setup complexity** | Med | High | Med | **Low ยท One-click / Docker** |
> **Core differentiator: Institutional review + Full observability + Real-time intervention**
๐ Why the "Review Department" is the killer feature (click to expand)
CrewAI and AutoGen agents work in a **"done, ship it"** mode โ no one checks output quality. It's like a company with no QA department where engineers push code straight to production.
Edict's **Review Department (้จไธ็)** exists specifically for this:
- ๐ **Audit plan quality** โ Is the Planning Department's decomposition complete and sound?
- ๐ซ **Veto subpar output** โ Not a warning. A hard reject that forces re-planning.
- ๐ **Mandatory rework loop** โ Nothing passes until it meets standards.
This isn't an optional plugin โ **it's part of the architecture**. Every command must pass through Review. No exceptions.
This is why Edict produces reliable results on complex tasks: there's a mandatory quality gate before anything reaches execution. Emperor Taizong figured this out 1,300 years ago โ **unchecked power inevitably produces errors**.
---
## โจ Features
### ๐๏ธ Twelve-Department Agent Architecture
- **Crown Prince** (ๅคชๅญ) message triage โ auto-reply casual chat, create tasks for real commands
- **Three Departments** (Planning ยท Review ยท Dispatch) for governance
- **Seven Ministries** (Finance ยท Docs ยท Engineering ยท Compliance ยท Infrastructure ยท HR + Briefing) for execution
- Strict permission matrix โ who can message whom is enforced
- Each agent: own workspace, own skills, own LLM model
- **Data sanitization** โ auto-strips file paths, metadata, invalid prefixes from titles/remarks
### ๐ Command Center Dashboard (10 Panels)
| Panel | Description |
|-------|------------|
| ๐ **Edicts Kanban** | Task cards by state, filters, search, heartbeat badges, stop/cancel/resume |
| ๐ญ **Department Monitor** | Pipeline visualization, distribution charts, health cards |
| ๐ **Memorial Archive** | Auto-generated archives with 5-phase timeline |
| ๐ **Edict Templates** | 9 presets with parameter forms, cost estimates, one-click dispatch |
| ๐ฅ **Officials Overview** | Token leaderboard, activity stats |
| ๐ฐ **Daily Briefing** | Auto-curated news, subscription management, Feishu push |
| โ๏ธ **Model Config** | Per-agent LLM switching, automatic Gateway restart |
| ๐ ๏ธ **Skills Config** | View installed skills, add new ones |
| ๐ฌ **Sessions** | Live session monitoring with channel labels |
| ๐ฌ **Court Ceremony** | Immersive daily opening animation with stats |
---
## ๐ผ๏ธ Screenshots
### Edicts Kanban

๐ธ More screenshots
### Agent Monitor

### Task Detail

### Model Config

### Skills

### Officials

### Sessions

### Memorials Archive

### Command Templates

### Daily Briefing

### Court Ceremony

---
## ๐ Quick Start
### Docker
```bash
docker run -p 7891:7891 cft0808/edict
```
Open http://localhost:7891
### Full Install
**Prerequisites:** [OpenClaw](https://openclaw.ai) ยท Python 3.9+ ยท macOS/Linux
```bash
git clone https://github.com/cft0808/edict.git
cd edict
chmod +x install.sh && ./install.sh
```
The installer automatically:
- Creates workspaces for all departments (`~/.openclaw/workspace-*`, including Crown Prince/HR/Briefing)
- Writes SOUL.md personality files for each department
- Registers agents + permission matrix in `openclaw.json`
- Initializes data directory + first sync
- Restarts Gateway
### Launch
```bash
# Terminal 1: Data sync loop (every 15s)
bash scripts/run_loop.sh
# Terminal 2: Dashboard server
python3 dashboard/server.py
# Open browser
open http://127.0.0.1:7891
```
> ๐ See [Getting Started Guide](docs/getting-started.md) for detailed walkthrough.
---
## ๐๏ธ Architecture
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ Emperor (You) โ
โ Feishu ยท Telegram ยท Signal โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ
โ Issue edict
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโ
โ ๐ Crown Prince (ๅคชๅญ) โ
โ Triage: chat โ reply / cmd โ task โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ
โ Forward edict
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโ
โ ๐ Planning Dept (ไธญไนฆ็) โ
โ Receive โ Plan โ Decompose โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ
โ Submit for review
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโ
โ ๐ Review Dept (้จไธ็) โ
โ Audit โ Approve / Reject ๐ซ โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ
โ Approved โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโ
โ ๐ฎ Dispatch Dept (ๅฐไนฆ็) โ
โ Assign โ Coordinate โ Collect โ
โโโโโฌโโโโโโโฌโโโโโโโฌโโโโโโโฌโโโโโโโฌโโโโ
โ โ โ โ โ
โโโโโโโผโ โโโโโผโโโโ โโผโโโโโโ โโโโโผโโ โโผโโโโโโ
โ๐ฐ Fin.โ โ๐ Docsโ โโ๏ธ Eng.โ โโ๏ธ Lawโ โ๐ง Opsโ
โ ๆท้จ โ โ ็คผ้จ โ โ ๅ
ต้จ โ โ ๅ้จ โ โ ๅทฅ้จ โ
โโโโโโโโ โโโโโโโโ โโโโโโโโ โโโโโโโ โโโโโโโโ
โโโโโโโโ
โ๐ HR โ
โ ๅ้จ โ
โโโโโโโโ
```
### Agent Roles
| Dept | Agent ID | Role | Expertise |
|------|----------|------|-----------|
| ๐ **Crown Prince** | `taizi` | Triage, summarize | Chat detection, intent extraction |
| ๐ **Planning** | `zhongshu` | Receive, plan, decompose | Requirements, architecture |
| ๐ **Review** | `menxia` | Audit, gatekeep, veto | Quality, risk, standards |
| ๐ฎ **Dispatch** | `shangshu` | Assign, coordinate, collect | Scheduling, tracking |
| ๐ฐ **Finance** | `hubu` | Data, resources, accounting | Data processing, reports |
| ๐ **Documentation** | `libu` | Docs, standards, reports | Tech writing, API docs |
| โ๏ธ **Engineering** | `bingbu` | Code, algorithms, checks | Development, code review |
| โ๏ธ **Compliance** | `xingbu` | Security, compliance, audit | Security scanning |
| ๐ง **Infrastructure** | `gongbu` | CI/CD, deploy, tooling | Docker, pipelines |
| ๐ **HR** | `libu_hr` | Agent management, training | Registration, permissions |
| ๐
**Briefing** | `zaochao` | Daily briefing, news | Scheduled reports, summaries |
### Permission Matrix
| From โ \ To โ | Prince | Planning | Review | Dispatch | Ministries |
|:---:|:---:|:---:|:---:|:---:|:---:|
| **Crown Prince** | โ | โ
| | | |
| **Planning** | โ
| โ | โ
| โ
| |
| **Review** | | โ
| โ | โ
| |
| **Dispatch** | | โ
| โ
| โ | โ
all |
| **Ministries** | | | | โ
| |
### State Machine
```
Emperor โ Prince Triage โ Planning โ Review โ Assigned โ Executing โ โ
Done
โ โ โ
โโโ Veto โโโ Blocked โโ
```
---
## ๐ Project Structure
```
edict/
โโโ agents/ # 12 agent personality templates (SOUL.md)
โ โโโ taizi/ # Crown Prince (triage)
โ โโโ zhongshu/ # Planning Dept
โ โโโ menxia/ # Review Dept
โ โโโ shangshu/ # Dispatch Dept
โ โโโ hubu/ libu/ bingbu/ # Finance / Docs / Engineering
โ โโโ xingbu/ gongbu/ # Compliance / Infrastructure
โ โโโ libu_hr/ # HR Dept
โ โโโ zaochao/ # Morning Briefing
โโโ dashboard/
โ โโโ dashboard.html # Dashboard (single file, zero deps, works out of the box)
โ โโโ dist/ # Pre-built React frontend (included in Docker image)
โ โโโ server.py # API server (stdlib, zero deps)
โโโ scripts/ # Data sync & automation scripts
โ โโโ kanban_update.py # Kanban CLI with data sanitization (~300 lines)
โ โโโ ... # fetch_morning_news, sync, screenshots, etc.
โโโ tests/ # E2E tests
โ โโโ test_e2e_kanban.py # Kanban sanitization tests (17 assertions)
โโโ data/ # Runtime data (gitignored)
โโโ docs/ # Documentation + screenshots
โโโ install.sh # One-click installer
โโโ LICENSE # MIT
```
---
## ๐ง Technical Highlights
| | |
|---|---|
| **React 18 Frontend** | TypeScript + Vite + Zustand, 13 components |
| **stdlib Backend** | `server.py` on `http.server`, zero dependencies |
| **Agent Thinking Visible** | Real-time display of agent thinking, tool calls, results |
| **One-click Install** | Workspace creation to Gateway restart |
| **15s Auto-sync** | Live data refresh with countdown |
| **Daily Ceremony** | Immersive opening animation |
---
## ๐บ๏ธ Roadmap
> Full roadmap with contribution opportunities: [ROADMAP.md](ROADMAP.md)
### Phase 1 โ Core Architecture โ
- [x] Twelve-department agent architecture + permissions
- [x] Crown Prince triage layer (chat vs task auto-routing)
- [x] Real-time dashboard (10 panels)
- [x] Task stop / cancel / resume
- [x] Memorial archive (5-phase timeline)
- [x] Edict template library (9 presets)
- [x] Court ceremony animation
- [x] Daily news + Feishu webhook push
- [x] Hot-swap LLM models + skill management
- [x] Officials overview + token stats
- [x] Session monitoring
- [x] Edict data sanitization (title/remark cleaning, dirty data rejection)
- [x] Duplicate task overwrite protection
- [x] E2E kanban tests (17 assertions)
### Phase 2 โ Institutional Depth ๐ง
- [ ] Imperial approval mode (human-in-the-loop)
- [ ] Merit/demerit ledger (agent scoring)
- [ ] Express courier (inter-agent message visualization)
- [ ] Imperial Archives (knowledge base + citation)
### Phase 3 โ Ecosystem
- [ ] Docker Compose + demo image
- [ ] Notion / Linear adapters
- [ ] Annual review (yearly performance reports)
- [ ] Mobile responsive + PWA
- [ ] ClawHub marketplace listing
---
## ๐ค Contributing
All contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md)
- ๐จ **UI** โ themes, responsiveness, animations
- ๐ค **New agents** โ specialized roles
- ๐ฆ **Skills** โ ministry-specific packages
- ๐ **Integrations** โ Notion ยท Jira ยท Linear ยท GitHub Issues
- ๐ **i18n** โ Japanese ยท Korean ยท Spanish
- ๐ฑ **Mobile** โ responsive, PWA
---
## ๏ฟฝ Examples
The `examples/` directory contains real end-to-end use cases:
| Example | Command | Departments |
|---------|---------|-------------|
| [Competitive Analysis](examples/competitive-analysis.md) | "Analyze CrewAI vs AutoGen vs LangGraph" | PlanningโReviewโFinance+Engineering+Docs |
| [Code Review](examples/code-review.md) | "Review this FastAPI code for security issues" | PlanningโReviewโEngineering+Compliance |
| [Weekly Report](examples/weekly-report.md) | "Generate this week's engineering team report" | PlanningโReviewโFinance+Docs |
Each case includes: Full command โ Planning proposal โ Review feedback โ Ministry outputs โ Final report.
---
## ๐ License
[MIT](LICENSE) ยท Built by the [OpenClaw](https://openclaw.ai) community
---
## ๐ฎ WeChat ยท Behind the Scenes
> *In ancient China, the โDวbร oโ (imperial gazette) delivered edicts across the empire. Today we have a WeChat account.*
Scan to follow ยท cft0808
What youโll find:
- ๐๏ธ Architecture deep-dives โ how 12 agents achieve separation of powers
- ๐ฅ War stories โ when agents fight, burn tokens, or go on strike
- ๐ก Token-saving tricks โ run the full pipeline at 1/10 the cost
- ๐ญ Behind the SOUL.md โ how to write prompts that make AI agents stay in character
---
## โญ Star History
[](https://star-history.com/#cft0808/edict&Date)
---
โ๏ธ Governing AI with the wisdom of ancient empires
ไปฅๅคๅถๅพกๆฐๆ๏ผไปฅๆบๆ
ง้ฉพ้ฉญ AI