rpp
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRecursive 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 truthL0 (元图谱/Schema) ← 0.8%节点 → 51%覆盖率(帕累托³)
│ 溯因泛化
▼
L1 (逻辑图谱/原子层) ← 4%节点 → 64%覆盖率(帕累托²)
│ 帕累托提取
▼
L2 (概念图谱) ← 20%节点 → 80%覆盖率(帕累托¹)
│ 涌现式聚类
▼
L3 (细节图谱) ← 100%节点 → 底层事实Level Specifications
层级规格
| Level | Role | Node % | Coverage | Ratio to L3 |
|---|---|---|---|---|
| L0 | Meta-graph/Schema | 0.8% | 51% | 6-9:1 to L1 |
| L1 | Logic-graph/Atomic | 4% | 64% | 2-3:1 to L2 |
| L2 | Concept-graph/Composite | 20% | 80% | — |
| L3 | Detail-graph/Ground-truth | 100% | 100% | — |
| 层级 | 作用 | 节点占比 | 覆盖率 | 与下层的比例 |
|---|---|---|---|---|
| L0 | 元图谱/Schema | 0.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 RPPGeneratorpython
from rpp import RPPGeneratorInitialize with domain text
用领域文本初始化
rpp = RPPGenerator(domain="pharmacology")
rpp = RPPGenerator(domain="pharmacology")
Extract ground truth (L3)
提取底层事实(L3)
l3_graph = rpp.extract_details(corpus)
undefinedl3_graph = rpp.extract_details(corpus)
undefined2. Hierarchical Construction
2. 层级构建
python
undefinedpython
undefinedBottom-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)
undefinedrpp.validate_ratios(l0_schema, l1_graph, l2_graph, l3_graph)
undefined3. Topology Validation
3. 拓扑验证
python
undefinedpython
undefinedEnsure 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)
)
undefinedmetrics = rpp.validate_topology(
target_eta=4.0, # 边密度
target_ratio_l1_l2=(2, 3),
target_ratio_l1_l3=(6, 9)
)
undefinedConstruction Methods
构建方法
Bottom-Up (Reconstruction)
自底向上(重构)
Start from first principles, build emergent complexity:
L3 details → cluster → L2 concepts → extract → L1 atomics → generalise → L0 schemaUse 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 detailsUse 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
拓扑目标
| Metric | Target | Validation |
|---|---|---|
| η (density) | ≥ 4.0 | |
| κ (clustering) | > 0.3 | Small-world coefficient |
| φ (isolation) | < 0.2 | No orphan nodes |
| Bridge edges | Present | Cross-level connections |
| 指标 | 目标值 | 验证方式 |
|---|---|---|
| η(密度) | ≥ 4.0 | |
| κ(聚类系数) | > 0.3 | 小世界系数 |
| φ(孤立度) | < 0.2 | 无孤立节点 |
| 桥接边 | 存在 | 跨层级连接 |
Edge Types
边的类型
- Vertical edges — Parent-child across levels (L0↔L1↔L2↔L3)
- Horizontal edges — Sibling relations within level
- Hyperedges — Multi-node interactions (weighted by semantic importance)
- Bridge edges — Orthogonal cross-hierarchical connections
- 垂直边 — 跨层级的父子关系(L0↔L1↔L2↔L3)
- 水平边 — 同层级内的兄弟关系
- 超边 — 多节点交互(按语义重要性加权)
- 桥接边 — 正交跨层级连接
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
undefinedpython
undefinedValidate RPP topology
验证RPP拓扑
from graph import validate_topology
metrics = validate_topology(rpp_graph, require_eta=4.0)
undefinedfrom graph import validate_topology
metrics = validate_topology(rpp_graph, require_eta=4.0)
undefinedWith abduct skill
与abduct技能集成
python
undefinedpython
undefinedRefactor schema for optimisation
优化Schema重构
from abduct import refactor_schema
l0_optimised = refactor_schema(l0_schema, target_compression=0.8)
undefinedfrom abduct import refactor_schema
l0_optimised = refactor_schema(l0_schema, target_compression=0.8)
undefinedWith mega skill
与mega技能集成
python
undefinedpython
undefinedExtend to n-SuperHyperGraphs for complex domains
扩展至n-SuperHyperGraphs以适配复杂领域
from mega import extend_to_superhypergraph
shg = extend_to_superhypergraph(rpp_graph, max_hyperedge_arity=5)
undefinedfrom mega import extend_to_superhypergraph
shg = extend_to_superhypergraph(rpp_graph, max_hyperedge_arity=5)
undefinedWith infranodus MCP
与infranodus MCP集成
python
undefinedpython
undefinedDetect structural gaps
检测结构缺口
gaps = mcp__infranodus__generateContentGaps(rpp_graph.to_text())
bridges = mcp__infranodus__getGraphAndAdvice(optimize="gaps")
undefinedgaps = mcp__infranodus__generateContentGaps(rpp_graph.to_text())
bridges = mcp__infranodus__getGraphAndAdvice(optimize="gaps")
undefinedScale Invariance Principles
尺度不变性原理
The RPP framework embodies scale-invariant patterns:
| Principle | Application in RPP |
|---|---|
| Fractal self-similarity | Each level mirrors whole structure |
| Pareto distribution | 80/20 at each level compounds |
| Neuroplasticity | Pruning weak, amplifying strong connections |
| Free energy principle | Minimising surprise through compression |
| Critical phase transitions | Level boundaries as phase transitions |
| Power-law distribution | Node importance follows power law |
RPP框架体现了尺度不变模式:
| 原理 | 在RPP中的应用 |
|---|---|
| 分形自相似性 | 每个层级都镜像整体结构 |
| 帕累托分布 | 每一层级都遵循80/20规则并复合 |
| 神经可塑性 | 修剪弱连接,强化强连接 |
| 自由能原理 | 通过压缩最小化不确定性 |
| 临界相变 | 层级边界作为相变点 |
| 幂律分布 | 节点重要性遵循幂律 |
References
参考资料
For detailed implementation, see:
| Need | File |
|---|---|
| Level-specific construction | references/level-construction.md |
| Topology validation | references/topology-validation.md |
| Pareto algorithms | references/pareto-algorithms.md |
| Scale invariance theory | references/scale-invariance.md |
| Integration patterns | references/integration-patterns.md |
| Examples and templates | references/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
脚本
| Script | Purpose |
|---|---|
| scripts/rpp_generator.py | Core RPP graph generation |
| scripts/pareto_extract.py | Level extraction algorithm |
| scripts/validate_ratios.py | Node ratio validation |
| scripts/topology_check.py | Small-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 层级知识架构