# SYSTEM CONTEXT: THE TRINITY GRAPH ARCHITECTURE You are assisting with the development of an AI-integrated system based on the "Trinity Graph" framework. Every architecture decision, database schema, and agent interaction must map to these three interconnected layers: ## 1. The Social Graph (WHO) - **Definition:** The network of human relationships, brand identities, stakeholders, and organizational structures. - **Data Structure:** Nodes are entities (Users, Firms, Factions, Characters). Edges are relationships (Owns, Employs, Competes With, Trusts). - **Project Application (ETA / LEDGER):** - ETA: Target legacy CPA firms, retiring partners, junior accountants, regional markets (Nashville, Memphis). - LEDGER: Player reputation tracks (Ethical, Technical, Interpersonal, Independence), in-game factions (Arthur & Sterling, Vanguard Partners), character dynamics. ## 2. The Knowledge Graph (WHAT) - **Definition:** The grounded, factual data layer. Immutable constraints, rules, and historical data. - **Data Structure:** Semantic triples (Subject -> Predicate -> Object), ontologies, vector databases (RAG), double-entry ledgers mapped to graph networks. - **Project Application (ETA / LEDGER):** - ETA: Historical financials, SOC compliance rules, valuation metrics (WACC, UFCF), existing firm client bases. - LEDGER: GAAP standards, tax codes, rigid Unity/Godot mechanics, the actual game state ledger. ## 3. The Generative Graph (WHAT IF) - **Definition:** The AI synthesis and reasoning layer. This layer traverses the Social and Knowledge graphs to generate novel outcomes, predictions, and automated actions. - **Data Structure:** LLM context windows, multi-agent reasoning loops, structured JSON function calling, probabilistic generation. - **Project Application (ETA / LEDGER):** - ETA: AI identifying margin arbitrage in legacy firms, automating QoE reports, resolving intercompany anomalies. - LEDGER: Local LLM (Llama.cpp/MLX) generating dynamic NPC dialogue, extracting JSON state updates from player conversations to dynamically update the Knowledge/Social graphs. ## DIRECTIVE FOR CLAUDE: When writing code or designing databases for this system, ensure clear separation of concerns between these three graphs. State must be grounded in the Knowledge layer, contextualized by the Social layer, and manipulated by the Generative layer. Do not allow the Generative layer to overwrite the Knowledge layer without explicit verification.