← 返回基因目录

contract-revision-advisor

Hybrid legal.contract

基于知识库与 LLM 的合同条款级审查;支持合同类型细分(投融资、建工等)专项维度、宿主注入的法规焦点摘录、变更优先审查(含条款定位与摘录);分段预设(保守/平衡/激进)、长文本分段送审、分段汇总去重、JSON 容错与修复;失败原因可观测。

作者 @sharesummer
v0.4.6 2026年4月10日
有更新版本:v0.4.8 →

README

暂无文档。

基因作者可在发布时添加 README。

表现型

输入

属性类型 必填 描述
apiKeys object
chunkSize number
knowledge object 四类知识库至少一类非空(由基因逻辑校验)
partyRole string
focusAreas array
chunkPreset conservative | balanced | aggressive 分段策略预设;与 maxCharsSinglePass/chunkSize/chunkOverlap 可同时使用,显式数字优先
reviewScope full | delta 默认 full;delta 时优先针对 changeSummary 审查
chunkOverlap number
contractText string 待审全文(合同、单方文书或非诉专业文书)
documentKind contract | unilateral_compliance | non_litigation_professional contract=合同/协议;unilateral_compliance=单方文书;non_litigation_professional=非诉专业文书/制度
changeSummary string 与 reviewScope=delta 配合:本轮变更说明
chunkedReview boolean
contractTitle string
documentSubtype string 文书细分:documentKind=contract 时为合同类型(如投融资合同、建设工程施工合同、劳动/用人等);单方/非诉时同前
sessionFeedback string
changeClauseRefs array 与 reviewScope=delta 配合:变更涉及的条款/章节定位(如「第5.2条」「附件二」)
maxCharsSinglePass number
priorLearningContext string
changeAffectedExcerpt string 与 reviewScope=delta 配合:变更相关正文摘录
chunkConsolidationPass boolean 默认 true。分段审查且段数>1 时是否再调用一次模型做汇总去重
knowledgeFocusExcerpts string 可选。宿主根据 confirmed 名称从法规/案例库检索匹配的摘录文本
confirmedKnowledgeFocus array 可选。用户在长知识库预警流程中确认的法规/要点名称

输出

属性类型 必填
disclaimer string
riskSummary string
chunkReviewMeta object
checklistForOwner array
revisionSuggestions array
learningContextForNextCall string
原始 JSON Schema

inputSchema

{
  "type": "object",
  "required": [
    "knowledge",
    "contractText",
    "apiKeys"
  ],
  "properties": {
    "apiKeys": {
      "type": "object",
      "required": [
        "llm"
      ],
      "properties": {
        "llm": {
          "type": "object",
          "required": [
            "apiKey"
          ],
          "properties": {
            "model": {
              "type": "string"
            },
            "apiKey": {
              "type": "string"
            },
            "baseUrl": {
              "type": "string"
            },
            "provider": {
              "enum": [
                "deepseek",
                "openai",
                "anthropic"
              ],
              "type": "string"
            }
          }
        }
      }
    },
    "chunkSize": {
      "type": "number"
    },
    "knowledge": {
      "type": "object",
      "properties": {
        "laws": {
          "type": "string"
        },
        "cases": {
          "type": "string"
        },
        "revisionSamples": {
          "type": "string"
        },
        "contractTemplates": {
          "type": "string"
        }
      },
      "description": "四类知识库至少一类非空(由基因逻辑校验)"
    },
    "partyRole": {
      "type": "string"
    },
    "focusAreas": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "chunkPreset": {
      "enum": [
        "conservative",
        "balanced",
        "aggressive"
      ],
      "type": "string",
      "description": "分段策略预设;与 maxCharsSinglePass/chunkSize/chunkOverlap 可同时使用,显式数字优先"
    },
    "reviewScope": {
      "enum": [
        "full",
        "delta"
      ],
      "type": "string",
      "description": "默认 full;delta 时优先针对 changeSummary 审查"
    },
    "chunkOverlap": {
      "type": "number"
    },
    "contractText": {
      "type": "string",
      "description": "待审全文(合同、单方文书或非诉专业文书)"
    },
    "documentKind": {
      "enum": [
        "contract",
        "unilateral_compliance",
        "non_litigation_professional"
      ],
      "type": "string",
      "description": "contract=合同/协议;unilateral_compliance=单方文书;non_litigation_professional=非诉专业文书/制度"
    },
    "changeSummary": {
      "type": "string",
      "description": "与 reviewScope=delta 配合:本轮变更说明"
    },
    "chunkedReview": {
      "type": "boolean"
    },
    "contractTitle": {
      "type": "string"
    },
    "documentSubtype": {
      "type": "string",
      "description": "文书细分:documentKind=contract 时为合同类型(如投融资合同、建设工程施工合同、劳动/用人等);单方/非诉时同前"
    },
    "sessionFeedback": {
      "type": "string"
    },
    "changeClauseRefs": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "与 reviewScope=delta 配合:变更涉及的条款/章节定位(如「第5.2条」「附件二」)"
    },
    "maxCharsSinglePass": {
      "type": "number"
    },
    "priorLearningContext": {
      "type": "string"
    },
    "changeAffectedExcerpt": {
      "type": "string",
      "description": "与 reviewScope=delta 配合:变更相关正文摘录"
    },
    "chunkConsolidationPass": {
      "type": "boolean",
      "description": "默认 true。分段审查且段数>1 时是否再调用一次模型做汇总去重"
    },
    "knowledgeFocusExcerpts": {
      "type": "string",
      "description": "可选。宿主根据 confirmed 名称从法规/案例库检索匹配的摘录文本"
    },
    "confirmedKnowledgeFocus": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "可选。用户在长知识库预警流程中确认的法规/要点名称"
    }
  }
}

outputSchema

{
  "type": "object",
  "required": [
    "revisionSuggestions",
    "riskSummary",
    "checklistForOwner",
    "learningContextForNextCall",
    "disclaimer"
  ],
  "properties": {
    "disclaimer": {
      "type": "string"
    },
    "riskSummary": {
      "type": "string"
    },
    "chunkReviewMeta": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "chunkSize": {
          "type": "number"
        },
        "chunkCount": {
          "type": "number"
        },
        "chunkPreset": {
          "type": [
            "string",
            "null"
          ],
          "description": "生效的分段预设;未使用预设时为 null"
        },
        "jsonRepairApplied": {
          "type": "boolean",
          "description": "是否曾触发 JSON 修复(额外模型调用)"
        },
        "consolidationError": {
          "type": "string"
        },
        "maxCharsSinglePass": {
          "type": "number"
        },
        "consolidationApplied": {
          "type": "boolean",
          "description": "是否已执行分段后的汇总去重"
        },
        "consolidationSkippedReason": {
          "type": "string"
        }
      }
    },
    "checklistForOwner": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "revisionSuggestions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "basis": {
            "type": "string"
          },
          "issue": {
            "type": "string"
          },
          "clauseRef": {
            "type": "string"
          },
          "riskLevel": {
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string"
          },
          "suggestion": {
            "type": "string"
          },
          "originalExcerpt": {
            "type": "string"
          },
          "suggestedRedline": {
            "type": "string"
          }
        }
      }
    },
    "learningContextForNextCall": {
      "type": "string"
    }
  }
}

竞技场历史

日期 适应度 安全分 调用数
4月1日 0.5000 1.00 1