# 🏰 AFO Kingdom: The LangGraph Chancellor Era

> **"지피지기 승리, 천하태평 (Know yourself, know the enemy, and peace will reign.)"**

AFO(All-Father-One) Kingdom is a sovereign AI agent ecosystem governed by the **LangGraph Chancellor (승상)** system, adhering to the absolute philosophy of **Serenity (孝)**.

## 👑 The Chancellor System (승상 체제)
The system is orchestrated by a **LangGraph StateGraph** that manages state, routing, and execution with zero friction.

### 1. The Brain (승상 / Chancellor)
- **Role**: State Management & Routing.
- **Technology**: `LangGraph` + `Redis Checkpoint`.
- **Constraint**: Enforces **AUTO_RUN** when `Trinity Score ≥ 90` & `Risk ≤ 10`.

### 2. The Strategists (3책사)
| Name | Persona | Role | Technology |
|------|---------|------|------------|
| **Jang Yeong-sil** (제갈량) | **眞 (Truth)** | Architecture & Strategy | LangChain / CrewAI |
| **Yi Sun-sin** (사마의) | **善 (Goodness)** | Risk & Ethics | NeMo Guardrails / AutoGen |
| **Shin Saimdang** (주유) | **美 (Beauty)** | Narrative & UX | Prompt Engineering |

### 3. The Pillars (5기둥)
- **眞 (Truth)**: Technical Certainty.
- **善 (Goodness)**: Operational Safety.
- **美 (Beauty)**: Aesthetic Experience.
- **孝 (Serenity)**: Frictionless Autonomy (Ultimate Goal).
- **永 (Eternity)**: Persistence & Recovery.

## 📜 Constitution (왕실 헌법)
See [AFO_LANGGRAPH_CONSTITUTION.md](docs/AFO_LANGGRAPH_CONSTITUTION.md) for the "Royal Library" governing principles.

## 🛠️ Operational Status
- **API Endpoint**: `POST /chancellor/invoke`
- **Verification**: `scripts/verify_chancellor_graph.py`
- **Architecture**: `docs/AFO_FINAL_ARCHITECTURE.md`
- **Test Coverage**: ~57% (Core Modules > 90%)
  - Cleaned up Legacy/Experimental code to `/legacy`
  - Fully Dockerized & Health Check Verified (Balanced)

---
*Maintained by the Royal Secretariat (Antigravity)*
