~/archive/frameworks/kytrex.sys

KYTREX — Future Thinking Engine

ACTIVEv0.9.0

A constraint-driven graph system that uses LLMs as proposal generators while enforcing structural rules outside the model

core_thesis.log[CLASSIFIED]
CORE_THESIS

An LLM is a generator for candidate hypotheses — it produces plausible causal chains like "A leads to B". But plausible is not the same as structurally valid. Without external enforcement, LLM-generated graphs inevitably produce cycles, abstraction jumps, dangling references, and combinatorial explosions. These are not bugs — they are predictable system effects.

The solution: separate generation from validation. The LLM proposes, the system enforces physics.

LLM = PROPOSAL GENERATOR

Generates candidate nodes, edges, and relationships. Optimizes for semantic plausibility. Has no global view of graph state.

SYSTEM = PHYSICS ENFORCER

Enforces type rules, cycle constraints, referential integrity, and branching budgets. Machine-checkable, deterministic, non-negotiable.

failure_modes.sys[4 MODES]
FAILURE_MODES

Four predictable system effects when generating graph structures from LLM output — and how KYTREX addresses each one

[FM-001]COMBINATORIAL EXPLOSION
PROBLEM:

With branching factor b and depth d, node count grows as b^d. A graph that starts clean becomes an unreadable hairball within 3-4 expand steps.

KYTREX:

Progressive Disclosure: generate only 1-hop per interaction. The user pays for complexity with explicit clicks. Combined with MMR-based pruning to maximize relevant novelty per expand.

[FM-002]GRANULARITY MISMATCH
PROBLEM:

LLMs recognize semantic proximity but don't enforce abstraction layers. A macro-trend like "AI Disruption" gets directly connected to a micro-feature like "dark mode toggle" — a classic abstraction jump.

KYTREX:

Typed Property Graph with strict ontology: 6 node types across 3 layers (Macro/Meso/Micro), 7 edge types. Connections only between adjacent layers — cross-layer shortcuts require bridging nodes.

[FM-003]CYCLIC PARADOXES
PROBLEM:

"More AI → fewer jobs → crisis → more automation → more AI" — plausible as a feedback loop, but catastrophic for forward propagation. Recursive traversal becomes an infinite loop.

KYTREX:

DAG enforcement as operational constraint. Cycle detection via DFS before any edge is committed. Feedback loops are flagged and isolated — valid in Systems Thinking, but handled as a separate simulation layer.

[FM-004]JSON STRUCTURAL BREAKS
PROBLEM:

Even with Structured Outputs, LLMs produce semantically broken graphs: edges pointing to non-existent nodes, duplicate IDs, type violations. Syntactic correctness ≠ structural validity.

KYTREX:

Accept-Validate-Repair pipeline: Zod schema check → referential integrity pass (remove/flag edges with unknown IDs) → optional repair call. The UI only sees validated structures.

ontology_map.sys[STATIC]
ONTOLOGY_MAP

Three-layer hierarchy with 6 node types and 7 edge types

[MACRO]macro-trendpolicy[MESO]industry-shiftevent[MICRO]business-modelproduct-feature
BRIDGING_RULE

Macro nodes cannot directly connect to Micro nodes — a Meso bridge is required

INVALID
macro-trend──✗──→product-feature
VALID
macro-trendindustry-shiftproduct-feature
NODE_TYPES
MACRO_TREND

Large-scale technological or societal shift

INDUSTRY_SHIFT

Market-level structural change

BUSINESS_MODEL

Monetization pattern or value architecture

PRODUCT_FEATURE

Specific capability or deliverable

EVENT

Time-bound occurrence with cascading effects

POLICY

Regulatory or governance intervention

EDGE_TYPES
CAUSESDirect causal relationship
ENABLESCreates conditions for target to emerge
CONSTRAINSLimits or restricts the target
SUBSTITUTESReplaces or displaces the target
AMPLIFIESStrengthens or accelerates the target
CONTRADICTSOpposes or undermines the target
REQUIRESTarget cannot exist without source
graph_explorer.svg[INTERACTIVE]
GRAPH_EXPLORER

Progressive Disclosure in action: expand 1-hop at a time. Each click reveals children — the user controls complexity.

NODES: 6EDGES: 6EXPANDED: 1
[MACRO][MESO][MICRO]causesenablescausesamplifiesconstrainsamplifiesMACRO TRENDAI DisruptionINDUSTRY SHIFTAutomatedContent Creation+INDUSTRY SHIFTAI-native SaaSWave+POLICYRegulatory Pushfor AI Transpare..+MACRO TRENDOpen-SourceModel Commoditiz..+EVENTInference CostCollapse
Click node to expand
LEGEND
macro-trend
industry-shift
business-model
product-feature
event
policy
constraint_validator.sys[INTERACTIVE]
CONSTRAINT_VALIDATOR

Step-through validation pipeline — see how raw LLM output gets checked and repaired

INPUT
ONT
CYC
REF
OUTPUT
RAW_LLM_OUTPUT
{
nodes: [
{ x1, macro-trend, "Quantum Computing Boom", d:0 }
{ x2, product-feature, "Post-Quantum Encryption", d:2 }
{ x3, event, "Crypto Market Crash", d:1 }
], edges: [
{ x1x2, enables }
{ x2x3, causes }
{ x3x1, amplifies }
{ x2x99, requires }
]
}
STEP 1: ONTOLOGY CHECK

Verify all node types and edge-type/node-type combinations are valid

STEP 2: CYCLE DETECTION

Run DFS to ensure the graph remains a DAG

STEP 3: REFERENTIAL INTEGRITY

Confirm all edge endpoints reference existing nodes

process_flow.dat[CLASSIFIED]
PROCESS_FLOW
┌─────────────────┐
│   USER INPUT    │
│   (scenario)    │
└────────┬────────┘
         │
         ▼
┌─────────────────┐
│  LLM GENERATOR  │
│  ══════════════ │
│  Propose Nodes  │
│  Propose Edges  │
│  Suggest Types  │
└────────┬────────┘
         │
         ▼
┌─────────────────┐
│   CONSTRAINT    │
│   VALIDATOR     │
│  ══════════════ │
│  Ontology Check │
│  Cycle Detect   │
│  Ref Integrity  │
└────────┬────────┘
         │
    ┌────┴────┐
    ▼         ▼
┌────────┐ ┌────────┐
│ GRAPH  │ │SCENARIO│
│ STATE  │ │ OUTPUT │
└────────┘ └────────┘