分解
  
停止提示。开始分解。
AI代理的确定性文本分类。分解可以立即将任何文本转换为分类的、结构化的语义单元。没有法学硕士。没有设置。一个函数调用。
______________________________________________________________________
之前:您的代理人阅读此内容
The contractor shall provide all materials per ASTM C150-20. Maximum load
shall not exceed 500 psf per ASCE 7-22. Notice to proceed within 14 calendar
days of contract execution. Retainage of 10% applies to all payments.
For general background, the project is located in Denver, CO...之后:您的代理人阅读此内容
[
{
"text": "The contractor shall provide all materials per ASTM C150-20.",
"authority": "mandatory",
"risk": "compliance",
"type": "requirement",
"irreducible": true,
"attention": 8.0,
"entities": ["ASTM C150-20"]
},
{
"text": "Maximum load shall not exceed 500 psf per ASCE 7-22.",
"authority": "prohibitive",
"risk": "safety_critical",
"type": "constraint",
"irreducible": true,
"attention": 10.0,
"entities": ["ASCE 7-22"]
}
]每个单位都进行了分类。提取每个标准。每个风险都得分了。你的经纪人知道什么是重要的。
______________________________________________________________________
安装
pip install decompose-mcp用作MCP服务器
添加到代理的MCP配置中(Claude Code、Cursor、Windsurf等):
{
"mcpServers": {
"decompose": {
"command": "uvx",
"args": ["decompose-mcp", "--serve"]
}
}
}你的代理人有两个工具:
decompose_text--分解任何文本decompose_url--获取URL并分解其内容
开爪
从ClawHub安装技能或直接配置:
{
"mcpServers": {
"decompose": {
"command": "python3",
"args": ["-m", "decompose", "--serve"]
}
}
}或者安装技能: clawdhub install decompose-mcp
用作CLI
# Pipe text
cat spec.txt | decompose --pretty
# Inline
decompose --text "The contractor shall provide all materials per ASTM C150-20."
# Compact output (smaller JSON)
cat document.md | decompose --compact用作图书馆
from decompose import decompose_text, filter_for_llm
result = decompose_text("The contractor shall provide all materials per ASTM C150-20.")
for unit in result["units"]:
print(f"[{unit['authority']}] [{unit['risk']}] {unit['text'][:60]}...")
# Pre-filter for LLM context — keep only high-value units
filtered = filter_for_llm(result, max_tokens=4000)
print(f"{filtered['meta']['reduction_pct']}% token reduction")
llm_input = filtered["text"] # Ready for your LLM______________________________________________________________________
每个字段的含义
| 字段 | 值 | 它告诉您的代理 |
|---|---|---|
authority | 强制性、禁止性、指令性、许可性、条件性、信息性 | 这是硬性要求还是背景? |
risk | 安全_关键、安全、合规、财务、合同、咨询、信息 | 这有多重要? |
type | 需求、定义、参考、约束、叙述、数据 | 这是什么类型的内容? |
irreducible | true/false | 必须逐字保存吗? |
attention | 0.0-10.0 | 代理应该在这里花费多少计算? |
entities | 标准、规范、规定 | 引用了哪些正式参考文献? |
actionable | true/false | 有人需要做某事吗? |
______________________________________________________________________
用这个构建什么
分解不是目的地。这是大多数开发人员跳过的LLM之前的步骤——不是因为它很难,而是因为没有人向他们展示它的存在。文档具有结构。这种结构是可以分类的。分类应该在推理之前进行。
Without: document → chunk → embed → retrieve → LLM → answer (100% of tokens)
With: document → decompose → filter/route → LLM → answer (20-40% of tokens)过滤器:内置LLM预过滤器
filter_for_llm() 保留强制性、安全关键性、财务和合规性部门——在样板到达您的LLM或矢量存储之前将其删除。
from decompose import decompose_text, filter_for_llm
result = decompose_text(open("contract.md").read())
filtered = filter_for_llm(result, max_tokens=4000)
# filtered["text"] = high-value units only, ready for LLM
# filtered["meta"]["reduction_pct"] = how much was dropped (typically 60-80%)
# Or use the units directly for embedding
for unit in filtered["units"]:
embed_and_store(unit["text"], metadata={
"authority": unit["authority"],
"risk": unit["risk"],
"attention": unit["attention"],
})途径:基于风险的处理
安全关键内容进入一个链。财务内容转到另一个。锅炉板被跳过。
from decompose import decompose_text
result = decompose_text(spec_text)
for unit in result["units"]:
if unit["risk"] == "safety_critical":
safety_chain.process(unit) # Full analysis + human review
elif unit["risk"] == "financial":
audit_chain.process(unit) # Flag for finance team
elif unit["attention"] = 1.0]
print(f"{len(high)}/{total} units need LLM analysis")
print(f"{100 - len(high) * 100 // total}% token reduction")看 examples/ 用于可运行的脚本。
______________________________________________________________________
为什么没有法学硕士?
分解运行在纯正则表达式和启发式算法上。没有Ollama,没有API密钥,没有GPU,没有推理成本。
这是故意的:
- 快:50页规格小于500ms
- 确定性的:相同的输入总是产生相同的输出
- 离线:在飞机上、CI上气隙工作
- 可组合:您的代理对结构化输出的LLM原因——分解处理预处理
LLM是什么 *代理* 使用。分解可以让你运行的任何模型更好地工作。
______________________________________________________________________
由Echology建造
分解是由构建的 回声学 并从中提取 AECai,一个面向建筑、工程和建筑公司的文档智能平台。分类模式、实体提取和不可约性检测经过数千个真实AEC文档的战斗测试,这些文档包括规范、合同、RFI、检查报告和支付应用程序。
Decompose获得了独立性——它最初是AECai的文本分类模块,被证明足够通用,可以跨领域(保险、交易、监管)工作,并且是独立发布的。免费,麻省理工学院授权。
案例研究:开放式圣经智能
对工程规范进行分类的相同组块和实体提取模式也构成了圣经。 开放式圣经智能 使用Decompose的Markdown感知分块器和正则表达式实体提取将31100节经文转换为具有344799条交叉引用边和语义嵌入的知识图,证明该方法与领域无关。
博客
- 当Regex击败LLM时 --分解将MCP规范分类为3.78ms
- 为什么你的代理人需要一个认知原语 --注意力评分、不可约性和路由
- “模拟感知”实际上意味着什么 --AECai背后的架构
许可证: 麻省理工学院-版权所有(c)2025-2026回声学,股份有限公司。
