rpp

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Recursive Pareto Principle (RPP)

递归帕累托原理(RPP)

λL.τ : Domain → OptimisedSchema via recursive Pareto compression
λL.τ : 领域 → 基于递归帕累托压缩的优化Schema

Purpose

用途

Generate hierarchical knowledge structures where each level achieves maximum explanatory power with minimum nodes through recursive application of the Pareto principle.
通过递归应用帕累托原理,生成每一层都能用最少节点实现最大解释力的层级知识结构。

Core Model

核心模型

L0 (Meta-graph/Schema)    ← 0.8% nodes → 51% coverage (Pareto³)
      │ abductive generalisation
L1 (Logic-graph/Atomic)   ← 4% nodes → 64% coverage (Pareto²)
      │ Pareto extraction
L2 (Concept-graph)        ← 20% nodes → 80% coverage (Pareto¹)
      │ emergent clustering
L3 (Detail-graph)         ← 100% nodes → ground truth
L0 (元图谱/Schema)    ← 0.8%节点 → 51%覆盖率(帕累托³)
      │ 溯因泛化
L1 (逻辑图谱/原子层)   ← 4%节点 → 64%覆盖率(帕累托²)
      │ 帕累托提取
L2 (概念图谱)        ← 20%节点 → 80%覆盖率(帕累托¹)
      │ 涌现式聚类
L3 (细节图谱)         ← 100%节点 → 底层事实

Level Specifications

层级规格

LevelRoleNode %CoverageRatio to L3
L0Meta-graph/Schema0.8%51%6-9:1 to L1
L1Logic-graph/Atomic4%64%2-3:1 to L2
L2Concept-graph/Composite20%80%
L3Detail-graph/Ground-truth100%100%
层级作用节点占比覆盖率与下层的比例
L0元图谱/Schema0.8%51%与L1的比例为6-9:1
L1逻辑图谱/原子层4%64%与L2的比例为2-3:1
L2概念图谱/组合层20%80%
L3细节图谱/底层事实100%100%

Node Ratio Constraints

节点比例约束

  • L1:L2 = 2-3:1 (atomic to composite)
  • L1:L2 = 9-12:1 (logic to concept)
  • L1:L3 = 6-9:1 (atomic to detail)
  • Generation constraint: 2-3 children per node at any level
  • L1:L2 = 2-3:1(原子层与组合层)
  • L1:L2 = 9-12:1(逻辑层与概念层)
  • L1:L3 = 6-9:1(原子层与细节层)
  • 生成约束:任意层级每个节点最多有2-3个子节点

Quick Start

快速开始

1. Domain Analysis

1. 领域分析

python
from rpp import RPPGenerator
python
from rpp import RPPGenerator

Initialize with domain text

用领域文本初始化

rpp = RPPGenerator(domain="pharmacology")
rpp = RPPGenerator(domain="pharmacology")

Extract ground truth (L3)

提取底层事实(L3)

l3_graph = rpp.extract_details(corpus)
undefined
l3_graph = rpp.extract_details(corpus)
undefined

2. Hierarchical Construction

2. 层级构建

python
undefined
python
undefined

Bottom-up: L3 → L2 → L1 → L0

自底向上:L3 → L2 → L1 → L0

l2_graph = rpp.cluster_concepts(l3_graph, pareto_threshold=0.8) l1_graph = rpp.extract_atomics(l2_graph, pareto_threshold=0.8) l0_schema = rpp.generalise_schema(l1_graph, pareto_threshold=0.8)
l2_graph = rpp.cluster_concepts(l3_graph, pareto_threshold=0.8) l1_graph = rpp.extract_atomics(l2_graph, pareto_threshold=0.8) l0_schema = rpp.generalise_schema(l1_graph, pareto_threshold=0.8)

Validate ratios

验证比例

rpp.validate_ratios(l0_schema, l1_graph, l2_graph, l3_graph)
undefined
rpp.validate_ratios(l0_schema, l1_graph, l2_graph, l3_graph)
undefined

3. Topology Validation

3. 拓扑验证

python
undefined
python
undefined

Ensure small-world properties

确保具备小世界特性

