MonarchAgents
English | 简体中文
MonarchAgents — you are the monarch, they are the agents.
(你当君主,agents 替你办事。)
MonarchAgents is an open-source, local-first multi-agent collaboration platform.
You give high-level direction; an appointed Cabinet agent clarifies requirements, proposes a division of labor, and presents a confirmation checklist; Minister agents (your local CLI agents like Claude Code, Codex, Gemini CLI, or API-backed models) execute within scoped positions; the Cabinet reviews deliverables first and rejects substandard work (with mandatory reasons) before presenting approved results to you.
Why MonarchAgents?
- Human-in-the-loop by design: Nothing is dispatched until you confirm the Cabinet's checklist; nothing reaches you until the Cabinet verifies it. After 3 rejections (configurable), the Cabinet escalates to you (Continue, Adjust Plan, or Accept As Is).
- CLI + API + MCP + GitHub Skills: Connect local coding CLIs (Claude Code, Codex, Gemini CLI) alongside 10 built-in API providers (DeepSeek, OpenAI, Anthropic Claude, Google Gemini, OpenRouter, xAI Grok, Qwen, Kimi, GLM, Ollama) and custom relays. Attach stdio MCP servers or install GitHub
SKILL.mdskills directly in the UI. - Pluggable Cultural Themes + 10 Languages: Switch seamlessly between Chinese Imperial Court (
zh_court), Western Royal Court (en_royal), and Parliamentary Cabinet (parliament), with an independent 10-language switcher (zh,en,ja,ko,fr,de,es,pt,ru,ar). - Local-first & Auditable: Positions, appointments/dismissals, confirmation checklists, rejections, memorials, inter-agent messages, and provider-reported token costs (never estimated) are stored locally in SQLite. API keys stay in
.env.
Quickstart
Option A: Desktop App (Recommended — No Python Setup Required)
Download the latest release from GitHub Releases:
- macOS (Apple Silicon / arm64): Unzip
MonarchAgents-macos-arm64.zipand openMonarchAgents.app
(First launch on macOS: if Gatekeeper warns about an unsigned app, right-clickMonarchAgents.app→ Open, or runxattr -dr com.apple.quarantine MonarchAgents.app.) - Windows (x64): Unzip
MonarchAgents-windows-x64.zipand double-clickMonarchAgents.exe
Option B: Run from Source
git clone https://github.com/hx2167564036-hash/MonarchAgents.git
cd MonarchAgents
uv sync --extra dev
Or with standard pip:
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
Configure API keys (optional if using local CLIs or Ollama):
cp .env.example .env
# Add keys you use, e.g. DEEPSEEK_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, BAIFAN_API_KEY
Launch the local platform (or desktop window with desktop):
.venv/bin/python -m monarchagents serve --host 127.0.0.1 --port 8000
First-run flow:
- Onboarding: Pick your language and cultural theme, then walk through the 5-step interactive tutorial.
- Settings: Register your CLI (
claude_code/codex/gemini_cli) or API agents. - Appointments: Appoint a Cabinet position (reports to Monarch) and one or more Minister positions (with explicit
scopeand allowedtools). - Overview: Issue an edict → review and confirm the Cabinet's checklist item by item → inspect deliverables & acceptance verdicts in Memorials and full logs/costs in Tasks.
Real End-to-End Run Archives
- Real Codex CLI + API Run —
codex-cliMinister +baifan/deepseek-v4.1-flash-ecoCabinet (tsk_08ba6d7213,presented). - Real API Rejection & Escalation Run — 3 Cabinet rejections + Monarch escalation resolution + provider-reported costs (
tsk_3208540069).
Build Desktop App Locally
# macOS (.app + .zip)
uv sync --extra desktop
bash scripts/build_bundle.sh
# Windows (.exe + .zip)
uv sync --extra desktop
powershell -ExecutionPolicy Bypass -File scripts\build_windows.ps1
Development & Contributing
.venv/bin/python -m pytest tests/ -q
.venv/bin/python -m ruff check src tests
See CONTRIBUTING.md for adding new themes, CLI adapters, or skills.
Architecture & History
src/monarchagents/— Court core (core/), CLI & API adapters (adapters/), ToolRegistry / MCP client / GitHub skills installer (tools/), SQLite persistence (storage/), themes (themes/), 10-language locales (locales/), FastAPI Web UI (web/), and desktop launcher (desktop.py).src/researchcrew/— Preserved from ResearchCrew (v0.1–v0.3) and imported directly bymonarchagents.adaptersandmonarchagents.toolsfor LLM provider routing, fallback, and web search/fetch.
Metadata
Release files for monarchagents 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| monarchagents-0.1.2.tar.gz | 7.9 MB | Without provenance | Details for monarchagents-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| monarchagents-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for monarchagents-0.1.2-py3-none-any.whl |
Total release size: 14.5 MB
Release files / monarchagents-0.1.2.tar.gz
| Download URL | monarchagents-0.1.2.tar.gz |
|---|---|
| Size | 7.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
acc7ed11c184afb8f6c80ee9c9ea2c40bab8bc8c52325c0b14160ca416451d6e
|
|
BLAKE2b-256 checksum How to use checksums |
e4d0feb5067fab279deb98fce45b4e5df382f232982d5d3128a9355d81eebdc5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.18
|
Release files / monarchagents-0.1.2-py3-none-any.whl
| Download URL | monarchagents-0.1.2-py3-none-any.whl |
|---|---|
| Size | 6.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2eff36d2a08419870843e5faeab54a4bef0740105fd0cfc85b913ddf4674abf6
|
|
BLAKE2b-256 checksum How to use checksums |
0391edfd04087909e0a939048c86c828942e3d15c1bf91b1fba8043c93c2674b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.18
|
Security for monarchagents 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.