oclaw/openclaw/extensions/open-prose/skills/prose/examples/43-rlm-pairwise.prose
oliver dbbe3add6a 重构主控编排与运行时预热链路,统一工作区提示词/专家调度协议并补齐 wiki 记忆注入与写回闭环。
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。

Made-with: Cursor
2026-04-26 08:34:33 +08:00

50 lines
1.2 KiB
Text

# RLM: Pairwise Analysis
# O(n²) tasks through batched pair processing
# Base LLMs: <1% accuracy. RLMs: 58%. (OOLONG-Pairs benchmark)
input items: "Items to compare pairwise"
input relation: "Relationship to identify"
agent comparator:
model: sonnet
prompt: "Analyze relationship. Return: {pair, relation, strength, evidence}."
agent mapper:
model: opus
prompt: "Build relationship map. Identify clusters and anomalies."
block pairs(list):
let result = []
for i, a in list:
for j, b in list:
if j > i:
result = result + [{first: a, second: b}]
output result
block analyze(items, rel, depth):
let all_pairs = do pairs(items)
if **fewer than 100 pairs** or depth <= 0:
output all_pairs | pmap:
session: comparator
prompt: "Analyze {rel}"
context: item
let batches = session "Split into batches of ~25 pairs"
context: all_pairs
let results = []
parallel for batch in batches:
let batch_results = batch | pmap:
session: comparator
prompt: "Analyze {rel}"
context: item
results = results + batch_results
output results
let relationships = do analyze(items, relation, 2)
output map = session: mapper
prompt: "Build {relation} map"
context: { items, relationships }