cyber-jinnang
v1.0.2
Published
赛博锦囊 (Cyber-Stratagem) - 极简主义 AI 朝廷决策引擎
Readme
Cyber-JinNang (English alias: Cyber-Stratagem) is a minimalist, high-performance Multi-Agent orchestration engine inspired by the Tang Dynasty's "Three Departments and Six Ministries" bureaucracy and Stafford Beer's Viable System Model (VSM).
It is designed to replace traditional chatbot interactions with an algorithmic bureaucracy. It dynamically decomposes complex user intents into parallel execution blueprints, routes them to specialized executor pods, and synthesizes the results into actionable strategic guidelines.
🌟 Core Features
- Algorithmic Bureaucracy (Multi-Agent Routing): A strict, hierarchical architecture. The Oracle (神谕核) plans, the Aegis (神盾核) audits, the Pods (执行簇) execute in parallel, and the Nexus (枢纽核) synthesizes.
- Type-Safe State Machine: Built entirely on strong TypeScript interfaces (
@sinclair/typebox). Control flow is governed by deterministic JSON schemas rather than fragile prompt engineering. - Zero-Cost System Reflection: Implements a self-evolving memory loop. The Nexus agent simultaneously summarizes reports and extracts optimal topological SOPs (System Reflection) in a single LLM pass, injecting historical heuristics into future Oracle prompts without adding latency or API costs.
- Interactive TUI Dashboard: Features a cinematic, dual-line streaming terminal UI. Real-time visualization of concurrent high-frequency LLM inference streams without terminal wrapping artifacts.
- Provider Agnostic: Built on the
@mariozechner/pi-aiabstraction, allowing seamless switching between LLM providers (DeepSeek, Qwen, MiniMax, OpenAI) via simple environment variables.
🏗️ System Architecture
graph TD
User(["User Intent"]) --> Oracle["Oracle: Strategic Planner"]
subgraph Control Layer [Control Layer]
Oracle -->|JSON Blueprint| Aegis{"Aegis: Auditor"}
Aegis -->|Veto| Oracle
end
subgraph Execution Layer [Concurrent Pods]
Aegis -->|Approve| P1["Alpha: Intelligence Scout"]
Aegis -->|Approve| P2["Beta: Quantitative Quant"]
Aegis -->|Approve| P3["Gamma: Devil's Advocate"]
end
subgraph Synthesis Layer [Synthesis Layer]
P1 --> Nexus["Nexus: Synthesizer"]
P2 --> Nexus
P3 --> Nexus
end
Nexus -->|1. Actionable Guidelines| User
Nexus -->|2. System Reflection| Memory[("cyber_memory.json")]
Memory -.->|Experience Injection| Oracle🚀 Getting Started
Prerequisites
- Node.js >= 20.0.0
- npm or pnpm
Installation
Global Installation (Recommended)
npm install -g cyber-jinnang
cyber-jinnangLocal Development
git clone https://github.com/Gabriel017yy/Cyber-JinNang.git
cd cyber-jinnang
npm installConfiguration
On first run (or by typing /login), a built-in interactive wizard will guide you to configure your LLM Provider and API keys, saving them securely to a local .env file.
Usage
Run the CLI orchestrator:
cyber-jinnang(Or npm start if running locally)
🧠 Design Philosophy
- Occam's Razor: "如无必要,勿增实体" (Do not multiply entities beyond necessity). No redundant agents, no unnecessary LLM loops. Features like System Reflection piggyback on existing LLM calls to achieve zero-cost evolution.
- Determinism over Magic: LLMs are unpredictable. Cyber-Stratagem cages them using strict JSON schemas and validation loops. If an agent outputs malformed data, it is automatically corrected or soft-failed without crashing the system.
- Actionable Outputs: Moves beyond binary "Approve/Reject" recommendations. Outputs actionable, multi-perspective strategic guidelines ("锦囊三策").
🗺️ Roadmap
- [x] Phase 1: Static Bureaucratic Hierarchy (Oracle -> Pods -> Nexus)
- [x] Phase 2: Safety & Auditing (Aegis integration)
- [x] Phase 3: Dynamic Tool Calling & Concurrent Actuators
- [x] Phase 4: Persistent System Reflection & Zero-Cost Memory Fusion
- [ ] Phase 5: Decoupling TUI and Engine (Preparation for Web/WeChat integrations)
🤝 Acknowledgements
This project is built upon the robust multi-agent orchestration framework pi-mono created by Mario Zechner. The philosophical underpinnings draw heavily from cybernetics, specifically the Viable System Model (VSM).