metrics = rpp.validate_topology( target_eta=4.0, # Edge density target_ratio_l1_l2=(2, 3), target_ratio_l1_l3=(6, 9) )
undefined
metrics = rpp.validate_topology( target_eta=4.0, # 边密度 target_ratio_l1_l2=(2, 3), target_ratio_l1_l3=(6, 9) )
undefined

Construction Methods

构建方法

Bottom-Up (Reconstruction)

自底向上(重构)

Start from first principles, build emergent complexity:
L3 details → cluster → L2 concepts → extract → L1 atomics → generalise → L0 schema
Use when: Ground truth is well-defined, deriving principles from evidence.
从第一性原理出发,构建涌现式复杂度:
L3细节 → 聚类 → L2概念 → 提取 → L1原子层 → 泛化 → L0 Schema
适用场景:底层事实定义清晰,从证据推导原理。

Top-Down (Decomposition)

自顶向下(分解)

Start from control systems, decompose to details:
L0 schema → derive → L1 atomics → expand → L2 concepts → ground → L3 details
Use when: Schema exists, validating against domain specifics.
从控制系统出发,分解至细节:
L0 Schema → 推导 → L1原子层 → 扩展 → L2概念 → 落地 → L3细节
适用场景:已有Schema,需针对领域细节进行验证。

Bidirectional (Recommended)

双向构建(推荐)

Simultaneous construction with convergence:
┌─────────────────────────────────────────┐
│ Bottom-Up          ⊗          Top-Down │
│ L3→L2→L1→L0       merge        L0→L1→L2→L3 │
│         └───────→ L2 ←───────┘         │
│              convergence               │
└─────────────────────────────────────────┘
Use when: Iterative refinement needed, validating both directions.
同时进行双向构建并实现收敛:
┌─────────────────────────────────────────┐
│ 自底向上          ⊗          自顶向下 │
│ L3→L2→L1→L0       合并        L0→L1→L2→L3 │
│         └───────→ L2 ←───────┘         │
│              收敛过程               │
└─────────────────────────────────────────┘
适用场景:需要迭代优化,同时验证双向逻辑。

Graph Topology

图谱拓扑

Small-World Properties

小世界特性

The RPP graph exhibits:
  • High clustering — Related concepts form dense clusters
  • Short path length — Any two nodes connected via few hops
  • Core-peripheral structure — L0/L1 form core, L2/L3 form periphery
  • Orthogonal bridges — Unexpected cross-hierarchical connections
RPP图谱具备以下特性:
  • 高聚类性 — 相关概念形成密集集群
  • 短路径长度 — 任意两个节点通过少量步骤即可连接
  • 核心-外围结构 — L0/L1构成核心,L2/L3构成外围
  • 正交桥接边 — 跨层级的意外关联连接

Topology Targets

拓扑目标

MetricTargetValidation
η (density)≥ 4.0
graph.validate_topology()
κ (clustering)> 0.3Small-world coefficient
φ (isolation)< 0.2No orphan nodes
Bridge edgesPresentCross-level connections
指标目标值验证方式
η(密度)≥ 4.0
graph.validate_topology()
κ(聚类系数)> 0.3小世界系数
φ(孤立度)< 0.2无孤立节点
桥接边存在跨层级连接

Edge Types

边的类型

  1. Vertical edges — Parent-child across levels (L0↔L1↔L2↔L3)
  2. Horizontal edges — Sibling relations within level
  3. Hyperedges — Multi-node interactions (weighted by semantic importance)
  4. Bridge edges — Orthogonal cross-hierarchical connections
  1. 垂直边 — 跨层级的父子关系(L0↔L1↔L2↔L3)
  2. 水平边 — 同层级内的兄弟关系
  3. 超边 — 多节点交互(按语义重要性加权)
  4. 桥接边 — 正交跨层级连接

Pareto Extraction Algorithm

帕累托提取算法

python
def pareto_extract(source_graph, target_ratio=0.2):
    """
    Extract Pareto-optimal nodes from source graph.
    
    Args:
        source_graph: Input graph (e.g., L3 for extracting L2)
        target_ratio: Target node reduction (default 20% = 0.2)
    
    Returns:
        Reduced graph with target_ratio * |source| nodes
        grounding (1 - target_ratio) of semantic coverage
    """
    # 1. Compute node importance (PageRank + semantic weight)
    importance = compute_importance(source_graph)
    
    # 2. Select top nodes by cumulative coverage
    selected = []
    coverage = 0.0
    for node in sorted(importance, reverse=True):
        selected.append(node)
        coverage += node.coverage_contribution
        if coverage >= (1 - target_ratio):
            break
    
    # 3. Verify Pareto constraint
    assert len(selected) / len(source_graph) <= target_ratio
    assert coverage >= (1 - target_ratio)
    
    # 4. Build reduced graph preserving topology
    return build_subgraph(selected, preserve_bridges=True)
python
def pareto_extract(source_graph, target_ratio=0.2):
    """
    Extract Pareto-optimal nodes from source graph.
    
    Args:
        source_graph: Input graph (e.g., L3 for extracting L2)
        target_ratio: Target node reduction (default 20% = 0.2)
    
    Returns:
        Reduced graph with target_ratio * |source| nodes
        grounding (1 - target_ratio) of semantic coverage
    """
    # 1. Compute node importance (PageRank + semantic weight)
    importance = compute_importance(source_graph)
    
    # 2. Select top nodes by cumulative coverage
    selected = []
    coverage = 0.0
    for node in sorted(importance, reverse=True):
        selected.append(node)
        coverage += node.coverage_contribution
        if coverage >= (1 - target_ratio):
            break
    
    # 3. Verify Pareto constraint
    assert len(selected) / len(source_graph) <= target_ratio
    assert coverage >= (1 - target_ratio)
    
    # 4. Build reduced graph preserving topology
    return build_subgraph(selected, preserve_bridges=True)

Integration Points

集成点

With graph skill

与graph技能集成

python
undefined
python
undefined

Validate RPP topology

验证RPP拓扑

from graph import validate_topology metrics = validate_topology(rpp_graph, require_eta=4.0)
undefined
from graph import validate_topology metrics = validate_topology(rpp_graph, require_eta=4.0)
undefined

With abduct skill

与abduct技能集成

python
undefined
python
undefined

Refactor schema for optimisation

优化Schema重构

from abduct import refactor_schema l0_optimised = refactor_schema(l0_schema, target_compression=0.8)
undefined
from abduct import refactor_schema l0_optimised = refactor_schema(l0_schema, target_compression=0.8)
undefined

With mega skill

与mega技能集成

python
undefined
python
undefined

Extend to n-SuperHyperGraphs for complex domains

扩展至n-SuperHyperGraphs以适配复杂领域

from mega import extend_to_superhypergraph shg = extend_to_superhypergraph(rpp_graph, max_hyperedge_arity=5)
undefined
from mega import extend_to_superhypergraph shg = extend_to_superhypergraph(rpp_graph, max_hyperedge_arity=5)
undefined

With infranodus MCP

与infranodus MCP集成

python
undefined
python
undefined

Detect structural gaps

检测结构缺口

gaps = mcp__infranodus__generateContentGaps(rpp_graph.to_text()) bridges = mcp__infranodus__getGraphAndAdvice(optimize="gaps")
undefined
gaps = mcp__infranodus__generateContentGaps(rpp_graph.to_text()) bridges = mcp__infranodus__getGraphAndAdvice(optimize="gaps")
undefined

Scale Invariance Principles

尺度不变性原理

The RPP framework embodies scale-invariant patterns:
PrincipleApplication in RPP
Fractal self-similarityEach level mirrors whole structure
Pareto distribution80/20 at each level compounds
NeuroplasticityPruning weak, amplifying strong connections
Free energy principleMinimising surprise through compression
Critical phase transitionsLevel boundaries as phase transitions
Power-law distributionNode importance follows power law
RPP框架体现了尺度不变模式:
原理在RPP中的应用
分形自相似性每个层级都镜像整体结构
帕累托分布每一层级都遵循80/20规则并复合
神经可塑性修剪弱连接,强化强连接
自由能原理通过压缩最小化不确定性
临界相变层级边界作为相变点
幂律分布节点重要性遵循幂律

References

参考资料

For detailed implementation, see:
NeedFile
Level-specific constructionreferences/level-construction.md
Topology validationreferences/topology-validation.md
Pareto algorithmsreferences/pareto-algorithms.md
Scale invariance theoryreferences/scale-invariance.md
Integration patternsreferences/integration-patterns.md
Examples and templatesreferences/examples.md
如需详细实现细节,请查看:
需求文件
层级特定构建references/level-construction.md
拓扑验证references/topology-validation.md
帕累托算法references/pareto-algorithms.md
尺度不变性理论references/scale-invariance.md
集成模式references/integration-patterns.md
示例与模板references/examples.md

Scripts

脚本

ScriptPurpose
scripts/rpp_generator.pyCore RPP graph generation
scripts/pareto_extract.pyLevel extraction algorithm
scripts/validate_ratios.pyNode ratio validation
scripts/topology_check.pySmall-world validation
脚本用途
scripts/rpp_generator.py核心RPP图谱生成
scripts/pareto_extract.py层级提取算法
scripts/validate_ratios.py节点比例验证
scripts/topology_check.py小世界特性验证

Checklist

检查清单

Before Generation

生成前

  • Domain corpus available
  • Target level count defined (typically 4)
  • Integration skills accessible (graph, abduct)
  • 已准备领域语料库
  • 已定义目标层级数量(通常为4层)
  • 可访问集成技能(graph、abduct等)

During Generation

生成中

  • L3 ground truth extracted
  • Each level achieves 80% coverage with 20% nodes
  • Node ratios within constraints
  • Hyperedge weights computed
  • 已提取L3底层事实
  • 每一层都用20%的节点实现了80%的覆盖率
  • 节点比例符合约束
  • 已计算超边权重

After Generation

生成后

  • Topology validated (η≥4)
  • Small-world coefficient verified
  • Bridge edges present
  • Schema exported in required format

λL.τ                     L3→L2→L1→L0 via Pareto extraction
80/20 → 64/4 → 51/0.8   recursive compression chain
rpp                      hierarchical knowledge architecture
  • 已验证拓扑结构(η≥4)
  • 已验证小世界系数
  • 存在桥接边
  • 已按要求格式导出Schema

λL.τ                     基于帕累托提取的L3→L2→L1→L0流程
80/20 → 64/4 → 51/0.8   递归压缩链
rpp                      层级知识架构