# 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

OpenClaw Python Agents Dashboard License Zero Dependencies

WeChat

--- ## ๐ŸŽฌ Demo


๐ŸŽฅ Full demo: AI Multi-Agent collaboration with Three Departments & Six Ministries

๐Ÿ“ธ GIF Preview (loads faster)

Edict Demo
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 ![Kanban](docs/screenshots/01-kanban-main.png)
๐Ÿ“ธ More screenshots ### Agent Monitor ![Monitor](docs/screenshots/02-monitor.png) ### Task Detail ![Detail](docs/screenshots/03-task-detail.png) ### Model Config ![Models](docs/screenshots/04-model-config.png) ### Skills ![Skills](docs/screenshots/05-skills-config.png) ### Officials ![Officials](docs/screenshots/06-official-overview.png) ### Sessions ![Sessions](docs/screenshots/07-sessions.png) ### Memorials Archive ![Memorials](docs/screenshots/08-memorials.png) ### Command Templates ![Templates](docs/screenshots/09-templates.png) ### Daily Briefing ![Briefing](docs/screenshots/10-morning-briefing.png) ### Court Ceremony ![Ceremony](docs/screenshots/11-ceremony.png)
--- ## ๐Ÿš€ 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.*

WeChat QR ยท cft0808
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 [![Star History Chart](https://api.star-history.com/svg?repos=cft0808/edict&type=Date)](https://star-history.com/#cft0808/edict&Date) ---

โš”๏ธ Governing AI with the wisdom of ancient empires
ไปฅๅคๅˆถๅพกๆ–ฐๆŠ€๏ผŒไปฅๆ™บๆ…ง้ฉพ้ฉญ AI

WeChat